diff --git a/custom_components/vesync/const.py b/custom_components/vesync/const.py index 30d5a70..f85238a 100644 --- a/custom_components/vesync/const.py +++ b/custom_components/vesync/const.py @@ -31,6 +31,7 @@ DEV_TYPE_TO_HA = { "LAP-C202S-WUSR": "fan", "LAP-C401S-WUSR": "fan", "LAP-C601S-WUS": "fan", + "LAP-C601S-WEU": "fan", "LV-PUR131S": "fan", "Classic300S": "humidifier", "ESD16": "walldimmer", diff --git a/custom_components/vesync/light.py b/custom_components/vesync/light.py index 87cf27b..25083c0 100644 --- a/custom_components/vesync/light.py +++ b/custom_components/vesync/light.py @@ -226,7 +226,10 @@ class VeSyncHumidifierNightLightHA(VeSyncDimmableLightHA): @property def is_on(self): """Return True if night light is on.""" - return self.smarthumidifier.details["night_light_brightness"] > 0 + if self.device.config_dict["module"] == "VeSyncAirBypass": + return self.smarthumidifier.details["night_light"] == "on" + else: + return self.smarthumidifier.details["night_light_brightness"] > 0 @property def entity_category(self): @@ -238,9 +241,14 @@ class VeSyncHumidifierNightLightHA(VeSyncDimmableLightHA): if ATTR_BRIGHTNESS in kwargs: brightness = _ha_brightness_to_vesync(kwargs[ATTR_BRIGHTNESS]) self.smarthumidifier.set_night_light_brightness(brightness) + elif self.device.config_dict["module"] == "VeSyncAirBypass": + self.smarthumidifier.set_night_light("on") else: self.smarthumidifier.set_night_light_brightness(100) def turn_off(self, **kwargs): """Turn the night light off.""" - self.smarthumidifier.set_night_light_brightness(0) + if self.device.config_dict["module"] == "VeSyncAirBypass": + self.smarthumidifier.set_night_light("off") + else: + self.smarthumidifier.set_night_light_brightness(0) diff --git a/custom_components/vesync/number.py b/custom_components/vesync/number.py index d3e4260..3ee762c 100644 --- a/custom_components/vesync/number.py +++ b/custom_components/vesync/number.py @@ -50,7 +50,7 @@ def _setup_entities(devices, async_add_entities): if has_feature(dev, "details", "warm_mist_level"): entities.append(VeSyncHumidifierWarmthLevelHA(dev)) if has_feature(dev, "config_dict", "levels"): - entities.append((VeSyncFanSpeedLevelHA(dev),)) + entities.append(VeSyncFanSpeedLevelHA(dev)) async_add_entities(entities, update_before_add=True) diff --git a/custom_components/vesync/switch.py b/custom_components/vesync/switch.py index 52f8402..52e2f61 100644 --- a/custom_components/vesync/switch.py +++ b/custom_components/vesync/switch.py @@ -131,7 +131,7 @@ class VeSyncFanChildLockHA(VeSyncSwitchEntity): @property def is_on(self): """Return True if it is locked.""" - return self.device.details["child_locked"] + return self.device.details["child_lock"] def turn_on(self, **kwargs): """Turn the lock on."""