Skip to content

Commit

Permalink
Check device type before setting an potentially unsupported model
Browse files Browse the repository at this point in the history
  • Loading branch information
JohNan authored Aug 26, 2024
1 parent dad4512 commit 6cb52ad
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/wellbeing/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,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")
Expand Down

0 comments on commit 6cb52ad

Please sign in to comment.