mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
attempt to renew subscription immediately to stop endless loop if it fails after setup (#42651)
This commit is contained in:
parent
c7ba2341e3
commit
f1bb7b4a0f
@ -74,6 +74,14 @@ class EventManager:
|
||||
async def async_start(self) -> bool:
|
||||
"""Start polling events."""
|
||||
if await self.device.create_pullpoint_subscription():
|
||||
# Create subscription manager
|
||||
self._subscription = self.device.create_subscription_service(
|
||||
"PullPointSubscription"
|
||||
)
|
||||
|
||||
# Renew immediately
|
||||
await self.async_renew()
|
||||
|
||||
# Initialize events
|
||||
pullpoint = self.device.create_pullpoint_service()
|
||||
try:
|
||||
@ -87,11 +95,6 @@ class EventManager:
|
||||
# Parse event initialization
|
||||
await self.async_parse_messages(response.NotificationMessage)
|
||||
|
||||
# Create subscription manager
|
||||
self._subscription = self.device.create_subscription_service(
|
||||
"PullPointSubscription"
|
||||
)
|
||||
|
||||
self.started = True
|
||||
return True
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user