diff --git a/lib/accessory-light.js b/lib/accessory-light.js index 738e9a6..2480baf 100644 --- a/lib/accessory-light.js +++ b/lib/accessory-light.js @@ -4,6 +4,9 @@ module.exports = async (hap, accessory, el, address, eoj) => { const propertyValue = (await el.getPropertyValue(address, eoj, 0x80)) console.log("Log1") console.log(propertyValue.message.data) + if (propertyValue.message.data == null) { + return + } let {status} = propertyValue.message.data service.updateCharacteristic(hap.Characteristic.On, status) @@ -23,7 +26,7 @@ module.exports = async (hap, accessory, el, address, eoj) => { el.getPropertyValue(address, eoj, 0x80).then((res) => { // console.log("Log2") // console.log(res.message.data) - if (res.message.data != null) { + if (res != null && res.message.data != null) { updateStatus(res.message.data.status) } })