From 47c8beff0913f161a345ac42e71b46d53c6ac114 Mon Sep 17 00:00:00 2001 From: biau Date: Tue, 12 Jun 2018 08:44:22 +0000 Subject: [PATCH] Correction of state inversion in switches --- pyzigate/attributes_helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyzigate/attributes_helpers.py b/pyzigate/attributes_helpers.py index 37f18aa..a14b00f 100644 --- a/pyzigate/attributes_helpers.py +++ b/pyzigate/attributes_helpers.py @@ -62,10 +62,10 @@ def interpret_attributes(self, msg_data): ZGT_LOG.info(' * General: On/Off') if attribute_id == b'0000': if hexlify(attribute_data) == b'00': - self.set_device_property(device_addr, endpoint, ZGT_STATE, ZGT_STATE_ON) + self.set_device_property(device_addr, endpoint, ZGT_STATE, ZGT_STATE_OFF) ZGT_LOG.info(' * Closed/Taken off/Press') else: - self.set_device_property(device_addr, endpoint, ZGT_STATE, ZGT_STATE_OFF) + self.set_device_property(device_addr, endpoint, ZGT_STATE, ZGT_STATE_ON) ZGT_LOG.info(' * Open/Release button') elif attribute_id == b'8000': clicks = int(hexlify(attribute_data), 16)