mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-20 18:41:35 +00:00
Publish device and bridge availability when Home Assistant comes online. https://github.com/Koenkk/zigbee2mqtt/issues/13382
This commit is contained in:
@@ -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