Skip to content

Commit

Permalink
fix: missing sensors for 311i max models
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlb committed Dec 1, 2024
1 parent 5802521 commit fdc048d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions custom_components/ha_blueair/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
entities = []

for device in aws_devices:
if device.model in (ModelEnum.UNKNOWN, ModelEnum.PROTECT_7470I):
if device.model == ModelEnum.HUMIDIFIER_I35:
entities.extend([
BlueairTemperatureSensor(device),
BlueairHumiditySensor(device),
BlueairVOCSensor(device),
BlueairPM1Sensor(device),
BlueairPM10Sensor(device),
BlueairPM25Sensor(device),
])
elif device.model == ModelEnum.HUMIDIFIER_I35:
else:
entities.extend([
BlueairTemperatureSensor(device),
BlueairHumiditySensor(device),
BlueairVOCSensor(device),
BlueairPM1Sensor(device),
BlueairPM10Sensor(device),
BlueairPM25Sensor(device),
])

async_add_entities(entities)


Expand Down

3 comments on commit fdc048d

@rainwoodman
Copy link
Contributor

@rainwoodman rainwoodman commented on fdc048d Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add an enum and sku matching for the device?

@dahlb
Copy link
Owner Author

@dahlb dahlb commented on fdc048d Dec 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand your goal, the mapping of enum to sku is handled in the api package.

I just restructured this if since it had included all other models through unknown in an if but that better fits with newly added models maintaining behavior with it just being handled with an else so all new models don't need to be listed when they are no longer in unknown's umbrella.

@rainwoodman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I missed you change in the API package.

Please sign in to comment.