Skip to content

Commit

Permalink
fix gwy status bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Jan 26, 2024
1 parent 78f4f55 commit 18109e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/ramses_cc/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def shrink(device_hints: dict[str, bool | str]) -> dict[str, Any]:
def is_on(self) -> bool:
"""Return True if the gateway has received messages recently."""
msg = self._device._gwy._this_msg
return msg and dt.now() - msg.dtm < timedelta(seconds=300)
return not bool(msg and dt.now() - msg.dtm < timedelta(seconds=300))


BINARY_SENSOR_DESCRIPTIONS: tuple[RamsesBinarySensorEntityDescription, ...] = (
Expand Down

0 comments on commit 18109e5

Please sign in to comment.