Remove unnecessary code in event platform (#128552)

Co-authored-by: jangwon.lee <jangwon.lee@lge.com>
This commit is contained in:
LG-ThinQ-Integration 2024-10-26 01:42:08 +09:00 committed by GitHub
parent c5c5778c0a
commit 2cd2d8f9c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -98,21 +98,16 @@ class ThinQEventEntity(ThinQEntity, EventEntity):
"""Update status itself."""
super()._update_status()
# Handle an event.
if (value := self.data.value) is None or value not in self.event_types:
return
self._async_handle_update(value)
if self.entity_description.key == ThinQPropertyEx.NOTIFICATION:
self.coordinator.api.update_notification(None)
_LOGGER.warning(
"[%s:%s] update status:%s, event_types:%s",
_LOGGER.debug(
"[%s:%s] update status: %s, event_types=%s",
self.coordinator.device_name,
self.property_id,
self.data.value,
self.event_types,
)
# Handle an event.
if (value := self.data.value) is not None and value in self.event_types:
self._async_handle_update(value)
def _async_handle_update(self, value: str) -> None:
"""Handle the event."""