Skip to content

Commit

Permalink
Fix issue where we didn't load Fans if we just had a CF. (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffSteinbok authored Sep 9, 2024
1 parent 3dc830f commit 1133d3f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/dreo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,18 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
_LOGGER.error("Unable to load devices from the dreo server")
return False

_LOGGER.debug("Checking for supported installed device types")
device_types = set()
for device in pydreo_manager.devices:
device_types.add(device.type)

_LOGGER.debug("Device types found are: %s", device_types)
_LOGGER.info("%d Dreo devices found", len(pydreo_manager.devices))

platforms = set()
if (DreoDeviceType.TOWER_FAN in device_types or
DreoDeviceType.AIR_CIRCULATOR in device_types or
DreoDeviceType.AIR_PURIFIER in device_types):
DreoDeviceType.AIR_PURIFIER in device_types or
DreoDeviceType.CEILING_FAN in device_types):
platforms.add(Platform.FAN)
platforms.add(Platform.SENSOR)
platforms.add(Platform.SWITCH)
Expand Down

0 comments on commit 1133d3f

Please sign in to comment.