diff --git a/lib/devices/gateway/magnet.js b/lib/devices/gateway/magnet.js index 38dea94..0c3c2ba 100644 --- a/lib/devices/gateway/magnet.js +++ b/lib/devices/gateway/magnet.js @@ -18,10 +18,11 @@ module.exports = class Magnet extends SubDevice.with(Contact, Voltage) { } propertyUpdated(key, value, oldValue) { + console.log(key, value, oldValue); if(key === 'status') { // Change the contact state - const isOpen = value === 'open'; - this.updateContact(isOpen); + const isContact = value === 'close'; + this.updateContact(isContact); } super.propertyUpdated(key, value, oldValue);