diff --git a/custom_components/sonoff/sensor.py b/custom_components/sonoff/sensor.py index d3edfe70..8548cf5e 100644 --- a/custom_components/sonoff/sensor.py +++ b/custom_components/sonoff/sensor.py @@ -332,7 +332,7 @@ class XT5Action(XEventSesor): uid = "action" def set_state(self, params: dict): - if params.get("triggerType") == 2: + if "switches" in params and params.get("triggerType") == 2: self._attr_native_value = "touch" asyncio.create_task(self.clear_state())