Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Remove or-thermostat component (#2470)

Martin Peetersc706a7fb7854
diff --git a/ui/component/or-thermostat/.npmignore b/ui/component/or-thermostat/.npmignore
deleted file mode 100644
index b2544e0f1..000000000
--- a/ui/component/or-thermostat/.npmignore
+++ /dev/null
@@ -1,9 +0,0 @@
-build/
-build.gradle
-test/
-src/
-webpack.config.js
-rspack.config.js
-tsconfig.json
-dist/*.map
-*.tsbuildinfo
diff --git a/ui/component/or-thermostat/README.md b/ui/component/or-thermostat/README.md
deleted file mode 100644
index d70644ba9..000000000
--- a/ui/component/or-thermostat/README.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# @openremote/or-thermostat \<or-thermostat\>
-[![NPM Version][npm-image]][npm-url]
-[![Linux Build][travis-image]][travis-url]
-[![Test Coverage][coveralls-image]][coveralls-url]
-
-Web Component for displaying a thermostat control for a room Asset.
-
-## Install
-```bash
-npm i @openremote/or-thermostat
-yarn add @openremote/or-thermostat
-```
-
-## Usage
-For a full list of properties, methods and options refer to the TypeDoc generated [documentation]().
-
-
-## Supported Browsers
-The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition,
-Internet Explorer 11 is also supported.
-
-
-## License
-[GNU AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html)
-
-[npm-image]: https://img.shields.io/npm/v/live-xxx.svg
-[npm-url]: https://npmjs.org/package/@openremote/or-thermostat
-[travis-image]: https://img.shields.io/travis/live-js/live-xxx/master.svg
-[travis-url]: https://travis-ci.org/live-js/live-xxx
-[coveralls-image]: https://img.shields.io/coveralls/live-js/live-xxx/master.svg
-[coveralls-url]: https://coveralls.io/r/live-js/live-xxx?branch=master
diff --git a/ui/component/or-thermostat/build.gradle b/ui/component/or-thermostat/build.gradle
deleted file mode 100644
index 715a0847b..000000000
--- a/ui/component/or-thermostat/build.gradle
+++ /dev/null
@@ -1,26 +0,0 @@
-buildDir = "dist"
-
-tasks.register('clean') {
- doLast {
- delete "dist"
- delete "lib"
- }
-}
-
-tasks.register('npmAnalyze', Exec) {
- mustRunAfter npmClean
- dependsOn getYarnInstallTask()
- commandLine npmCommand("yarn"), "run", "analyze"
-}
-
-tasks.register('installDist') {
- dependsOn npmAnalyze
-}
-
-tasks.register('prepareUi') {
- dependsOn clean, npmAnalyze, npmPrepare
-}
-
-tasks.register('publishUi') {
- dependsOn clean, npmPublish
-}
diff --git a/ui/component/or-thermostat/package.json b/ui/component/or-thermostat/package.json
deleted file mode 100644
index ba4b1a249..000000000
--- a/ui/component/or-thermostat/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "@openremote/or-thermostat",
- "version": "1.14.0-snapshot",
- "description": "A thermostat component for viewing current temperature and setting target temperature",
- "customElements": "custom-elements.json",
- "main": "dist/umd/index.bundle.js",
- "module": "lib/index.js",
- "exports": {
- ".": "./lib/index.js",
- "./*": "./lib/*.js",
- "./jsx": {
- "types": "./custom-elements-jsx.d.ts"
- }
- },
- "types": "lib/index.d.ts",
- "scripts": {
- "analyze": "npx cem analyze --config ../custom-elements-manifest.config.mjs",
- "test": "echo \"No tests\" && exit 0",
- "prepack": "npx rspack"
- },
- "author": "OpenRemote",
- "license": "AGPL-3.0-or-later",
- "dependencies": {
- "@openremote/core": "workspace:*",
- "@openremote/model": "workspace:*",
- "lit": "^3.3.1"
- },
- "publishConfig": {
- "access": "public"
- }
-}
diff --git a/ui/component/or-thermostat/rspack.config.js b/ui/component/or-thermostat/rspack.config.js
deleted file mode 100644
index 06448283a..000000000
--- a/ui/component/or-thermostat/rspack.config.js
+++ /dev/null
@@ -1,7 +0,0 @@
-const util = require("@openremote/util");
-
-bundles = {
- "index.bundle": undefined
-};
-
-module.exports = util.generateExports(__dirname);
diff --git a/ui/component/or-thermostat/src/index.ts b/ui/component/or-thermostat/src/index.ts
deleted file mode 100644
index e2dbf0da3..000000000
--- a/ui/component/or-thermostat/src/index.ts
+++ /dev/null
@@ -1,95 +0,0 @@
-import {css, html, LitElement} from "lit";
-import {customElement, property} from "lit/decorators.js";
-import manager from "@openremote/core";
-import {AttributeEvent} from "@openremote/model";
-
-@customElement("or-thermostat")
-class OrThermostat extends LitElement {
-
- @property({type: Boolean})
- private _drawerOpened = false;
-
- @property({type: String})
- private assetId = undefined;
-
- @property({type: String})
- private label = undefined;
-
- private _connected : boolean = false;
- private _subscriptionId : string | undefined = undefined;
- private _displayedLabel : string | undefined = undefined;
- private _currentTemperature : number = 0;
- private _targetTemperature : number = 0;
-
- async subscribe() {
-
- if (this._subscriptionId) {
- return;
- }
-
- let callback: (event: AttributeEvent) => void = (event) => {
- console.log("Event Received:" + JSON.stringify(event, null, 2));
- if (event
- && event.ref!.name === "targetTemperature") {
- this.targetTemperature = event.value;
- }
- if (event
- && event.ref!.name === "currentTemperature") {
- this.currentTemperature = event.value;
- }
- };
-
- const subscriptionId = await manager.events!.subscribeAttributeEvents([this.assetId!], false, callback);
- this._subscriptionId = subscriptionId;
- console.log("Subscribed: " + subscriptionId);
- };
-
- unsubscribe() {
- if (this._subscriptionId) {
- manager.events!.unsubscribe(this._subscriptionId);
- this._subscriptionId = undefined;
- }
- }
-
- static styles = css`
- `;
-
- private set displayedLabel (newValue:string) {
- let oldValue = this._displayedLabel;
- this._displayedLabel = newValue;
- this.requestUpdate("_displayedLabel", oldValue);
- };
-
- private set currentTemperature (newValue:number) {
- let oldValue = this._currentTemperature;
- this._currentTemperature = newValue;
- this.requestUpdate("_currentTemperature", oldValue);
- };
-
- private set targetTemperature (newValue:number) {
- let oldValue = this._targetTemperature;
- this._targetTemperature = newValue;
- this.requestUpdate("_targetTemperature", oldValue);
- };
-
- connectedCallback() {
- this._connected = true;
- if (this.assetId) {
- this.subscribe();
- }
- super.connectedCallback();
- }
- disconnectedCallback() {
- this._connected = false;
- this.unsubscribe();
- super.disconnectedCallback();
- }
-
- protected render() {
- return html`
- <p>${this._displayedLabel}</p>
- <p>${this._currentTemperature}</p>
- <p>${this._targetTemperature}</p>
- `;
- }
-}
diff --git a/ui/component/or-thermostat/tsconfig.json b/ui/component/or-thermostat/tsconfig.json
deleted file mode 100644
index 36a7c304b..000000000
--- a/ui/component/or-thermostat/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "extends": "../../tsconfig",
- "compilerOptions": {
- "outDir": "./lib",
- "rootDir": "src"
- },
- "include": [
- "./src"
- ],
- "references": [
- { "path": "../core" },
- { "path": "../rest" }
- ]
-}
diff --git a/yarn.lock b/yarn.lock
index e6b2548a9..9a032a827 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2191,16 +2191,6 @@ __metadata:
languageName: unknown
linkType: soft
-"@openremote/or-thermostat@workspace:ui/component/or-thermostat":
- version: 0.0.0-use.local
- resolution: "@openremote/or-thermostat@workspace:ui/component/or-thermostat"
- dependencies:
- "@openremote/core": "workspace:*"
- "@openremote/model": "workspace:*"
- lit: "npm:^3.3.1"
- languageName: unknown
- linkType: soft
-
"@openremote/or-timeline@workspace:ui/component/or-timeline":
version: 0.0.0-use.local
resolution: "@openremote/or-timeline@workspace:ui/component/or-timeline"