mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-13 06:34:22 -04:00
Deactivate contols when remotectrl disabled, fixes #28
This commit is contained in:
parent
74f5887bb2
commit
6935f5f07f
4 changed files with 13 additions and 18 deletions
|
@ -379,3 +379,11 @@ class HonSwitchEntity(HonEntity, SwitchEntity):
|
|||
await self.coordinator.async_refresh()
|
||||
else:
|
||||
await self._device.commands[self.entity_description.turn_off_key].send()
|
||||
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
if self.entity_category == EntityCategory.CONFIG:
|
||||
return super().available
|
||||
else:
|
||||
return super().available and self._device.get("remoteCtrValid") == "1"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue