diff --git a/.npmignore b/.npmignore index d1f451c2..5e1832f3 100644 --- a/.npmignore +++ b/.npmignore @@ -138,6 +138,7 @@ web_modules/ # Github templates and actions, own stuff .github api +.husky .prettierrc .prettierignore commitlint.config.js \ No newline at end of file diff --git a/package.json b/package.json index 5a7f923c..7e470f34 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "main": "dist/index.js", "scripts": { "lint": "eslint src/**.ts", - "postinstall": "husky install", + "postinstall": "yarn husky install", "prepack": "yarn pinst --disable", "postpack": "yarn pinst --enable", "watch": "yarn dlx nodemon", diff --git a/src/dingzAccessory.ts b/src/dingzAccessory.ts index 70c246b5..e0c4a762 100644 --- a/src/dingzAccessory.ts +++ b/src/dingzAccessory.ts @@ -951,7 +951,7 @@ export class DingzAccessory extends DingzDaBaseAccessory { await this.setWindowCovering({ id: id, blind: position as number, - lamella: (windowCovering.lamella / 90) * 100, // FIXES #419, we must convert ° to % + lamella: windowCovering.lamella, // FIXES #419, we must convert ° to % callback: callback, }); } @@ -1518,7 +1518,7 @@ export class DingzAccessory extends DingzDaBaseAccessory { lamella = Math.round(lamella); this.log.debug( - `Setting WindowCovering ${id} to position ${blind} and angle ${lamella}°`, + `Setting WindowCovering ${id} to position ${blind} and ${lamella}% tilt position`, ); // The API says the parameters can be omitted. This is not true // {{ip}}/api/v1/shade/0?blind=&lamella= diff --git a/src/myStromSwitchAccessory.ts b/src/myStromSwitchAccessory.ts index 7a8b99b3..b2b3b0ba 100644 --- a/src/myStromSwitchAccessory.ts +++ b/src/myStromSwitchAccessory.ts @@ -107,6 +107,15 @@ export class MyStromSwitchAccessory extends DingzDaBaseAccessory { this.temperatureService .getCharacteristic(this.platform.Characteristic.CurrentTemperature) .on(CharacteristicEventTypes.GET, this.getTemperature.bind(this)); + } else { + // Make sure spurious temperature services (e.g. from Zero and CH v1) don't remain in the system + const temperatureService: Service | undefined = this.accessory.getService( + this.platform.Service.TemperatureSensor, + ); + if (temperatureService !== undefined) { + this.platform.log.warn('Removing spurious temperature service'); + this.accessory.removeService(temperatureService); + } } }