@switchbot/homebridge-switchbot
Advanced tools
Comparing version 0.1.2-beta.34 to 0.1.2-beta.35
@@ -303,14 +303,15 @@ "use strict"; | ||
if (this.SwitchOn === undefined) { | ||
this.platform.debug(`On: ${this.SwitchOn}`); | ||
this.platform.debug(`Bot ${this.accessory.displayName} On: ${this.SwitchOn}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.SwitchOn); | ||
this.platform.device(`updateCharacteristic On: ${this.SwitchOn}`); | ||
this.platform.device(`Bot ${this.accessory.displayName} updateCharacteristic On: ${this.SwitchOn}`); | ||
} | ||
if (this.OutletInUse === undefined || this.platform.config.options?.bot?.switch) { | ||
this.platform.debug(`On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
this.platform.debug(`Bot ${this.accessory.displayName} On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
this.platform.device(`Bot ${this.accessory.displayName} updateCharacteristic On: ${this.OutletInUse},` | ||
+ ` Switch: ${this.platform.config.options?.bot?.switch}`); | ||
} | ||
@@ -317,0 +318,0 @@ } |
@@ -156,21 +156,21 @@ "use strict"; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} On: ${this.On}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Bulb ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.Brightness === undefined) { | ||
this.platform.debug(`Brightness: ${this.Brightness}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} Brightness: ${this.Brightness}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.Brightness); | ||
this.platform.device(`updateCharacteristic Brightness: ${this.Brightness}`); | ||
this.platform.device(`Bulb ${this.accessory.displayName} updateCharacteristic Brightness: ${this.Brightness}`); | ||
} | ||
if (this.ColorTemperature === undefined) { | ||
this.platform.debug(`ColorTemperature: ${this.ColorTemperature}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} ColorTemperature: ${this.ColorTemperature}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.ColorTemperature); | ||
this.platform.debug(`updateCharacteristic ColorTemperature: ${this.ColorTemperature}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} updateCharacteristic ColorTemperature: ${this.ColorTemperature}`); | ||
} | ||
@@ -177,0 +177,0 @@ } |
@@ -178,14 +178,14 @@ "use strict"; | ||
if (this.ContactSensorState === undefined) { | ||
this.platform.debug(`ContactSensorState: ${this.ContactSensorState}`); | ||
this.platform.debug(`Contact ${this.accessory.displayName} ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.ContactSensorState, this.ContactSensorState); | ||
this.platform.device(`updateCharacteristic ContactSensorState: ${this.ContactSensorState}`); | ||
this.platform.device(`Contact ${this.accessory.displayName} updateCharacteristic ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
if (this.MotionDetected === undefined) { | ||
this.platform.debug(`MotionDetected: ${this.MotionDetected}`); | ||
this.platform.debug(`Contact ${this.accessory.displayName} MotionDetected: ${this.MotionDetected}`); | ||
} | ||
else { | ||
this.motionService.updateCharacteristic(this.platform.Characteristic.MotionDetected, this.MotionDetected); | ||
this.platform.device(`updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
this.platform.device(`Contact ${this.accessory.displayName} updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
} | ||
@@ -192,0 +192,0 @@ } |
@@ -285,28 +285,28 @@ "use strict"; | ||
if (this.CurrentPosition === undefined) { | ||
this.platform.debug(`CurrentPosition: ${this.CurrentPosition}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} CurrentPosition: ${this.CurrentPosition}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentPosition, this.CurrentPosition); | ||
this.platform.device(`updateCharacteristic CurrentPosition: ${this.CurrentPosition}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic CurrentPosition: ${this.CurrentPosition}`); | ||
} | ||
if (this.PositionState === undefined) { | ||
this.platform.debug(`PositionState: ${this.PositionState}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} PositionState: ${this.PositionState}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.PositionState, this.PositionState); | ||
this.platform.device(`updateCharacteristic PositionState: ${this.PositionState}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic PositionState: ${this.PositionState}`); | ||
} | ||
if (this.TargetPosition === undefined) { | ||
this.platform.debug(`TargetPosition: ${this.TargetPosition}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} TargetPosition: ${this.TargetPosition}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.TargetPosition, this.TargetPosition); | ||
this.platform.device(`updateCharacteristic TargetPosition: ${this.TargetPosition}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic TargetPosition: ${this.TargetPosition}`); | ||
} | ||
if (this.CurrentAmbientLightLevel === undefined) { | ||
this.platform.debug(`CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
} | ||
else { | ||
this.lightSensorService.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel); | ||
this.platform.device(`updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
} | ||
@@ -313,0 +313,0 @@ } |
@@ -293,49 +293,53 @@ "use strict"; | ||
if (this.CurrentRelativeHumidity === undefined) { | ||
this.platform.debug(`CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity); | ||
this.platform.device(`updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
if (this.WaterLevel === undefined) { | ||
this.platform.debug(`WaterLevel: ${this.WaterLevel}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} WaterLevel: ${this.WaterLevel}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.WaterLevel, this.WaterLevel); | ||
this.platform.device(`updateCharacteristic WaterLevel: ${this.WaterLevel}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic WaterLevel: ${this.WaterLevel}`); | ||
} | ||
if (this.CurrentHumidifierDehumidifierState === undefined) { | ||
this.platform.debug(`CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentHumidifierDehumidifierState, this.CurrentHumidifierDehumidifierState); | ||
this.platform.device(`updateCharacteristic CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
} | ||
if (this.TargetHumidifierDehumidifierState === undefined) { | ||
this.platform.debug(`TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.TargetHumidifierDehumidifierState, this.TargetHumidifierDehumidifierState); | ||
this.platform.device(`updateCharacteristic TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
} | ||
if (this.Active === undefined) { | ||
this.platform.debug(`Active: ${this.Active}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} Active: ${this.Active}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Active, this.Active); | ||
this.platform.device(`updateCharacteristic Active: ${this.Active}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`); | ||
} | ||
if (this.RelativeHumidityHumidifierThreshold === undefined) { | ||
this.platform.debug(`RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName}` | ||
+ ` RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.RelativeHumidityHumidifierThreshold, this.RelativeHumidityHumidifierThreshold); | ||
this.platform.device(`updateCharacteristic RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
} | ||
if (this.platform.config.options?.humidifier?.hide_temperature && this.CurrentTemperature === undefined) { | ||
this.platform.debug(`CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
else { | ||
this.temperatureservice.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature); | ||
this.platform.device(`updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
@@ -342,0 +346,0 @@ } |
@@ -183,14 +183,14 @@ "use strict"; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Camera ${this.accessory.displayName} On: ${this.On}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Camera ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.OutletInUse === undefined) { | ||
this.platform.debug(`OutletInUse: ${this.OutletInUse}`); | ||
this.platform.debug(`Camera ${this.accessory.displayName} OutletInUse: ${this.OutletInUse}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
this.platform.device(`Camera ${this.accessory.displayName} updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
} | ||
@@ -197,0 +197,0 @@ } |
@@ -269,28 +269,28 @@ "use strict"; | ||
if (this.StatusLowBattery === undefined) { | ||
this.platform.debug(`StatusLowBattery: ${this.StatusLowBattery}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery); | ||
this.platform.device(`updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`); | ||
} | ||
if (this.BatteryLevel === undefined) { | ||
this.platform.debug(`BatteryLevel: ${this.BatteryLevel}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel); | ||
this.platform.device(`updateCharacteristic BatteryLevel: ${this.BatteryLevel}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`); | ||
} | ||
if (this.platform.config.options?.meter?.hide_humidity && this.CurrentRelativeHumidity === undefined) { | ||
this.platform.debug(`CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
else { | ||
this.humidityservice?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity); | ||
this.platform.device(`updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
if (this.platform.config.options?.meter?.hide_temperature && this.CurrentTemperature === undefined) { | ||
this.platform.debug(`CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
else { | ||
this.temperatureservice?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature); | ||
this.platform.device(`updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
@@ -297,0 +297,0 @@ } |
@@ -162,7 +162,7 @@ "use strict"; | ||
if (this.MotionDetected === undefined) { | ||
this.platform.debug(`MotionDetected: ${this.MotionDetected}`); | ||
this.platform.debug(`Motion ${this.accessory.displayName} MotionDetected: ${this.MotionDetected}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.MotionDetected, this.MotionDetected); | ||
this.platform.device(`updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
this.platform.device(`Motion ${this.accessory.displayName} updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
} | ||
@@ -169,0 +169,0 @@ } |
@@ -185,14 +185,14 @@ "use strict"; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Plug ${this.accessory.displayName} On: ${this.On}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Plug ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.OutletInUse === undefined) { | ||
this.platform.debug(`OutletInUse: ${this.OutletInUse}`); | ||
this.platform.debug(`Plug ${this.accessory.displayName} OutletInUse: ${this.OutletInUse}`); | ||
} | ||
else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
this.platform.device(`Plug ${this.accessory.displayName} updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
} | ||
@@ -199,0 +199,0 @@ } |
@@ -129,3 +129,3 @@ "use strict"; | ||
this.platform.debug('Trigger Get CurrentTemperture'); | ||
if (this.CurrentTemperature === NaN) { | ||
if (Number.isNaN(this.CurrentTemperature)) { | ||
this.CurrentTemperature = 24; | ||
@@ -138,3 +138,3 @@ } | ||
} | ||
return (this.CurrentTemperature = Number(value)); | ||
return (this.CurrentTemperature === Number(value)); | ||
} | ||
@@ -141,0 +141,0 @@ TargetHeaterCoolerStateSet(value) { |
{ | ||
"displayName": "Homebridge SwitchBot", | ||
"name": "@switchbot/homebridge-switchbot", | ||
"version": "0.1.2-beta.34", | ||
"version": "0.1.2-beta.35", | ||
"description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.", | ||
@@ -6,0 +6,0 @@ "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)", |
@@ -355,12 +355,13 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.SwitchOn === undefined) { | ||
this.platform.debug(`On: ${this.SwitchOn}`); | ||
this.platform.debug(`Bot ${this.accessory.displayName} On: ${this.SwitchOn}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.SwitchOn); | ||
this.platform.device(`updateCharacteristic On: ${this.SwitchOn}`); | ||
this.platform.device(`Bot ${this.accessory.displayName} updateCharacteristic On: ${this.SwitchOn}`); | ||
} | ||
if (this.OutletInUse === undefined || this.platform.config.options?.bot?.switch) { | ||
this.platform.debug(`On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
this.platform.debug(`Bot ${this.accessory.displayName} On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic On: ${this.OutletInUse}, Switch: ${this.platform.config.options?.bot?.switch}`); | ||
this.platform.device(`Bot ${this.accessory.displayName} updateCharacteristic On: ${this.OutletInUse},` | ||
+ ` Switch: ${this.platform.config.options?.bot?.switch}`); | ||
} | ||
@@ -367,0 +368,0 @@ } |
@@ -215,18 +215,18 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} On: ${this.On}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Bulb ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.Brightness === undefined) { | ||
this.platform.debug(`Brightness: ${this.Brightness}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} Brightness: ${this.Brightness}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.Brightness); | ||
this.platform.device(`updateCharacteristic Brightness: ${this.Brightness}`); | ||
this.platform.device(`Bulb ${this.accessory.displayName} updateCharacteristic Brightness: ${this.Brightness}`); | ||
} | ||
if (this.ColorTemperature === undefined) { | ||
this.platform.debug(`ColorTemperature: ${this.ColorTemperature}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} ColorTemperature: ${this.ColorTemperature}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Brightness, this.ColorTemperature); | ||
this.platform.debug(`updateCharacteristic ColorTemperature: ${this.ColorTemperature}`); | ||
this.platform.debug(`Bulb ${this.accessory.displayName} updateCharacteristic ColorTemperature: ${this.ColorTemperature}`); | ||
} | ||
@@ -233,0 +233,0 @@ } |
@@ -222,12 +222,12 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.ContactSensorState === undefined) { | ||
this.platform.debug(`ContactSensorState: ${this.ContactSensorState}`); | ||
this.platform.debug(`Contact ${this.accessory.displayName} ContactSensorState: ${this.ContactSensorState}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.ContactSensorState, this.ContactSensorState); | ||
this.platform.device(`updateCharacteristic ContactSensorState: ${this.ContactSensorState}`); | ||
this.platform.device(`Contact ${this.accessory.displayName} updateCharacteristic ContactSensorState: ${this.ContactSensorState}`); | ||
} | ||
if (this.MotionDetected === undefined) { | ||
this.platform.debug(`MotionDetected: ${this.MotionDetected}`); | ||
this.platform.debug(`Contact ${this.accessory.displayName} MotionDetected: ${this.MotionDetected}`); | ||
} else { | ||
this.motionService.updateCharacteristic(this.platform.Characteristic.MotionDetected, this.MotionDetected); | ||
this.platform.device(`updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
this.platform.device(`Contact ${this.accessory.displayName} updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
} | ||
@@ -234,0 +234,0 @@ } |
@@ -371,24 +371,24 @@ /* eslint-disable @typescript-eslint/no-var-requires */ | ||
if (this.CurrentPosition === undefined) { | ||
this.platform.debug(`CurrentPosition: ${this.CurrentPosition}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} CurrentPosition: ${this.CurrentPosition}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentPosition, this.CurrentPosition); | ||
this.platform.device(`updateCharacteristic CurrentPosition: ${this.CurrentPosition}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic CurrentPosition: ${this.CurrentPosition}`); | ||
} | ||
if (this.PositionState === undefined) { | ||
this.platform.debug(`PositionState: ${this.PositionState}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} PositionState: ${this.PositionState}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.PositionState, this.PositionState); | ||
this.platform.device(`updateCharacteristic PositionState: ${this.PositionState}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic PositionState: ${this.PositionState}`); | ||
} | ||
if (this.TargetPosition === undefined) { | ||
this.platform.debug(`TargetPosition: ${this.TargetPosition}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} TargetPosition: ${this.TargetPosition}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.TargetPosition, this.TargetPosition); | ||
this.platform.device(`updateCharacteristic TargetPosition: ${this.TargetPosition}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic TargetPosition: ${this.TargetPosition}`); | ||
} | ||
if (this.CurrentAmbientLightLevel === undefined) { | ||
this.platform.debug(`CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
this.platform.debug(`Curtain ${this.accessory.displayName} CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
} else { | ||
this.lightSensorService.updateCharacteristic(this.platform.Characteristic.CurrentAmbientLightLevel, this.CurrentAmbientLightLevel); | ||
this.platform.device(`updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
this.platform.device(`Curtain ${this.accessory.displayName} updateCharacteristic CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`); | ||
} | ||
@@ -395,0 +395,0 @@ } |
@@ -368,42 +368,46 @@ import { Service, PlatformAccessory, CharacteristicValue } from 'homebridge'; | ||
if (this.CurrentRelativeHumidity === undefined) { | ||
this.platform.debug(`CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity); | ||
this.platform.device(`updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
if (this.WaterLevel === undefined) { | ||
this.platform.debug(`WaterLevel: ${this.WaterLevel}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} WaterLevel: ${this.WaterLevel}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.WaterLevel, this.WaterLevel); | ||
this.platform.device(`updateCharacteristic WaterLevel: ${this.WaterLevel}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic WaterLevel: ${this.WaterLevel}`); | ||
} | ||
if (this.CurrentHumidifierDehumidifierState === undefined) { | ||
this.platform.debug(`CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.CurrentHumidifierDehumidifierState, this.CurrentHumidifierDehumidifierState); | ||
this.platform.device(`updateCharacteristic CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic CurrentHumidifierDehumidifierState: ${this.CurrentHumidifierDehumidifierState}`); | ||
} | ||
if (this.TargetHumidifierDehumidifierState === undefined) { | ||
this.platform.debug(`TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
} else { | ||
this.service.updateCharacteristic( this.platform.Characteristic.TargetHumidifierDehumidifierState, this.TargetHumidifierDehumidifierState); | ||
this.platform.device(`updateCharacteristic TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
this.service.updateCharacteristic(this.platform.Characteristic.TargetHumidifierDehumidifierState, this.TargetHumidifierDehumidifierState); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic TargetHumidifierDehumidifierState: ${this.TargetHumidifierDehumidifierState}`); | ||
} | ||
if (this.Active === undefined) { | ||
this.platform.debug(`Active: ${this.Active}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} Active: ${this.Active}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.Active, this.Active); | ||
this.platform.device(`updateCharacteristic Active: ${this.Active}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic Active: ${this.Active}`); | ||
} | ||
if (this.RelativeHumidityHumidifierThreshold === undefined) { | ||
this.platform.debug(`RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName}` | ||
+ ` RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.RelativeHumidityHumidifierThreshold, this.RelativeHumidityHumidifierThreshold); | ||
this.platform.device(`updateCharacteristic RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName}` | ||
+ ` updateCharacteristic RelativeHumidityHumidifierThreshold: ${this.RelativeHumidityHumidifierThreshold}`); | ||
} | ||
if (this.platform.config.options?.humidifier?.hide_temperature && this.CurrentTemperature === undefined) { | ||
this.platform.debug(`CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.debug(`Humidifier ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`); | ||
} else { | ||
this.temperatureservice!.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature); | ||
this.platform.device(`updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.device(`Humidifier ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
@@ -410,0 +414,0 @@ } |
@@ -242,12 +242,12 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Camera ${this.accessory.displayName} On: ${this.On}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Camera ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.OutletInUse === undefined) { | ||
this.platform.debug(`OutletInUse: ${this.OutletInUse}`); | ||
this.platform.debug(`Camera ${this.accessory.displayName} OutletInUse: ${this.OutletInUse}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
this.platform.device(`Camera ${this.accessory.displayName} updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
} | ||
@@ -254,0 +254,0 @@ } |
@@ -315,24 +315,24 @@ import { Service, PlatformAccessory, Units, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.StatusLowBattery === undefined) { | ||
this.platform.debug(`StatusLowBattery: ${this.StatusLowBattery}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} StatusLowBattery: ${this.StatusLowBattery}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.StatusLowBattery, this.StatusLowBattery); | ||
this.platform.device(`updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic StatusLowBattery: ${this.StatusLowBattery}`); | ||
} | ||
if (this.BatteryLevel === undefined) { | ||
this.platform.debug(`BatteryLevel: ${this.BatteryLevel}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.BatteryLevel, this.BatteryLevel); | ||
this.platform.device(`updateCharacteristic BatteryLevel: ${this.BatteryLevel}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic BatteryLevel: ${this.BatteryLevel}`); | ||
} | ||
if (this.platform.config.options?.meter?.hide_humidity && this.CurrentRelativeHumidity === undefined) { | ||
this.platform.debug(`CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} else { | ||
this.humidityservice?.updateCharacteristic(this.platform.Characteristic.CurrentRelativeHumidity, this.CurrentRelativeHumidity); | ||
this.platform.device(`updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic CurrentRelativeHumidity: ${this.CurrentRelativeHumidity}`); | ||
} | ||
if (this.platform.config.options?.meter?.hide_temperature && this.CurrentTemperature === undefined) { | ||
this.platform.debug(`CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.debug(`Meter ${this.accessory.displayName} CurrentTemperature: ${this.CurrentTemperature}`); | ||
} else { | ||
this.temperatureservice?.updateCharacteristic(this.platform.Characteristic.CurrentTemperature, this.CurrentTemperature); | ||
this.platform.device(`updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
this.platform.device(`Meter ${this.accessory.displayName} updateCharacteristic CurrentTemperature: ${this.CurrentTemperature}`); | ||
} | ||
@@ -339,0 +339,0 @@ } |
@@ -206,6 +206,6 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.MotionDetected === undefined) { | ||
this.platform.debug(`MotionDetected: ${this.MotionDetected}`); | ||
this.platform.debug(`Motion ${this.accessory.displayName} MotionDetected: ${this.MotionDetected}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.MotionDetected, this.MotionDetected); | ||
this.platform.device(`updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
this.platform.device(`Motion ${this.accessory.displayName} updateCharacteristic MotionDetected: ${this.MotionDetected}`); | ||
} | ||
@@ -212,0 +212,0 @@ } |
@@ -244,12 +244,12 @@ import { Service, PlatformAccessory, CharacteristicValue, MacAddress } from 'homebridge'; | ||
if (this.On === undefined) { | ||
this.platform.debug(`On: ${this.On}`); | ||
this.platform.debug(`Plug ${this.accessory.displayName} On: ${this.On}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.On, this.On); | ||
this.platform.device(`updateCharacteristic On: ${this.On}`); | ||
this.platform.device(`Plug ${this.accessory.displayName} updateCharacteristic On: ${this.On}`); | ||
} | ||
if (this.OutletInUse === undefined) { | ||
this.platform.debug(`OutletInUse: ${this.OutletInUse}`); | ||
this.platform.debug(`Plug ${this.accessory.displayName} OutletInUse: ${this.OutletInUse}`); | ||
} else { | ||
this.service.updateCharacteristic(this.platform.Characteristic.OutletInUse, this.OutletInUse); | ||
this.platform.device(`updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
this.platform.device(`Plug ${this.accessory.displayName} updateCharacteristic OutletInUse: ${this.OutletInUse}`); | ||
} | ||
@@ -256,0 +256,0 @@ } |
@@ -162,10 +162,10 @@ import { AxiosResponse } from 'axios'; | ||
if (this.CurrentTemperature === NaN) { | ||
if (Number.isNaN(this.CurrentTemperature)) { | ||
this.CurrentTemperature = 24; | ||
} else { | ||
this.service | ||
.getCharacteristic(this.platform.Characteristic.CurrentTemperature) | ||
.updateValue(Number(this.CurrentTemperature) || 24); | ||
this.service | ||
.getCharacteristic(this.platform.Characteristic.CurrentTemperature) | ||
.updateValue(Number(this.CurrentTemperature) || 24); | ||
} | ||
return (this.CurrentTemperature = Number(value)); | ||
return (this.CurrentTemperature === Number(value)); | ||
} | ||
@@ -172,0 +172,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1116727
13676