homebridge-winix-purifiers 0.0.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +86 -1
- package/config.schema.json +7 -5
- package/dist/accessory.js +106 -97
- package/dist/index.js +1 -2
- package/package.json +11 -5
- package/dist/accessory.d.ts +0 -35
- package/dist/accessory.d.ts.map +0 -1
- package/dist/accessory.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/winix/api.d.ts +0 -20
- package/dist/winix/api.d.ts.map +0 -1
- package/dist/winix/api.js +0 -79
- package/dist/winix/api.js.map +0 -1
- package/dist/winix/index.d.ts +0 -4
- package/dist/winix/index.d.ts.map +0 -1
- package/dist/winix/index.js +0 -12
- package/dist/winix/index.js.map +0 -1
- package/dist/winix/types.d.ts +0 -32
- package/dist/winix/types.d.ts.map +0 -1
- package/dist/winix/types.js +0 -33
- package/dist/winix/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
1
|
# homebridge-winix-purifiers
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Homebridge](https://homebridge.io) plugin providing support for [Winix](https://www.winixamerica.com) air purifiers.
|
|
4
|
+
|
|
5
|
+
After buying some C545 purifiers, and seeing no support from the only other Winix plugin since September 2020, I decided
|
|
6
|
+
to dive in and create an updated homebridge plugin to support them. Right now it only officially supports the C545,
|
|
7
|
+
since that's all I own, but we can expand this to other Winix purifiers with support from other device owners!
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
The following features are supported on the air purifiers:
|
|
12
|
+
|
|
13
|
+
* Switch `on` / `off`
|
|
14
|
+
* Switch between `auto` / `manual` modes
|
|
15
|
+
* Adjust airflow speed
|
|
16
|
+
* `Sleep` mapped to `0%`
|
|
17
|
+
* `Low` mapped to `25%`
|
|
18
|
+
* `Medium` mapped to `50%`
|
|
19
|
+
* `High` mapped to `75%`
|
|
20
|
+
* `Turbo` mapped to `100%`
|
|
21
|
+
|
|
22
|
+
The following features are optionally supported:
|
|
23
|
+
|
|
24
|
+
* Show air quality
|
|
25
|
+
* Expose switch to turn Plasmawave `on` / `off`
|
|
26
|
+
|
|
27
|
+
## Device Support
|
|
28
|
+
|
|
29
|
+
Currently, this plugin supports the following Winix air purifiers
|
|
30
|
+
|
|
31
|
+
* C545
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
It is highly recommended that you use the
|
|
36
|
+
main [Homebridge Config UI X](https://www.npmjs.com/package/homebridge-config-ui-x) to install and configure this
|
|
37
|
+
plugin.
|
|
38
|
+
|
|
39
|
+
### Manual Installation
|
|
40
|
+
|
|
41
|
+
1. Install this plugin using: `npm install -g homebridge-winix-purifiers`.
|
|
42
|
+
2. Update your configuration file. See below for a sample.
|
|
43
|
+
|
|
44
|
+
### Configuration
|
|
45
|
+
|
|
46
|
+
In your `config.json`, add and update the following under the `accessories` section
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"accessories": [
|
|
51
|
+
{
|
|
52
|
+
"accessory": "WinixPurifier",
|
|
53
|
+
"name": "Bedroom Air Purifier",
|
|
54
|
+
"model": "C545",
|
|
55
|
+
"deviceId": "ABCDEF012345_abcde01234",
|
|
56
|
+
"exposeAirQuality": true,
|
|
57
|
+
"exposePlasmawave": false
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Properties
|
|
64
|
+
|
|
65
|
+
| Parameter | Note |
|
|
66
|
+
|--------------------|---------------------------------------------------------------------------------|
|
|
67
|
+
| `accessory` | must always be set to `WinixPurifier` |
|
|
68
|
+
| `name` | a human-readable name for the air purifier |
|
|
69
|
+
| `model` | the model of the [supported air purifier](#Device-Support) |
|
|
70
|
+
| `deviceId` | the unique identifier of the device (see below for details on how to find this) |
|
|
71
|
+
| `exposeAirQuality` | _(optional)_ whether to expose an air quality sensor |
|
|
72
|
+
| `exposePlasmawave` | _(optional)_ whether to expose Plasmawave control as a `Switch` |
|
|
73
|
+
|
|
74
|
+
## Device ids
|
|
75
|
+
|
|
76
|
+
In order to communicate with the Winix device APIs and control your air purifiers, you need your device ids.
|
|
77
|
+
|
|
78
|
+
Follow [these steps](https://www.winixamerica.com/2021/11/04/winix-smart-app/) to connect your purifiers with the Winix
|
|
79
|
+
app. These steps are necessary to connect your purifier to Winix and allow it to be controlled with this homebridge
|
|
80
|
+
plugin.
|
|
81
|
+
|
|
82
|
+
### [hfern/winix](https://github.com/hfern/winix)
|
|
83
|
+
|
|
84
|
+
[@hfern](https://github.com/hfern) has reverse-engineered the Winix android app and created
|
|
85
|
+
a [Python CLI](https://github.com/hfern/winix). This CLI allows you to, among other things, login and get the device
|
|
86
|
+
ids associated with your account. I have used this to successfully get my device ids. Follow the setup and auth steps
|
|
87
|
+
in the [README](https://github.com/hfern/winix/blob/master/README.md). You should then be able to find your device ids
|
|
88
|
+
in the file `~/.config/winix/config.json`
|
package/config.schema.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"pluginAlias": "
|
|
2
|
+
"pluginAlias": "WinixPurifier",
|
|
3
3
|
"pluginType": "accessory",
|
|
4
4
|
"singular": false,
|
|
5
|
-
"headerDisplay": "
|
|
6
|
-
"footerDisplay": "
|
|
5
|
+
"headerDisplay": "Configure one or more Winix air purifiers below",
|
|
6
|
+
"footerDisplay": "For help finding your device id, see [here](https://github.com/regaw-leinad/homebridge-winix-purifiers#device-ids)",
|
|
7
7
|
"schema": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"properties": {
|
|
10
10
|
"name": {
|
|
11
11
|
"title": "Purifier Name",
|
|
12
|
+
"description": "The name of this Winix air purifier you want to expose to Homekit",
|
|
12
13
|
"type": "string",
|
|
13
14
|
"required": true,
|
|
14
15
|
"default": "My Winix Purifier"
|
|
15
16
|
},
|
|
16
17
|
"model": {
|
|
17
18
|
"title": "Model",
|
|
18
|
-
"description": "The model of
|
|
19
|
+
"description": "The model of your Winix air purifier",
|
|
19
20
|
"type": "string",
|
|
20
21
|
"default": "C545",
|
|
21
22
|
"required": true,
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
},
|
|
31
32
|
"deviceId": {
|
|
32
33
|
"title": "Device ID",
|
|
34
|
+
"description": "The device id of your Winix air purifier",
|
|
33
35
|
"type": "string",
|
|
34
36
|
"required": true
|
|
35
37
|
},
|
|
@@ -37,7 +39,7 @@
|
|
|
37
39
|
"title": "Air Quality Sensor",
|
|
38
40
|
"description": "Whether or not to expose the air quality sensor to HomeKit",
|
|
39
41
|
"type": "boolean",
|
|
40
|
-
"default":
|
|
42
|
+
"default": false
|
|
41
43
|
},
|
|
42
44
|
"exposePlasmawave": {
|
|
43
45
|
"title": "Plasmawave Switch",
|
package/dist/accessory.js
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WinixPurifierAccessory = void 0;
|
|
4
|
-
const
|
|
5
|
-
const winix = new winix_1.WinixAPI();
|
|
4
|
+
const winix_api_1 = require("winix-api");
|
|
6
5
|
class WinixPurifierAccessory {
|
|
7
6
|
constructor(log, config, api) {
|
|
7
|
+
var _a, _b;
|
|
8
8
|
this.hap = api.hap;
|
|
9
9
|
this.log = log;
|
|
10
|
-
|
|
10
|
+
const deviceName = config.name;
|
|
11
11
|
this.deviceId = config.deviceId;
|
|
12
|
-
this.
|
|
13
|
-
power:
|
|
14
|
-
mode:
|
|
15
|
-
airflow:
|
|
16
|
-
airQuality:
|
|
17
|
-
plasmawave:
|
|
12
|
+
this.latestStatus = {
|
|
13
|
+
power: winix_api_1.Power.Off,
|
|
14
|
+
mode: winix_api_1.Mode.Auto,
|
|
15
|
+
airflow: winix_api_1.Airflow.Low,
|
|
16
|
+
airQuality: winix_api_1.AirQuality.Good,
|
|
17
|
+
plasmawave: winix_api_1.Plasmawave.On,
|
|
18
18
|
};
|
|
19
19
|
this.services = [];
|
|
20
|
-
//
|
|
21
|
-
this.purifier = new this.hap.Service.AirPurifier(
|
|
22
|
-
this.registerService(this.
|
|
20
|
+
// Create services
|
|
21
|
+
this.purifier = this.registerService(new this.hap.Service.AirPurifier(deviceName));
|
|
22
|
+
const purifierInfo = this.registerService(new this.hap.Service.AccessoryInformation());
|
|
23
|
+
if (config.exposeAirQuality) {
|
|
24
|
+
this.airQuality = this.registerService(new this.hap.Service.AirQualitySensor(`${deviceName} Air Quality`));
|
|
25
|
+
}
|
|
26
|
+
if (config.exposePlasmawave) {
|
|
27
|
+
this.plasmawave = this.registerService(new this.hap.Service.Switch(`${deviceName} Plasmawave`));
|
|
28
|
+
}
|
|
29
|
+
// Assign characteristics
|
|
23
30
|
this.purifier.getCharacteristic(this.hap.Characteristic.Active)
|
|
24
31
|
.onGet(this.getActiveState.bind(this))
|
|
25
32
|
.onSet(this.setActiveState.bind(this));
|
|
@@ -31,187 +38,189 @@ class WinixPurifierAccessory {
|
|
|
31
38
|
this.purifier.getCharacteristic(this.hap.Characteristic.RotationSpeed)
|
|
32
39
|
.onGet(this.getRotationSpeed.bind(this))
|
|
33
40
|
.onSet(this.setRotationSpeed.bind(this));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this.registerService(purifierInfo);
|
|
37
|
-
purifierInfo.setCharacteristic(this.hap.Characteristic.Manufacturer, 'Winix')
|
|
41
|
+
purifierInfo
|
|
42
|
+
.setCharacteristic(this.hap.Characteristic.Manufacturer, 'Winix')
|
|
38
43
|
.setCharacteristic(this.hap.Characteristic.Model, config.model);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
this.registerService(this.airQuality);
|
|
42
|
-
this.airQuality.getCharacteristic(this.hap.Characteristic.AirQuality)
|
|
43
|
-
.onGet(this.getAirQuality.bind(this));
|
|
44
|
-
}
|
|
45
|
-
if (config.exposePlasmawave) {
|
|
46
|
-
this.plasmawave = new this.hap.Service.Switch(`${this.deviceName} Plasmawave`);
|
|
47
|
-
this.registerService(this.plasmawave);
|
|
48
|
-
this.plasmawave.getCharacteristic(this.hap.Characteristic.On)
|
|
49
|
-
.onGet(this.getPlasmawave.bind(this))
|
|
50
|
-
.onSet(this.setPlasmawave.bind(this));
|
|
51
|
-
}
|
|
44
|
+
(_a = this.airQuality) === null || _a === void 0 ? void 0 : _a.getCharacteristic(this.hap.Characteristic.AirQuality).onGet(this.getAirQuality.bind(this));
|
|
45
|
+
(_b = this.plasmawave) === null || _b === void 0 ? void 0 : _b.getCharacteristic(this.hap.Characteristic.On).onGet(this.getPlasmawave.bind(this)).onSet(this.setPlasmawave.bind(this));
|
|
52
46
|
}
|
|
53
47
|
async getActiveState() {
|
|
54
|
-
const power = await
|
|
55
|
-
this.
|
|
48
|
+
const power = await winix_api_1.WinixAPI.getPower(this.deviceId);
|
|
49
|
+
this.latestStatus.power = power;
|
|
56
50
|
this.log.debug('getActiveState()', power);
|
|
57
|
-
return power ===
|
|
51
|
+
return power === winix_api_1.Power.On ? this.hap.Characteristic.Active.ACTIVE : this.hap.Characteristic.Active.INACTIVE;
|
|
58
52
|
}
|
|
59
53
|
async setActiveState(state) {
|
|
60
|
-
const power = state === this.hap.Characteristic.Active.ACTIVE ?
|
|
54
|
+
const power = state === this.hap.Characteristic.Active.ACTIVE ? winix_api_1.Power.On : winix_api_1.Power.Off;
|
|
61
55
|
this.log.debug(`setActiveState(${state})`, power);
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
if (this.latestStatus.power === power) {
|
|
57
|
+
this.log.debug('ignoring duplicate state set: active');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
await winix_api_1.WinixAPI.setPower(this.deviceId, power);
|
|
61
|
+
this.latestStatus.power = power;
|
|
64
62
|
this.sendHomekitUpdate();
|
|
65
63
|
}
|
|
66
64
|
async getCurrentState() {
|
|
67
|
-
const power = await
|
|
68
|
-
this.
|
|
65
|
+
const power = await winix_api_1.WinixAPI.getPower(this.deviceId);
|
|
66
|
+
this.latestStatus.power = power;
|
|
69
67
|
this.log.debug('getCurrentState()', power);
|
|
70
|
-
return power ===
|
|
68
|
+
return power === winix_api_1.Power.On ? this.hap.Characteristic.CurrentAirPurifierState.PURIFYING_AIR :
|
|
71
69
|
this.hap.Characteristic.CurrentAirPurifierState.INACTIVE;
|
|
72
70
|
}
|
|
73
71
|
async getTargetState() {
|
|
74
|
-
const mode = await
|
|
75
|
-
this.
|
|
72
|
+
const mode = await winix_api_1.WinixAPI.getMode(this.deviceId);
|
|
73
|
+
this.latestStatus.mode = mode;
|
|
76
74
|
this.log.debug('getTargetState()', mode);
|
|
77
|
-
return mode ===
|
|
75
|
+
return mode === winix_api_1.Mode.Auto ? this.hap.Characteristic.TargetAirPurifierState.AUTO :
|
|
78
76
|
this.hap.Characteristic.TargetAirPurifierState.MANUAL;
|
|
79
77
|
}
|
|
80
78
|
async setTargetState(state) {
|
|
81
|
-
const mode = state === this.hap.Characteristic.TargetAirPurifierState.AUTO ?
|
|
79
|
+
const mode = state === this.hap.Characteristic.TargetAirPurifierState.AUTO ? winix_api_1.Mode.Auto : winix_api_1.Mode.Manual;
|
|
82
80
|
this.log.debug(`setTargetState(${state})`, mode);
|
|
83
|
-
|
|
84
|
-
this
|
|
81
|
+
// Don't try to set the mode if we're already in this mode
|
|
82
|
+
// Fixes issues with this being set right around the time of power on
|
|
83
|
+
if (this.latestStatus.mode === mode) {
|
|
84
|
+
this.log.debug('ignoring duplicate state set: target');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
await winix_api_1.WinixAPI.setMode(this.deviceId, mode);
|
|
88
|
+
this.latestStatus.mode = mode;
|
|
85
89
|
this.sendHomekitUpdate();
|
|
86
|
-
if (mode ===
|
|
90
|
+
if (mode === winix_api_1.Mode.Manual) {
|
|
87
91
|
return;
|
|
88
92
|
}
|
|
89
|
-
|
|
93
|
+
// If we're switching back to auto, the airflow speed will most likely change on the Winix device itself.
|
|
94
|
+
// Pause, get the latest airflow speed, then send the update to Homekit
|
|
95
|
+
this.log.debug('scheduling homekit update to rotation speed');
|
|
90
96
|
setTimeout(async () => {
|
|
91
97
|
await this.getRotationSpeed();
|
|
92
98
|
this.sendHomekitUpdate();
|
|
93
99
|
}, 2000);
|
|
94
100
|
}
|
|
95
101
|
async getRotationSpeed() {
|
|
96
|
-
const airflow = await
|
|
97
|
-
this.
|
|
98
|
-
this.log.debug('getRotationSpeed()', airflow);
|
|
102
|
+
const airflow = await winix_api_1.WinixAPI.getAirflow(this.deviceId);
|
|
103
|
+
this.latestStatus.airflow = airflow;
|
|
104
|
+
this.log.debug('getRotationSpeed():', airflow);
|
|
99
105
|
return this.toRotationSpeed(airflow);
|
|
100
106
|
}
|
|
101
107
|
async setRotationSpeed(state) {
|
|
102
108
|
const airflow = this.toAirflow(state);
|
|
103
|
-
this.log.debug(`setRotationSpeed(${state})
|
|
104
|
-
await
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
109
|
+
this.log.debug(`setRotationSpeed(${state}):`, airflow);
|
|
110
|
+
await winix_api_1.WinixAPI.setAirflow(this.deviceId, airflow);
|
|
111
|
+
this.latestStatus.airflow = airflow;
|
|
112
|
+
this.latestStatus.mode = winix_api_1.Mode.Manual;
|
|
107
113
|
this.sendHomekitUpdate();
|
|
108
114
|
}
|
|
109
115
|
async getAirQuality() {
|
|
110
|
-
const airQuality = await
|
|
111
|
-
this.
|
|
112
|
-
this.log.debug('getAirQuality()', airQuality);
|
|
116
|
+
const airQuality = await winix_api_1.WinixAPI.getAirQuality(this.deviceId);
|
|
117
|
+
this.latestStatus.airQuality = airQuality;
|
|
118
|
+
this.log.debug('getAirQuality():', airQuality);
|
|
113
119
|
return this.toAirQuality(airQuality);
|
|
114
120
|
}
|
|
115
121
|
async getPlasmawave() {
|
|
116
|
-
const plasmawave = await
|
|
117
|
-
this.
|
|
118
|
-
this.log.debug('getPlasmawave()', plasmawave);
|
|
122
|
+
const plasmawave = await winix_api_1.WinixAPI.getPlasmawave(this.deviceId);
|
|
123
|
+
this.latestStatus.plasmawave = plasmawave;
|
|
124
|
+
this.log.debug('getPlasmawave():', plasmawave);
|
|
119
125
|
return this.toSwitch(plasmawave);
|
|
120
126
|
}
|
|
121
127
|
async setPlasmawave(state) {
|
|
122
128
|
const plasmawave = this.toPlasmawave(state);
|
|
123
|
-
this.log.debug(`setPlasmawave(${state})
|
|
124
|
-
await
|
|
125
|
-
this.
|
|
129
|
+
this.log.debug(`setPlasmawave(${state}):`, plasmawave);
|
|
130
|
+
await winix_api_1.WinixAPI.setPlasmawave(this.deviceId, plasmawave);
|
|
131
|
+
this.latestStatus.plasmawave = plasmawave;
|
|
126
132
|
this.sendHomekitUpdate();
|
|
127
133
|
}
|
|
128
134
|
sendHomekitUpdate() {
|
|
129
135
|
var _a, _b;
|
|
130
136
|
this.log.debug('sendHomekitUpdate()');
|
|
131
|
-
this.purifier.updateCharacteristic(this.hap.Characteristic.Active, this.toActiveState(this.
|
|
132
|
-
this.purifier.updateCharacteristic(this.hap.Characteristic.CurrentAirPurifierState, this.toCurrentState(this.
|
|
133
|
-
this.purifier.updateCharacteristic(this.hap.Characteristic.TargetAirPurifierState, this.toTargetState(this.
|
|
134
|
-
this.purifier.updateCharacteristic(this.hap.Characteristic.RotationSpeed, this.toRotationSpeed(this.
|
|
135
|
-
(_a = this.airQuality) === null || _a === void 0 ? void 0 : _a.updateCharacteristic(this.hap.Characteristic.AirQuality, this.toAirQuality(this.
|
|
136
|
-
(_b = this.plasmawave) === null || _b === void 0 ? void 0 : _b.updateCharacteristic(this.hap.Characteristic.On, this.toSwitch(this.
|
|
137
|
+
this.purifier.updateCharacteristic(this.hap.Characteristic.Active, this.toActiveState(this.latestStatus.power));
|
|
138
|
+
this.purifier.updateCharacteristic(this.hap.Characteristic.CurrentAirPurifierState, this.toCurrentState(this.latestStatus.power));
|
|
139
|
+
this.purifier.updateCharacteristic(this.hap.Characteristic.TargetAirPurifierState, this.toTargetState(this.latestStatus.mode));
|
|
140
|
+
this.purifier.updateCharacteristic(this.hap.Characteristic.RotationSpeed, this.toRotationSpeed(this.latestStatus.airflow));
|
|
141
|
+
(_a = this.airQuality) === null || _a === void 0 ? void 0 : _a.updateCharacteristic(this.hap.Characteristic.AirQuality, this.toAirQuality(this.latestStatus.airQuality));
|
|
142
|
+
(_b = this.plasmawave) === null || _b === void 0 ? void 0 : _b.updateCharacteristic(this.hap.Characteristic.On, this.toSwitch(this.latestStatus.plasmawave));
|
|
137
143
|
}
|
|
138
144
|
toActiveState(power) {
|
|
139
145
|
switch (power) {
|
|
140
|
-
case
|
|
146
|
+
case winix_api_1.Power.On:
|
|
141
147
|
return this.hap.Characteristic.Active.ACTIVE;
|
|
142
|
-
case
|
|
148
|
+
case winix_api_1.Power.Off:
|
|
143
149
|
return this.hap.Characteristic.Active.INACTIVE;
|
|
144
150
|
}
|
|
145
151
|
}
|
|
146
152
|
toCurrentState(power) {
|
|
147
153
|
switch (power) {
|
|
148
|
-
case
|
|
154
|
+
case winix_api_1.Power.On:
|
|
149
155
|
return this.hap.Characteristic.CurrentAirPurifierState.PURIFYING_AIR;
|
|
150
|
-
case
|
|
156
|
+
case winix_api_1.Power.Off:
|
|
151
157
|
return this.hap.Characteristic.CurrentAirPurifierState.INACTIVE;
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
160
|
toTargetState(mode) {
|
|
155
161
|
switch (mode) {
|
|
156
|
-
case
|
|
162
|
+
case winix_api_1.Mode.Auto:
|
|
157
163
|
return this.hap.Characteristic.TargetAirPurifierState.AUTO;
|
|
158
|
-
case
|
|
164
|
+
case winix_api_1.Mode.Manual:
|
|
159
165
|
return this.hap.Characteristic.TargetAirPurifierState.MANUAL;
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
toRotationSpeed(airflow) {
|
|
163
169
|
switch (airflow) {
|
|
164
|
-
case
|
|
170
|
+
case winix_api_1.Airflow.Sleep:
|
|
165
171
|
return 0;
|
|
166
|
-
case
|
|
172
|
+
case winix_api_1.Airflow.Low:
|
|
167
173
|
return 25;
|
|
168
|
-
case
|
|
174
|
+
case winix_api_1.Airflow.Medium:
|
|
169
175
|
return 50;
|
|
170
|
-
case
|
|
176
|
+
case winix_api_1.Airflow.High:
|
|
171
177
|
return 75;
|
|
172
|
-
case
|
|
178
|
+
case winix_api_1.Airflow.Turbo:
|
|
173
179
|
return 100;
|
|
174
180
|
}
|
|
175
181
|
}
|
|
176
182
|
toAirflow(state) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
// Round to nearest 25
|
|
184
|
+
const nearestState = Math.round(state / 25) * 25;
|
|
185
|
+
this.log.debug(`toAirflow(${state}): ${nearestState}`);
|
|
186
|
+
switch (nearestState) {
|
|
187
|
+
case 0:
|
|
188
|
+
return winix_api_1.Airflow.Sleep;
|
|
189
|
+
case 25:
|
|
190
|
+
return winix_api_1.Airflow.Low;
|
|
191
|
+
case 50:
|
|
192
|
+
return winix_api_1.Airflow.Medium;
|
|
193
|
+
case 75:
|
|
194
|
+
return winix_api_1.Airflow.High;
|
|
195
|
+
case 100:
|
|
196
|
+
return winix_api_1.Airflow.Turbo;
|
|
188
197
|
}
|
|
189
|
-
return
|
|
198
|
+
return nearestState > 100 ? winix_api_1.Airflow.Turbo : winix_api_1.Airflow.Sleep;
|
|
190
199
|
}
|
|
191
200
|
toAirQuality(airQuality) {
|
|
192
201
|
switch (airQuality) {
|
|
193
|
-
case
|
|
202
|
+
case winix_api_1.AirQuality.Good:
|
|
194
203
|
return this.hap.Characteristic.AirQuality.GOOD;
|
|
195
|
-
case
|
|
204
|
+
case winix_api_1.AirQuality.Fair:
|
|
196
205
|
return this.hap.Characteristic.AirQuality.FAIR;
|
|
197
|
-
case
|
|
206
|
+
case winix_api_1.AirQuality.Poor:
|
|
198
207
|
return this.hap.Characteristic.AirQuality.POOR;
|
|
199
208
|
default:
|
|
200
209
|
return this.hap.Characteristic.AirQuality.UNKNOWN;
|
|
201
210
|
}
|
|
202
211
|
}
|
|
203
212
|
toSwitch(plasmawave) {
|
|
204
|
-
return plasmawave ===
|
|
213
|
+
return plasmawave === winix_api_1.Plasmawave.On;
|
|
205
214
|
}
|
|
206
215
|
toPlasmawave(state) {
|
|
207
|
-
return state ?
|
|
216
|
+
return state ? winix_api_1.Plasmawave.On : winix_api_1.Plasmawave.Off;
|
|
208
217
|
}
|
|
209
218
|
registerService(service) {
|
|
210
219
|
this.services.push(service);
|
|
220
|
+
return service;
|
|
211
221
|
}
|
|
212
222
|
getServices() {
|
|
213
223
|
return this.services;
|
|
214
224
|
}
|
|
215
225
|
}
|
|
216
226
|
exports.WinixPurifierAccessory = WinixPurifierAccessory;
|
|
217
|
-
//# sourceMappingURL=accessory.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const accessory_1 = require("./accessory");
|
|
3
3
|
module.exports = (api) => {
|
|
4
|
-
api.registerAccessory('homebridge-winix-purifiers', '
|
|
4
|
+
api.registerAccessory('homebridge-winix-purifiers', 'WinixPurifier', accessory_1.WinixPurifierAccessory);
|
|
5
5
|
};
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"displayName": "Winix Air Purifiers",
|
|
4
4
|
"name": "homebridge-winix-purifiers",
|
|
5
|
-
"version": "0.0
|
|
5
|
+
"version": "1.0.0",
|
|
6
6
|
"description": "Homebridge plugin for Winix air purifiers",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"repository": {
|
|
@@ -17,10 +17,16 @@
|
|
|
17
17
|
"homebridge": ">=1.3.5"
|
|
18
18
|
},
|
|
19
19
|
"main": "dist/index.js",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"config.schema.json"
|
|
23
|
+
],
|
|
20
24
|
"scripts": {
|
|
21
25
|
"lint": "eslint src/**.ts --max-warnings=0",
|
|
22
26
|
"watch": "npm run build && npm link && nodemon",
|
|
23
|
-
"build": "rimraf ./dist && tsc"
|
|
27
|
+
"build": "rimraf ./dist && tsc",
|
|
28
|
+
"version": "npm run lint && npm run build",
|
|
29
|
+
"postversion": "git push && git push --tags && rimraf ./dist"
|
|
24
30
|
},
|
|
25
31
|
"keywords": [
|
|
26
32
|
"homebridge-plugin",
|
|
@@ -31,17 +37,17 @@
|
|
|
31
37
|
"winix air purifier"
|
|
32
38
|
],
|
|
33
39
|
"dependencies": {
|
|
34
|
-
"axios": "^1.1.2"
|
|
40
|
+
"axios": "^1.1.2",
|
|
41
|
+
"winix-api": "^1.0.0"
|
|
35
42
|
},
|
|
36
43
|
"devDependencies": {
|
|
37
|
-
"@types/node": "^
|
|
44
|
+
"@types/node": "^18.11.0",
|
|
38
45
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
39
46
|
"@typescript-eslint/parser": "^5.0.0",
|
|
40
47
|
"eslint": "^8.0.1",
|
|
41
48
|
"homebridge": "^1.3.5",
|
|
42
49
|
"nodemon": "^2.0.13",
|
|
43
50
|
"rimraf": "^3.0.2",
|
|
44
|
-
"ts-node": "^10.3.0",
|
|
45
51
|
"typescript": "^4.4.4"
|
|
46
52
|
}
|
|
47
53
|
}
|
package/dist/accessory.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AccessoryConfig, AccessoryPlugin, API, CharacteristicValue, Logging, Service } from 'homebridge';
|
|
2
|
-
export declare class WinixPurifierAccessory implements AccessoryPlugin {
|
|
3
|
-
private readonly hap;
|
|
4
|
-
private readonly log;
|
|
5
|
-
private readonly deviceName;
|
|
6
|
-
private readonly deviceId;
|
|
7
|
-
private readonly deviceStatus;
|
|
8
|
-
private readonly services;
|
|
9
|
-
private readonly purifier;
|
|
10
|
-
private readonly airQuality?;
|
|
11
|
-
private readonly plasmawave?;
|
|
12
|
-
constructor(log: Logging, config: AccessoryConfig, api: API);
|
|
13
|
-
getActiveState(): Promise<CharacteristicValue>;
|
|
14
|
-
setActiveState(state: CharacteristicValue): Promise<void>;
|
|
15
|
-
getCurrentState(): Promise<CharacteristicValue>;
|
|
16
|
-
getTargetState(): Promise<CharacteristicValue>;
|
|
17
|
-
setTargetState(state: CharacteristicValue): Promise<void>;
|
|
18
|
-
getRotationSpeed(): Promise<CharacteristicValue>;
|
|
19
|
-
setRotationSpeed(state: CharacteristicValue): Promise<void>;
|
|
20
|
-
getAirQuality(): Promise<CharacteristicValue>;
|
|
21
|
-
getPlasmawave(): Promise<CharacteristicValue>;
|
|
22
|
-
setPlasmawave(state: CharacteristicValue): Promise<void>;
|
|
23
|
-
private sendHomekitUpdate;
|
|
24
|
-
private toActiveState;
|
|
25
|
-
private toCurrentState;
|
|
26
|
-
private toTargetState;
|
|
27
|
-
private toRotationSpeed;
|
|
28
|
-
private toAirflow;
|
|
29
|
-
private toAirQuality;
|
|
30
|
-
private toSwitch;
|
|
31
|
-
private toPlasmawave;
|
|
32
|
-
private registerService;
|
|
33
|
-
getServices(): Service[];
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=accessory.d.ts.map
|
package/dist/accessory.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"accessory.d.ts","sourceRoot":"","sources":["../src/accessory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,GAAG,EAAE,mBAAmB,EAAO,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAK/G,qBAAa,sBAAuB,YAAW,eAAe;IAE5D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAM;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAE9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC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;YACpB,OAAO,eAAO,CAAC,GAAG,CAAC;SACpB;QAED,OAAO,eAAO,CAAC,KAAK,CAAC;IACvB,CAAC;IAEO,YAAY,CAAC,UAAsB;QACzC,QAAQ,UAAU,EAAE;YAClB,KAAK,kBAAU,CAAC,IAAI;gBAClB,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC;YACjD,KAAK,kBAAU,CAAC,IAAI;gBAClB,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC;YACjD,KAAK,kBAAU,CAAC,IAAI;gBAClB,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC;YACjD;gBACE,OAAO,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC;SACrD;IACH,CAAC;IAEO,QAAQ,CAAC,UAAsB;QACrC,OAAO,UAAU,KAAK,kBAAU,CAAC,EAAE,CAAC;IACtC,CAAC;IAEO,YAAY,CAAC,KAA0B;QAC7C,OAAO,KAAK,CAAC,CAAC,CAAC,kBAAU,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAU,CAAC,GAAG,CAAC;IAChD,CAAC;IAEO,eAAe,CAAC,OAAgB;QACtC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AA1QD,wDA0QC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;8BAGlB,GAAG;AAAlB,kBAEE"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,2CAAqD;AAErD,iBAAS,CAAC,GAAQ,EAAE,EAAE;IACpB,GAAG,CAAC,iBAAiB,CAAC,4BAA4B,EAAE,gBAAgB,EAAE,kCAAsB,CAAC,CAAC;AAChG,CAAC,CAAC"}
|
package/dist/winix/api.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Airflow, AirQuality, DeviceStatus, Mode, Plasmawave, Power } from './types';
|
|
2
|
-
export declare class WinixAPI {
|
|
3
|
-
getPower(deviceId: string): Promise<Power>;
|
|
4
|
-
setPower(deviceId: string, value: Power): Promise<Power>;
|
|
5
|
-
getMode(deviceId: string): Promise<Mode>;
|
|
6
|
-
setMode(deviceId: string, value: Mode): Promise<Mode>;
|
|
7
|
-
getAirflow(deviceId: string): Promise<Airflow>;
|
|
8
|
-
setAirflow(deviceId: string, value: Airflow): Promise<Airflow>;
|
|
9
|
-
getAirQuality(deviceId: string): Promise<AirQuality>;
|
|
10
|
-
getPlasmawave(deviceId: string): Promise<Plasmawave>;
|
|
11
|
-
setPlasmawave(deviceId: string, value: Plasmawave): Promise<Plasmawave>;
|
|
12
|
-
getDeviceStatus(deviceId: string): Promise<DeviceStatus>;
|
|
13
|
-
private getDeviceStatusInternal;
|
|
14
|
-
private getDeviceAttribute;
|
|
15
|
-
private setDeviceAttribute;
|
|
16
|
-
private getDeviceStatusUrl;
|
|
17
|
-
private getSetAttributeUrl;
|
|
18
|
-
private toDevice;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/winix/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/winix/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAsCrF,qBAAa,QAAQ;IAEb,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;IAI1C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAIxD,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAIrD,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9C,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAI9D,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIpD,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAIpD,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAIvE,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;YAKhD,uBAAuB;YAMvB,kBAAkB;YAKlB,kBAAkB;IAMhC,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,QAAQ;CASjB"}
|
package/dist/winix/api.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.WinixAPI = void 0;
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
var Attribute;
|
|
9
|
-
(function (Attribute) {
|
|
10
|
-
Attribute["Power"] = "A02";
|
|
11
|
-
Attribute["Mode"] = "A03";
|
|
12
|
-
Attribute["Airflow"] = "A04";
|
|
13
|
-
Attribute["Plasmawave"] = "A07";
|
|
14
|
-
Attribute["AirQuality"] = "S07";
|
|
15
|
-
})(Attribute || (Attribute = {}));
|
|
16
|
-
class WinixAPI {
|
|
17
|
-
async getPower(deviceId) {
|
|
18
|
-
return await this.getDeviceAttribute(deviceId, Attribute.Power);
|
|
19
|
-
}
|
|
20
|
-
async setPower(deviceId, value) {
|
|
21
|
-
return await this.setDeviceAttribute(deviceId, Attribute.Power, value);
|
|
22
|
-
}
|
|
23
|
-
async getMode(deviceId) {
|
|
24
|
-
return await this.getDeviceAttribute(deviceId, Attribute.Mode);
|
|
25
|
-
}
|
|
26
|
-
async setMode(deviceId, value) {
|
|
27
|
-
return await this.setDeviceAttribute(deviceId, Attribute.Mode, value);
|
|
28
|
-
}
|
|
29
|
-
async getAirflow(deviceId) {
|
|
30
|
-
return await this.getDeviceAttribute(deviceId, Attribute.Airflow);
|
|
31
|
-
}
|
|
32
|
-
async setAirflow(deviceId, value) {
|
|
33
|
-
return await this.setDeviceAttribute(deviceId, Attribute.Airflow, value);
|
|
34
|
-
}
|
|
35
|
-
async getAirQuality(deviceId) {
|
|
36
|
-
return await this.getDeviceAttribute(deviceId, Attribute.AirQuality);
|
|
37
|
-
}
|
|
38
|
-
async getPlasmawave(deviceId) {
|
|
39
|
-
return await this.getDeviceAttribute(deviceId, Attribute.Plasmawave);
|
|
40
|
-
}
|
|
41
|
-
async setPlasmawave(deviceId, value) {
|
|
42
|
-
return await this.setDeviceAttribute(deviceId, Attribute.Plasmawave, value);
|
|
43
|
-
}
|
|
44
|
-
async getDeviceStatus(deviceId) {
|
|
45
|
-
const attributes = await this.getDeviceStatusInternal(deviceId);
|
|
46
|
-
return this.toDevice(attributes);
|
|
47
|
-
}
|
|
48
|
-
async getDeviceStatusInternal(deviceId) {
|
|
49
|
-
const url = this.getDeviceStatusUrl(deviceId);
|
|
50
|
-
const result = await axios_1.default.get(url);
|
|
51
|
-
return result.data.body.data[0].attributes;
|
|
52
|
-
}
|
|
53
|
-
async getDeviceAttribute(deviceId, attribute) {
|
|
54
|
-
const attributes = await this.getDeviceStatusInternal(deviceId);
|
|
55
|
-
return attributes[attribute.toString()];
|
|
56
|
-
}
|
|
57
|
-
async setDeviceAttribute(deviceId, attribute, value) {
|
|
58
|
-
const url = this.getSetAttributeUrl(deviceId, attribute, value);
|
|
59
|
-
await axios_1.default.get(url);
|
|
60
|
-
return value;
|
|
61
|
-
}
|
|
62
|
-
getDeviceStatusUrl(deviceId) {
|
|
63
|
-
return `https://us.api.winix-iot.com/common/event/sttus/devices/${deviceId}`;
|
|
64
|
-
}
|
|
65
|
-
getSetAttributeUrl(deviceId, attribute, value) {
|
|
66
|
-
return `https://us.api.winix-iot.com/common/control/devices/${deviceId}/A211/${attribute}:${value}`;
|
|
67
|
-
}
|
|
68
|
-
toDevice(attributes) {
|
|
69
|
-
return {
|
|
70
|
-
power: attributes[Attribute.Power],
|
|
71
|
-
mode: attributes[Attribute.Mode],
|
|
72
|
-
airflow: attributes[Attribute.Airflow],
|
|
73
|
-
airQuality: attributes[Attribute.AirQuality],
|
|
74
|
-
plasmawave: attributes[Attribute.Plasmawave],
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
exports.WinixAPI = WinixAPI;
|
|
79
|
-
//# sourceMappingURL=api.js.map
|
package/dist/winix/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/winix/api.ts"],"names":[],"mappings":";;;;;;AACA,kDAA6C;AAiC7C,IAAK,SAAkG;AAAvG,WAAK,SAAS;IAAG,0BAAa,CAAA;IAAE,yBAAY,CAAA;IAAE,4BAAe,CAAA;IAAE,+BAAkB,CAAA;IAAE,+BAAkB,CAAA;AAA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O,uDAAuD,QAAQ,SAAS,SAAS,IAAI,KAAK,EAAE,CAAC;IACtG,CAAC;IAEO,QAAQ,CAAC,UAA4B;QAC3C,OAAO;YACL,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,KAAK,CAAU;YAC3C,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAS;YACxC,OAAO,EAAE,UAAU,CAAC,SAAS,CAAC,OAAO,CAAY;YACjD,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAe;YAC1D,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,UAAU,CAAe;SAC3D,CAAC;IACJ,CAAC;CACF;AA7ED,4BA6EC"}
|
package/dist/winix/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/winix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,OAAO,EACP,UAAU,EACV,UAAU,EACV,YAAY,GACb,CAAC"}
|
package/dist/winix/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Plasmawave = exports.AirQuality = exports.Airflow = exports.Mode = exports.Power = exports.WinixAPI = void 0;
|
|
4
|
-
const types_1 = require("./types");
|
|
5
|
-
Object.defineProperty(exports, "Airflow", { enumerable: true, get: function () { return types_1.Airflow; } });
|
|
6
|
-
Object.defineProperty(exports, "AirQuality", { enumerable: true, get: function () { return types_1.AirQuality; } });
|
|
7
|
-
Object.defineProperty(exports, "Mode", { enumerable: true, get: function () { return types_1.Mode; } });
|
|
8
|
-
Object.defineProperty(exports, "Plasmawave", { enumerable: true, get: function () { return types_1.Plasmawave; } });
|
|
9
|
-
Object.defineProperty(exports, "Power", { enumerable: true, get: function () { return types_1.Power; } });
|
|
10
|
-
const api_1 = require("./api");
|
|
11
|
-
Object.defineProperty(exports, "WinixAPI", { enumerable: true, get: function () { return api_1.WinixAPI; } });
|
|
12
|
-
//# sourceMappingURL=index.js.map
|
package/dist/winix/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/winix/index.ts"],"names":[],"mappings":";;;AAAA,mCAAqF;AAOnF,wFAPO,eAAO,OAOP;AACP,2FARgB,kBAAU,OAQhB;AAFV,qFAN0C,YAAI,OAM1C;AAGJ,2FATgD,kBAAU,OAShD;AAJV,sFAL4D,aAAK,OAK5D;AAJP,+BAAiC;AAG/B,yFAHO,cAAQ,OAGP"}
|
package/dist/winix/types.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare enum Power {
|
|
2
|
-
Off = "0",
|
|
3
|
-
On = "1"
|
|
4
|
-
}
|
|
5
|
-
export declare enum Mode {
|
|
6
|
-
Auto = "01",
|
|
7
|
-
Manual = "02"
|
|
8
|
-
}
|
|
9
|
-
export declare enum Airflow {
|
|
10
|
-
Low = "01",
|
|
11
|
-
Medium = "02",
|
|
12
|
-
High = "03",
|
|
13
|
-
Turbo = "05",
|
|
14
|
-
Sleep = "06"
|
|
15
|
-
}
|
|
16
|
-
export declare enum AirQuality {
|
|
17
|
-
Good = "01",
|
|
18
|
-
Fair = "02",
|
|
19
|
-
Poor = "03"
|
|
20
|
-
}
|
|
21
|
-
export declare enum Plasmawave {
|
|
22
|
-
Off = "0",
|
|
23
|
-
On = "1"
|
|
24
|
-
}
|
|
25
|
-
export interface DeviceStatus {
|
|
26
|
-
power: Power;
|
|
27
|
-
mode: Mode;
|
|
28
|
-
airflow: Airflow;
|
|
29
|
-
airQuality: AirQuality;
|
|
30
|
-
plasmawave: Plasmawave;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/winix/types.ts"],"names":[],"mappings":"AAAA,oBAAY,KAAK;IACf,GAAG,MAAM;IACT,EAAE,MAAM;CACT;AAED,oBAAY,IAAI;IACd,IAAI,OAAO;IACX,MAAM,OAAO;CACd;AAED,oBAAY,OAAO;IACjB,GAAG,OAAO;IACV,MAAM,OAAO;IACb,IAAI,OAAO;IACX,KAAK,OAAO;IACZ,KAAK,OAAO;CACb;AAED,oBAAY,UAAU;IACpB,IAAI,OAAO;IACX,IAAI,OAAO;IACX,IAAI,OAAO;CACZ;AAED,oBAAY,UAAU;IACpB,GAAG,MAAM;IACT,EAAE,MAAM;CACT;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB"}
|
package/dist/winix/types.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Plasmawave = exports.AirQuality = exports.Airflow = exports.Mode = exports.Power = void 0;
|
|
4
|
-
var Power;
|
|
5
|
-
(function (Power) {
|
|
6
|
-
Power["Off"] = "0";
|
|
7
|
-
Power["On"] = "1";
|
|
8
|
-
})(Power = exports.Power || (exports.Power = {}));
|
|
9
|
-
var Mode;
|
|
10
|
-
(function (Mode) {
|
|
11
|
-
Mode["Auto"] = "01";
|
|
12
|
-
Mode["Manual"] = "02";
|
|
13
|
-
})(Mode = exports.Mode || (exports.Mode = {}));
|
|
14
|
-
var Airflow;
|
|
15
|
-
(function (Airflow) {
|
|
16
|
-
Airflow["Low"] = "01";
|
|
17
|
-
Airflow["Medium"] = "02";
|
|
18
|
-
Airflow["High"] = "03";
|
|
19
|
-
Airflow["Turbo"] = "05";
|
|
20
|
-
Airflow["Sleep"] = "06";
|
|
21
|
-
})(Airflow = exports.Airflow || (exports.Airflow = {}));
|
|
22
|
-
var AirQuality;
|
|
23
|
-
(function (AirQuality) {
|
|
24
|
-
AirQuality["Good"] = "01";
|
|
25
|
-
AirQuality["Fair"] = "02";
|
|
26
|
-
AirQuality["Poor"] = "03";
|
|
27
|
-
})(AirQuality = exports.AirQuality || (exports.AirQuality = {}));
|
|
28
|
-
var Plasmawave;
|
|
29
|
-
(function (Plasmawave) {
|
|
30
|
-
Plasmawave["Off"] = "0";
|
|
31
|
-
Plasmawave["On"] = "1";
|
|
32
|
-
})(Plasmawave = exports.Plasmawave || (exports.Plasmawave = {}));
|
|
33
|
-
//# sourceMappingURL=types.js.map
|
package/dist/winix/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/winix/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,kBAAS,CAAA;IACT,iBAAQ,CAAA;AACV,CAAC,EAHW,KAAK,GAAL,aAAK,KAAL,aAAK,QAGhB;AAED,IAAY,IAGX;AAHD,WAAY,IAAI;IACd,mBAAW,CAAA;IACX,qBAAa,CAAA;AACf,CAAC,EAHW,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAGf;AAED,IAAY,OAMX;AAND,WAAY,OAAO;IACjB,qBAAU,CAAA;IACV,wBAAa,CAAA;IACb,sBAAW,CAAA;IACX,uBAAY,CAAA;IACZ,uBAAY,CAAA;AACd,CAAC,EANW,OAAO,GAAP,eAAO,KAAP,eAAO,QAMlB;AAED,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,yBAAW,CAAA;IACX,yBAAW,CAAA;IACX,yBAAW,CAAA;AACb,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,uBAAS,CAAA;IACT,sBAAQ,CAAA;AACV,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"}
|