From e322da2bbff69b53d53232168c5851ae55a3baa5 Mon Sep 17 00:00:00 2001 From: iloveicedgreentea <31193909+iloveicedgreentea@users.noreply.github.com> Date: Mon, 27 May 2024 19:24:07 -0400 Subject: [PATCH] dont surface type errors --- custom_components/jvc_projectors/remote.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/custom_components/jvc_projectors/remote.py b/custom_components/jvc_projectors/remote.py index 3f8543d..6b26ee8 100644 --- a/custom_components/jvc_projectors/remote.py +++ b/custom_components/jvc_projectors/remote.py @@ -166,6 +166,10 @@ def _update_common_attributes(self): "input_mode": self.jvc_client.get_input_mode(), } ) + except TimeoutError as e: + _LOGGER.error("Timeout while updating common attributes: %s", e) + except TypeError as e: + _LOGGER.debug("Type error while updating common attributes: %s", e) except Exception as e: _LOGGER.error("Failed to update common attributes: %s", e) @@ -203,13 +207,17 @@ def _update_model_specific_attributes(self): self._attributes["lamp_power"] = self.jvc_client.get_lamp_power() except TimeoutError as e: _LOGGER.error("Timeout while updating model-specific attributes: %s", e) + except TypeError as e: + _LOGGER.debug("Type error while updating model-specific attributes: %s", e) except Exception as e: _LOGGER.error("Failed to update model-specific attributes: %s", e) def _update_hdr_attributes(self): """Update HDR-related attributes.""" try: - if any(x in self._attributes.get("content_type_trans") for x in ["hdr", "hlg"]): + if any( + x in self._attributes.get("content_type_trans") for x in ["hdr", "hlg"] + ): if "NZ" in self._model_family: self._attributes["theater_optimizer"] = ( self.jvc_client.get_theater_optimizer_state() @@ -223,6 +231,8 @@ def _update_hdr_attributes(self): ) except TimeoutError as e: _LOGGER.error("Timeout while updating HDR attributes: %s", e) + except TypeError as e: + _LOGGER.debug("Type error while updating HDR attributes: %s", e) except Exception as e: _LOGGER.error("Failed to update HDR attributes: %s", e)