diff --git a/HISTORY.md b/HISTORY.md index 7b372802..46492a1a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -30,6 +30,13 @@ - Fixed bug in motion sensor replies to a model info request ([Issue #163][I163]). +- Fixed bug in thermostat ambient temperature calculation ([Issue #142][I142]) + (thanks @krkeegan). + +- Fixed bug in KeypadLinc, FanLinc, and Outlet for non-group 1 links + ([Issue #159][I159]) (thanks @chris153002). + + ## [0.6.8] ### Fixes @@ -295,7 +302,9 @@ [I136]: https://github.com/TD22057/insteon-mqtt/issues/136 [I138]: https://github.com/TD22057/insteon-mqtt/issues/138 [I139]: https://github.com/TD22057/insteon-mqtt/issues/139 +[I142]: https://github.com/TD22057/insteon-mqtt/issues/142 [I148]: https://github.com/TD22057/insteon-mqtt/issues/148 [I157]: https://github.com/TD22057/insteon-mqtt/issues/157 +[I159]: https://github.com/TD22057/insteon-mqtt/issues/159 [I160]: https://github.com/TD22057/insteon-mqtt/issues/160 [I163]: https://github.com/TD22057/insteon-mqtt/issues/163 diff --git a/insteon_mqtt/device/FanLinc.py b/insteon_mqtt/device/FanLinc.py index 05945d5a..d11b85ec 100644 --- a/insteon_mqtt/device/FanLinc.py +++ b/insteon_mqtt/device/FanLinc.py @@ -368,11 +368,6 @@ def handle_group_cmd(self, addr, msg): msg (InpStandard): Broadcast message from the device. Use msg.group to find the group and msg.cmd1 for the command. """ - # Group 1 is for the dimmer - pass that to the base class: - if msg.group == 1: - super().handle_group_cmd(addr, msg) - return - # Make sure we're really a responder to this message. This shouldn't # ever occur. entry = self.db.find(addr, msg.group, is_controller=False) @@ -381,6 +376,14 @@ def handle_group_cmd(self, addr, msg): msg.group, addr) return + # The local button being modified is stored in the db entry. + localGroup = entry.data[2] + + # Group 1 is for the dimmer - pass that to the base class: + if localGroup == 1: + super().handle_group_cmd(addr, msg) + return + # 0x11: on if msg.cmd1 == 0x11: self._set_fan_speed(entry.data[0], on_off.REASON_SCENE) diff --git a/insteon_mqtt/device/KeypadLinc.py b/insteon_mqtt/device/KeypadLinc.py index c0acc9ce..36817a86 100644 --- a/insteon_mqtt/device/KeypadLinc.py +++ b/insteon_mqtt/device/KeypadLinc.py @@ -1453,6 +1453,9 @@ def handle_group_cmd(self, addr, msg): reason = on_off.REASON_SCENE + # The local button being modified is stored in the db entry. + localGroup = entry.data[2] + # Handle on/off codes if on_off.Mode.is_valid(msg.cmd1): is_on, mode = on_off.Mode.decode(msg.cmd1) @@ -1460,27 +1463,27 @@ def handle_group_cmd(self, addr, msg): # For switches, on/off determines the level. For dimmers, it's # set by the responder entry in the database. level = 0xff if is_on else 0x00 - if self.is_dimmer and is_on and msg.group == self._load_group: + if self.is_dimmer and is_on and localGroup == self._load_group: level = entry.data[0] - self._set_level(msg.group, level, mode, reason) + self._set_level(localGroup, level, mode, reason) # Increment up 1 unit which is 8 levels. elif msg.cmd1 == 0x15: - assert msg.group == self._load_group - self._set_level(msg.group, min(0xff, self._level + 8), + assert localGroup == self._load_group + self._set_level(localGroup, min(0xff, self._level + 8), reason=reason) # Increment down 1 unit which is 8 levels. elif msg.cmd1 == 0x16: assert msg.group == self._load_group - self._set_level(msg.group, max(0x00, self._level - 8), + self._set_level(localGroup, max(0x00, self._level - 8), reason=reason) # Starting/stopping manual increment (cmd2 0x00=up, 0x01=down) elif on_off.Manual.is_valid(msg.cmd1): manual = on_off.Manual.decode(msg.cmd1, msg.cmd2) - self.signal_manual.emit(self, msg.group, manual, reason) + self.signal_manual.emit(self, localGroup, manual, reason) # If the button is released, refresh to get the final level in # dimming mode since we don't know where the level stopped. diff --git a/insteon_mqtt/device/Outlet.py b/insteon_mqtt/device/Outlet.py index 57336c93..491ebfa5 100644 --- a/insteon_mqtt/device/Outlet.py +++ b/insteon_mqtt/device/Outlet.py @@ -635,10 +635,13 @@ def handle_group_cmd(self, addr, msg): msg.group, addr) return + # The local button being modified is stored in the db entry. + localGroup = entry.data[2] + # Handle on/off commands codes. if on_off.Mode.is_valid(msg.cmd1): is_on, mode = on_off.Mode.decode(msg.cmd1) - self._set_is_on(msg.group, is_on, mode, on_off.REASON_SCENE) + self._set_is_on(localGroup, is_on, mode, on_off.REASON_SCENE) # Note: I don't believe the on/off switch can participate in manual # mode stopping commands since it changes state when the button is