mirror of
https://github.com/fmtr/haco.git
synced 2026-10-26 02:48:54 -04:00
Publish state for all capabilities on announce
This commit is contained in:
parent
b243c74c90
commit
a681aa897f
2 changed files with 7 additions and 1 deletions
|
|
@ -101,6 +101,12 @@ class Control(Base, Generic[DeviceT]):
|
|||
logger.info(f'Announcing {topic} with {data_json}')
|
||||
await self.device.client.publish(topic, data_json, retain=True)
|
||||
|
||||
for capability in self.capabilities:
|
||||
if not capability.state:
|
||||
continue
|
||||
await capability.state.handle(value=None)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
control = Control(name="test", platform="test")
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
0.1.0
|
||||
0.1.1
|
||||
Loading…
Add table
Add a link
Reference in a new issue