diff --git a/lib/devices/capabilities/power.js b/lib/devices/capabilities/power.js index 328de9e..27100fa 100644 --- a/lib/devices/capabilities/power.js +++ b/lib/devices/capabilities/power.js @@ -4,7 +4,7 @@ const { Thing, SwitchablePower } = require('abstract-things'); module.exports = Thing.mixin(Parent => class extends Parent.with(SwitchablePower) { propertyUpdated(key, value) { - if(key === 'power') { + if(key === 'power' && value !== undefined) { this.updatePower(value); } diff --git a/lib/devices/gateway/plug.js b/lib/devices/gateway/plug.js index f17a565..987842d 100644 --- a/lib/devices/gateway/plug.js +++ b/lib/devices/gateway/plug.js @@ -21,7 +21,7 @@ module.exports = class Plug extends SubDevice this.defineProperty('status', { name: 'power', - mapper: v => v === 'on' + mapper: v => (v === '') ? undefined : (v === 'on') }); this.defineProperty('load_voltage', {