From c38839d72fed3c469072879e7645fac3059550a4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Apr 2023 19:54:37 -0500 Subject: [PATCH] Suppress events for tns1:MediaControl/VideoEncoderConfiguration with onvif (#91916) These events are not useful to the integration and generate a confusing log message ``` 2023-04-23 14:01:21.866 INFO (MainThread) [homeassistant.components.onvif] DS-HD1: No registered handler for event from 80:91:33:88:8d:bd: { SubscriptionReference: None, Topic: { _value_1: tns1:MediaControl/VideoEncoderConfiguration, Dialect: http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet, _attr_1: { } }, ProducerReference: None, Message: { _value_1: { Source: { SimpleItem: [ { Name: VideoEncoderConfigurationToken, Value: VideoEncoderToken_1 } ], ElementItem: [], Extension: None, _attr_1: None }, Key: None, Data: { SimpleItem: [], ElementItem: [ { _value_1: , Name: Config } ], Extension: None, _attr_1: None }, Extension: None, UtcTime: datetime.datetime(2023, 4, 23, 20, 1, 17, tzinfo=), PropertyOperation: Initialized, _attr_1: { } } } } ``` We now ignore them --- homeassistant/components/onvif/event.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/onvif/event.py b/homeassistant/components/onvif/event.py index ef822dba974..57961548917 100644 --- a/homeassistant/components/onvif/event.py +++ b/homeassistant/components/onvif/event.py @@ -29,7 +29,9 @@ from .const import DOMAIN, LOGGER from .models import Event, PullPointManagerState, WebHookManagerState from .parsers import PARSERS -UNHANDLED_TOPICS: set[str] = set() +# Topics in this list are ignored because we do not want to create +# entities for them. +UNHANDLED_TOPICS: set[str] = {"tns1:MediaControl/VideoEncoderConfiguration"} SUBSCRIPTION_ERRORS = (Fault, asyncio.TimeoutError, TransportError) CREATE_ERRORS = (ONVIFError, Fault, RequestError, XMLParseError)