Add display switch to fan devices. (#32)

* Improve night_light feature discovery

* add display switch to fans

* revert night_light removal from humidifier

* Improve switch detection

* Update light.py

* fix style
This commit is contained in:
Vincent Le Bourlot 2022-07-11 12:02:53 +02:00 committed by GitHub
parent cdbb0b8294
commit 3498625de7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,7 @@ async def async_process_devices(hass, manager):
else:
if hasattr(fan, "config_dict"):
devices[VS_NUMBERS].append(fan)
devices[VS_SWITCHES].append(fan) # for automatic stop and display
devices[VS_FANS].append(fan)
_LOGGER.info("%d VeSync fans found", len(manager.fans))

View File

@ -52,6 +52,8 @@ def _setup_entities(devices, async_add_entities):
VeSyncHumidifierAutoOnHA(dev),
)
)
elif getattr(dev, "turn_on_display", None):
entities.append(VeSyncHumidifierDisplayHA(dev))
else:
_LOGGER.warning(