Skip to content
This repository has been archived by the owner on Aug 24, 2024. It is now read-only.

Commit

Permalink
dont surface type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iloveicedgreentea committed May 27, 2024
1 parent 9d499c9 commit e322da2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion custom_components/jvc_projectors/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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()
Expand All @@ -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)

Expand Down

0 comments on commit e322da2

Please sign in to comment.