mirror of
https://github.com/home-assistant/core.git
synced 2026-09-05 10:05:52 -05:00
Don't try to connect after exiting loop in ntfy (#152011)
This commit is contained in:
@@ -146,20 +146,20 @@ class NtfyEventEntity(NtfyBaseEntity, EventEntity):
|
||||
)
|
||||
self._attr_available = False
|
||||
finally:
|
||||
if self._ws is None or self._ws.done():
|
||||
self._ws = self.config_entry.async_create_background_task(
|
||||
self.hass,
|
||||
target=self.ntfy.subscribe(
|
||||
topics=[self.topic],
|
||||
callback=self._async_handle_event,
|
||||
title=self.subentry.data.get(CONF_TITLE),
|
||||
message=self.subentry.data.get(CONF_MESSAGE),
|
||||
priority=self.subentry.data.get(CONF_PRIORITY),
|
||||
tags=self.subentry.data.get(CONF_TAGS),
|
||||
),
|
||||
name="ntfy_websocket",
|
||||
)
|
||||
self.async_write_ha_state()
|
||||
if self._ws is None or self._ws.done():
|
||||
self._ws = self.config_entry.async_create_background_task(
|
||||
self.hass,
|
||||
target=self.ntfy.subscribe(
|
||||
topics=[self.topic],
|
||||
callback=self._async_handle_event,
|
||||
title=self.subentry.data.get(CONF_TITLE),
|
||||
message=self.subentry.data.get(CONF_MESSAGE),
|
||||
priority=self.subentry.data.get(CONF_PRIORITY),
|
||||
tags=self.subentry.data.get(CONF_TAGS),
|
||||
),
|
||||
name="ntfy_websocket",
|
||||
)
|
||||
await asyncio.sleep(RECONNECT_INTERVAL)
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user