Skip to content

Commit

Permalink
remove 0601 models from newmodels, and display humidity level in auto…
Browse files Browse the repository at this point in the history
… modes
  • Loading branch information
Paul Schroeder authored and Paul Schroeder committed Mar 6, 2024
1 parent 0b66cd2 commit 9fc731f
Show file tree
Hide file tree
Showing 5 changed files with 294 additions and 308 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Levoit Humidifiers",
"main": "dist/index.js",
"license": "Apache-2.0",
"version": "1.12.4",
"version": "1.14.0-dev1",
"private": false,
"bugs": {
"url": "https://github.com/pschroeder89/homebridge-levoit-humidifiers/issues"
Expand Down
2 changes: 0 additions & 2 deletions src/api/deviceTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ export const NewDevices = [
DeviceName.OASIS_1000S_JP,
DeviceName.OASIS_1000S_UK,
DeviceName.LEH_S601S_WUS,
DeviceName.LUH_O601S_WUS,
DeviceName.LUH_O601S_KUS,
];

export interface DeviceType {
Expand Down
8 changes: 2 additions & 6 deletions src/characteristics/SleepState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,9 @@ const characteristic: {
await this.device.changeMode(Mode.Sleep);
break;
case false:
// LEH_S601S_WUS, LUH_O601S_KUS, LUH_O601S_WUS has an auto and humidity mode, we want to revert to humidity for that model since Auto has its own switch
// LEH_S601S_WUS has an auto and humidity mode, we want to revert to humidity for that model since Auto has its own switch
if (
[
DeviceName.LEH_S601S_WUS,
DeviceName.LUH_O601S_WUS,
DeviceName.LUH_O601S_KUS,
].includes(this.device.model as DeviceName)
[DeviceName.LEH_S601S_WUS].includes(this.device.model as DeviceName)
) {
await this.device.changeMode(Mode.Humidity);
break;
Expand Down
10 changes: 1 addition & 9 deletions src/characteristics/TargetHumidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@ const characteristic: {
} & AccessoryThisType = {
get: async function (): Promise<Nullable<CharacteristicValue>> {
await this.device.updateInfo();
// If not in auto or sleep modes, don't display the target humidity in the slider. If device is sleeping,
// and it has Warm Mode, model does not support changing Sleep mode target humidity, so display 0.
if (
this.device.isOn &&
(this.device.mode == Mode.Auto ||
(this.device.mode == Mode.Sleep &&
!this.device.deviceType.hasWarmMode) ||
this.device.mode == Mode.Humidity)
) {
if (this.device.isOn) {
return this.device.targetHumidity;
} else {
return 0;
Expand Down
Loading

0 comments on commit 9fc731f

Please sign in to comment.