mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-11-23 12:58:05 +00:00
Publish device and bridge availability when Home Assistant comes online. https://github.com/Koenkk/zigbee2mqtt/issues/13382
This commit is contained in:
1 parent
da4a3b9a77
commit
619d5232db
1 file changed
+2
@@ -1333,6 +1333,8 @@ export default class HomeAssistant extends Extension {
|
||||
data.message.toLowerCase() === 'online') {
|
||||
const timer = setTimeout(async () => {
|
||||
// Publish all device states.
|
||||
this.mqtt.publishStateOnline();
|
||||
this.eventBus.emitPublishAvailability();
|
||||
for (const entity of [...this.zigbee.devices(false), ...this.zigbee.groups()]) {
|
||||
if (this.state.exists(entity)) {
|
||||
this.publishEntityState(entity, this.state.get(entity), 'publishCached');
|
||||
|
||||
Reference in new issue
Block a user