mirror of
https://github.com/micahqcade/custom_vesync.git
synced 2025-02-11 09:39:00 +01:00
parent
a6015cd12e
commit
f7d1947423
@ -31,6 +31,7 @@ DEV_TYPE_TO_HA = {
|
|||||||
"LAP-C202S-WUSR": "fan",
|
"LAP-C202S-WUSR": "fan",
|
||||||
"LAP-C401S-WUSR": "fan",
|
"LAP-C401S-WUSR": "fan",
|
||||||
"LAP-C601S-WUS": "fan",
|
"LAP-C601S-WUS": "fan",
|
||||||
|
"LAP-C601S-WEU": "fan",
|
||||||
"LV-PUR131S": "fan",
|
"LV-PUR131S": "fan",
|
||||||
"Classic300S": "humidifier",
|
"Classic300S": "humidifier",
|
||||||
"ESD16": "walldimmer",
|
"ESD16": "walldimmer",
|
||||||
|
@ -226,6 +226,9 @@ class VeSyncHumidifierNightLightHA(VeSyncDimmableLightHA):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return True if night light is on."""
|
"""Return True if night light is on."""
|
||||||
|
if self.device.config_dict["module"] == "VeSyncAirBypass":
|
||||||
|
return self.smarthumidifier.details["night_light"] == "on"
|
||||||
|
else:
|
||||||
return self.smarthumidifier.details["night_light_brightness"] > 0
|
return self.smarthumidifier.details["night_light_brightness"] > 0
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -238,9 +241,14 @@ class VeSyncHumidifierNightLightHA(VeSyncDimmableLightHA):
|
|||||||
if ATTR_BRIGHTNESS in kwargs:
|
if ATTR_BRIGHTNESS in kwargs:
|
||||||
brightness = _ha_brightness_to_vesync(kwargs[ATTR_BRIGHTNESS])
|
brightness = _ha_brightness_to_vesync(kwargs[ATTR_BRIGHTNESS])
|
||||||
self.smarthumidifier.set_night_light_brightness(brightness)
|
self.smarthumidifier.set_night_light_brightness(brightness)
|
||||||
|
elif self.device.config_dict["module"] == "VeSyncAirBypass":
|
||||||
|
self.smarthumidifier.set_night_light("on")
|
||||||
else:
|
else:
|
||||||
self.smarthumidifier.set_night_light_brightness(100)
|
self.smarthumidifier.set_night_light_brightness(100)
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
"""Turn the night light off."""
|
"""Turn the night light off."""
|
||||||
|
if self.device.config_dict["module"] == "VeSyncAirBypass":
|
||||||
|
self.smarthumidifier.set_night_light("off")
|
||||||
|
else:
|
||||||
self.smarthumidifier.set_night_light_brightness(0)
|
self.smarthumidifier.set_night_light_brightness(0)
|
||||||
|
@ -50,7 +50,7 @@ def _setup_entities(devices, async_add_entities):
|
|||||||
if has_feature(dev, "details", "warm_mist_level"):
|
if has_feature(dev, "details", "warm_mist_level"):
|
||||||
entities.append(VeSyncHumidifierWarmthLevelHA(dev))
|
entities.append(VeSyncHumidifierWarmthLevelHA(dev))
|
||||||
if has_feature(dev, "config_dict", "levels"):
|
if has_feature(dev, "config_dict", "levels"):
|
||||||
entities.append((VeSyncFanSpeedLevelHA(dev),))
|
entities.append(VeSyncFanSpeedLevelHA(dev))
|
||||||
|
|
||||||
async_add_entities(entities, update_before_add=True)
|
async_add_entities(entities, update_before_add=True)
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class VeSyncFanChildLockHA(VeSyncSwitchEntity):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return True if it is locked."""
|
"""Return True if it is locked."""
|
||||||
return self.device.details["child_locked"]
|
return self.device.details["child_lock"]
|
||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
"""Turn the lock on."""
|
"""Turn the lock on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user