mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Prevent onvif from blocking startup (#38256)
This commit is contained in:
parent
da30ed06d8
commit
8b06d1d4bd
@ -6,7 +6,7 @@ from aiohttp.client_exceptions import ServerDisconnectedError
|
|||||||
from onvif import ONVIFCamera, ONVIFService
|
from onvif import ONVIFCamera, ONVIFService
|
||||||
from zeep.exceptions import Fault
|
from zeep.exceptions import Fault
|
||||||
|
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, CoreState, HomeAssistant, callback
|
||||||
from homeassistant.helpers.event import async_track_point_in_utc_time
|
from homeassistant.helpers.event import async_track_point_in_utc_time
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
@ -114,6 +114,7 @@ class EventManager:
|
|||||||
|
|
||||||
async def async_pull_messages(self, _now: dt = None) -> None:
|
async def async_pull_messages(self, _now: dt = None) -> None:
|
||||||
"""Pull messages from device."""
|
"""Pull messages from device."""
|
||||||
|
if self.hass.state == CoreState.running:
|
||||||
try:
|
try:
|
||||||
pullpoint = self.device.create_pullpoint_service()
|
pullpoint = self.device.create_pullpoint_service()
|
||||||
req = pullpoint.create_type("PullMessages")
|
req = pullpoint.create_type("PullMessages")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user