mirror of
https://github.com/home-assistant/core.git
synced 2025-08-10 16:15:08 +02:00
adjust timeouts for slower tplink cameras
This commit is contained in:
@@ -40,8 +40,8 @@ SET_SYNCHRONIZATION_POINT_ERRORS = (*SUBSCRIPTION_ERRORS, TypeError)
|
|||||||
UNSUBSCRIBE_ERRORS = (XMLParseError, *SUBSCRIPTION_ERRORS)
|
UNSUBSCRIBE_ERRORS = (XMLParseError, *SUBSCRIPTION_ERRORS)
|
||||||
RENEW_ERRORS = (ONVIFError, RequestError, XMLParseError, *SUBSCRIPTION_ERRORS)
|
RENEW_ERRORS = (ONVIFError, RequestError, XMLParseError, *SUBSCRIPTION_ERRORS)
|
||||||
#
|
#
|
||||||
# We only keep the subscription alive for 3 minutes, and will keep
|
# We only keep the subscription alive for 10 minutes, and will keep
|
||||||
# renewing it every 1.5 minutes. This is to avoid the camera
|
# renewing it every 5 minutes. This is to avoid the camera
|
||||||
# accumulating subscriptions which will be impossible to clean up
|
# accumulating subscriptions which will be impossible to clean up
|
||||||
# since ONVIF does not provide a way to list existing subscriptions.
|
# since ONVIF does not provide a way to list existing subscriptions.
|
||||||
#
|
#
|
||||||
@@ -49,19 +49,20 @@ RENEW_ERRORS = (ONVIFError, RequestError, XMLParseError, *SUBSCRIPTION_ERRORS)
|
|||||||
# sending events to us, and we will not be able to recover until
|
# sending events to us, and we will not be able to recover until
|
||||||
# the subscriptions expire or the camera is rebooted.
|
# the subscriptions expire or the camera is rebooted.
|
||||||
#
|
#
|
||||||
SUBSCRIPTION_TIME = dt.timedelta(minutes=3)
|
SUBSCRIPTION_TIME = dt.timedelta(minutes=10)
|
||||||
SUBSCRIPTION_RELATIVE_TIME = (
|
SUBSCRIPTION_RELATIVE_TIME = (
|
||||||
"PT3M" # use relative time since the time on the camera is not reliable
|
"PT10M" # use relative time since the time on the camera is not reliable
|
||||||
)
|
)
|
||||||
|
SUBSCRIPTION_ATTEMPTS = 3
|
||||||
SUBSCRIPTION_RENEW_INTERVAL = SUBSCRIPTION_TIME.total_seconds() / 2
|
SUBSCRIPTION_RENEW_INTERVAL = SUBSCRIPTION_TIME.total_seconds() / 2
|
||||||
|
# SUBSCRIPTION_RENEW_INTERVAL Must be less than the overall timeout of 90 * (SUBSCRIPTION_ATTEMPTS) 3 = 270 seconds
|
||||||
|
|
||||||
SUBSCRIPTION_RENEW_INTERVAL_ON_ERROR = 60.0
|
SUBSCRIPTION_RENEW_INTERVAL_ON_ERROR = 60.0
|
||||||
|
|
||||||
PULLPOINT_POLL_TIME = dt.timedelta(seconds=60)
|
PULLPOINT_POLL_TIME = dt.timedelta(seconds=60)
|
||||||
PULLPOINT_MESSAGE_LIMIT = 100
|
PULLPOINT_MESSAGE_LIMIT = 100
|
||||||
PULLPOINT_COOLDOWN_TIME = 0.75
|
PULLPOINT_COOLDOWN_TIME = 0.75
|
||||||
|
|
||||||
SUBSCRIPTION_ATTEMPTS = 3
|
|
||||||
|
|
||||||
|
|
||||||
class EventManager:
|
class EventManager:
|
||||||
"""ONVIF Event Manager."""
|
"""ONVIF Event Manager."""
|
||||||
|
@@ -8,5 +8,5 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/onvif",
|
"documentation": "https://www.home-assistant.io/integrations/onvif",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"loggers": ["onvif", "wsdiscovery", "zeep"],
|
"loggers": ["onvif", "wsdiscovery", "zeep"],
|
||||||
"requirements": ["onvif-zeep-async==2.1.0", "WSDiscovery==2.0.0"]
|
"requirements": ["onvif-zeep-async==2.1.1", "WSDiscovery==2.0.0"]
|
||||||
}
|
}
|
||||||
|
@@ -1258,7 +1258,7 @@ ondilo==0.2.0
|
|||||||
onkyo-eiscp==1.2.7
|
onkyo-eiscp==1.2.7
|
||||||
|
|
||||||
# homeassistant.components.onvif
|
# homeassistant.components.onvif
|
||||||
onvif-zeep-async==2.1.0
|
onvif-zeep-async==2.1.1
|
||||||
|
|
||||||
# homeassistant.components.opengarage
|
# homeassistant.components.opengarage
|
||||||
open-garage==0.2.0
|
open-garage==0.2.0
|
||||||
|
@@ -945,7 +945,7 @@ omnilogic==0.4.5
|
|||||||
ondilo==0.2.0
|
ondilo==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.onvif
|
# homeassistant.components.onvif
|
||||||
onvif-zeep-async==2.1.0
|
onvif-zeep-async==2.1.1
|
||||||
|
|
||||||
# homeassistant.components.opengarage
|
# homeassistant.components.opengarage
|
||||||
open-garage==0.2.0
|
open-garage==0.2.0
|
||||||
|
Reference in New Issue
Block a user