Skip to content

Commit

Permalink
enable speed-controls only if device is switched off
Browse files Browse the repository at this point in the history
  • Loading branch information
mampfes committed Dec 28, 2024
1 parent 6f3e94a commit 1685376
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions custom_components/bayernluefter/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ def __init__(
super().__init__(coordinator, description)
self.entity_description = description

@property
def available(self) -> bool:
return (
super().available
and self.entity_description.key in self._device.data
and not self._device.data.get("SystemOn", False)
)

@property
def native_value(self) -> float | None:
"""Return the value reported by the sensor."""
Expand Down

0 comments on commit 1685376

Please sign in to comment.