From e460be9886e610bceb034ae2d0ab155407a44d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Nenz=C3=A9n?= Date: Tue, 27 Aug 2024 17:23:58 +0200 Subject: [PATCH] Check device type before setting an potentially unsupported model (#139) --- custom_components/wellbeing/api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/wellbeing/api.py b/custom_components/wellbeing/api.py index b2db773..ed5e90b 100644 --- a/custom_components/wellbeing/api.py +++ b/custom_components/wellbeing/api.py @@ -351,17 +351,17 @@ async def async_get_appliances(self) -> Appliances: appliance_id = appliance.id appliance_name = appliance.name - app = Appliance(appliance_name, appliance_id, model_name) _LOGGER.debug(f"Appliance initial: {appliance.initial_data}") _LOGGER.debug(f"Appliance state: {appliance.state}") + if appliance.device_type != "AIR_PURIFIER": + continue + + app = Appliance(appliance_name, appliance_id, model_name) app.brand = appliance.brand app.serialNumber = appliance.serial_number app.device = appliance.device_type - if app.device != "AIR_PURIFIER": - continue - data = appliance.state data["status"] = appliance.state_data.get("status", "unknown") data["connectionState"] = appliance.state_data.get("connectionState", "unknown")