Skip to content

Commit

Permalink
Fix slide_2 action sensor always triggered by any command #1252
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 2, 2023
1 parent 74cd74c commit 2bfdda6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion custom_components/sonoff/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ def set_state(self, params: dict):
self._attr_native_value = "touch"
asyncio.create_task(self.clear_state())

if slide := params.get("slide"):
# fix https://github.com/AlexxIT/SonoffLAN/issues/1252
if (slide := params.get("slide")) and len(params) == 1:
self._attr_native_value = f"slide_{slide}"
asyncio.create_task(self.clear_state())

Expand Down

0 comments on commit 2bfdda6

Please sign in to comment.