Log Reolink select value KeyError only once (#129559)

This commit is contained in:
starkillerOG 2024-10-31 09:49:27 +01:00 committed by Bram Kragten
parent 3f6e9a54fe
commit 964ab5b351

View File

@ -272,7 +272,7 @@ class ReolinkSelectEntity(ReolinkChannelCoordinatorEntity, SelectEntity):
try:
option = self.entity_description.value(self._host.api, self._channel)
except ValueError:
except (ValueError, KeyError):
if self._log_error:
_LOGGER.exception("Reolink '%s' has an unknown value", self.name)
self._log_error = False
@ -314,7 +314,7 @@ class ReolinkChimeSelectEntity(ReolinkChimeCoordinatorEntity, SelectEntity):
"""Return the current option."""
try:
option = self.entity_description.value(self._chime)
except ValueError:
except (ValueError, KeyError):
if self._log_error:
_LOGGER.exception("Reolink '%s' has an unknown value", self.name)
self._log_error = False