Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kongo09 committed Jan 6, 2024
1 parent c3e6241 commit 54de0c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/philips_airpurifier_coap/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowRes
)

# check if model is supported
if not self._model in model_to_class.keys():
if self._model not in model_to_class:
_LOGGER.info(
"Model %s found, but not supported directly. Trying model family",
self._model,
)
self._model = self._model[:6]
if not self._model in model_to_class.keys():
if self._model not in model_to_class:
_LOGGER.warning(
"Model %s found, but not supported. Aborting discovery",
self._model,
Expand Down Expand Up @@ -239,12 +239,12 @@ async def async_step_user(self, user_input: dict[str, Any] = None) -> FlowResult
)

# check if model is supported
if not self._model in model_to_class.keys():
if self._model not in model_to_class:
_LOGGER.info(
"Model %s not supported. Trying model family", self._model
)
self._model = self._model[:6]
if not self._model in model_to_class.keys():
if self._model not in model_to_class:
return self.async_abort(reason="model_unsupported")
user_input[CONF_MODEL] = self._model

Expand Down

0 comments on commit 54de0c1

Please sign in to comment.