mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 16:27:08 +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:
|
async def async_start(self) -> bool:
|
||||||
"""Start polling events."""
|
"""Start polling events."""
|
||||||
if await self.device.create_pullpoint_subscription():
|
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
|
# Initialize events
|
||||||
pullpoint = self.device.create_pullpoint_service()
|
pullpoint = self.device.create_pullpoint_service()
|
||||||
try:
|
try:
|
||||||
@ -87,11 +95,6 @@ class EventManager:
|
|||||||
# Parse event initialization
|
# Parse event initialization
|
||||||
await self.async_parse_messages(response.NotificationMessage)
|
await self.async_parse_messages(response.NotificationMessage)
|
||||||
|
|
||||||
# Create subscription manager
|
|
||||||
self._subscription = self.device.create_subscription_service(
|
|
||||||
"PullPointSubscription"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.started = True
|
self.started = True
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user