@homebridge-plugins/homebridge-smarthq 0.1.0 → 0.2.0-beta.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/.github/npm-version-script-esm.js +85 -0
- package/README.md +6 -26
- package/config.schema.json +69 -66
- package/dishwasher.json +9 -0
- package/dist/devices/{dishwashers.d.ts → dishwasher.d.ts} +4 -7
- package/dist/devices/dishwasher.d.ts.map +1 -0
- package/dist/devices/{dishwashers.js → dishwasher.js} +55 -24
- package/dist/devices/dishwasher.js.map +1 -0
- package/dist/devices/oven.d.ts.map +1 -1
- package/dist/devices/oven.js +4 -4
- package/dist/devices/oven.js.map +1 -1
- package/dist/devices/refrigerator.d.ts +30 -0
- package/dist/devices/refrigerator.d.ts.map +1 -0
- package/dist/devices/refrigerator.js +120 -0
- package/dist/devices/refrigerator.js.map +1 -0
- package/dist/homebridge-ui/public/index.html +30 -154
- package/dist/platform.d.ts +1 -0
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +67 -17
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +25 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js +25 -0
- package/dist/settings.js.map +1 -1
- package/package.json +8 -8
- package/dist/devices/dishwashers.d.ts.map +0 -1
- package/dist/devices/dishwashers.js.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This scripts queries the npm registry to pull out the latest version for a given tag.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import assert from 'node:assert'
|
|
8
|
+
import child_process from 'node:child_process'
|
|
9
|
+
import fs from 'node:fs'
|
|
10
|
+
import process from 'node:process'
|
|
11
|
+
|
|
12
|
+
import semver from 'semver'
|
|
13
|
+
|
|
14
|
+
const BRANCH_VERSION_PATTERN = /^([A-Z]+)-(\d+\.\d+\.\d+)$/i
|
|
15
|
+
|
|
16
|
+
// Load the contents of the package.json file
|
|
17
|
+
const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf8'))
|
|
18
|
+
|
|
19
|
+
const refArgument = process.argv[2]
|
|
20
|
+
const tagArgument = process.argv[3] || 'latest'
|
|
21
|
+
|
|
22
|
+
if (refArgument === null) {
|
|
23
|
+
console.error('ref argument is missing')
|
|
24
|
+
console.error('Usage: npm-version-script-esm.js <ref> [tag]')
|
|
25
|
+
process.exit(1)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Queries the NPM registry for the latest version for the provided tag.
|
|
30
|
+
* @param tag The tag to query for.
|
|
31
|
+
* @returns {string} Returns the version.
|
|
32
|
+
*/
|
|
33
|
+
function getTagVersionFromNpm(tag) {
|
|
34
|
+
try {
|
|
35
|
+
return child_process.execSync(`npm info ${packageJSON.name} version --tag="${tag}"`).toString('utf8').trim()
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error(`Failed to query the npm registry for the latest version for tag: ${tag}`)
|
|
38
|
+
// throw e;
|
|
39
|
+
return '0.0.0'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function desiredTargetVersion(ref) {
|
|
44
|
+
// ref is a GitHub action ref string
|
|
45
|
+
if (ref.startsWith('refs/pull/')) {
|
|
46
|
+
throw new Error('The version script was executed inside a PR!')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
assert(ref.startsWith('refs/heads/'))
|
|
50
|
+
const branchName = ref.slice('refs/heads/'.length)
|
|
51
|
+
|
|
52
|
+
const results = branchName.match(BRANCH_VERSION_PATTERN)
|
|
53
|
+
if (results !== null) {
|
|
54
|
+
if (results[1] !== tagArgument) {
|
|
55
|
+
console.warn(`The base branch name (${results[1]}) differs from the tag name ${tagArgument}`)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return results[2]
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
throw new Error(`Malformed branch name for ref: ${ref}. Can't derive the base version. Use a branch name like: beta-x.x.x or alpha-x.x.x`)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// derive the base version from the branch ref
|
|
65
|
+
const baseVersion = desiredTargetVersion(refArgument)
|
|
66
|
+
|
|
67
|
+
// query the npm registry for the latest version of the provided tag name
|
|
68
|
+
const latestReleasedVersion = getTagVersionFromNpm(tagArgument) // e.g. 0.7.0-beta.12
|
|
69
|
+
const latestReleaseBase = semver.inc(latestReleasedVersion, 'patch') // will produce 0.7.0 (removing the preid, needed for the equality check below)
|
|
70
|
+
|
|
71
|
+
let publishTag
|
|
72
|
+
if (semver.eq(baseVersion, latestReleaseBase)) { // check if we are releasing another version for the latest beta or alpha
|
|
73
|
+
publishTag = latestReleasedVersion // set the current latest beta or alpha to be incremented
|
|
74
|
+
} else {
|
|
75
|
+
publishTag = baseVersion // start of with a new beta or alpha version
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// save the package.json
|
|
79
|
+
packageJSON.version = publishTag
|
|
80
|
+
fs.writeFileSync('package.json', JSON.stringify(packageJSON, null, 2))
|
|
81
|
+
|
|
82
|
+
// perform the same change to the package-lock.json
|
|
83
|
+
const packageLockJSON = JSON.parse(fs.readFileSync('package-lock.json', 'utf8'))
|
|
84
|
+
packageLockJSON.version = publishTag
|
|
85
|
+
fs.writeFileSync('package-lock.json', JSON.stringify(packageLockJSON, null, 2))
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<a href="https://paypal.me/donavanbecker"><img title="donate" src="https://badgen.net/badge/donate/paypal/yellow" ></a>
|
|
11
11
|
|
|
12
12
|
<p>The Homebridge <a href="https://airnow.gove">SmartHQ</a>
|
|
13
|
-
plugin allows
|
|
13
|
+
plugin allows which allows to interact with SmartHQ API.
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
</span>
|
|
@@ -22,31 +22,11 @@ plugin allows you monitor the current AirQuality for your Zip Code from HomeKit
|
|
|
22
22
|
|
|
23
23
|
## Configuration
|
|
24
24
|
|
|
25
|
-
1.
|
|
25
|
+
1. Input Username & Password
|
|
26
|
+
2. Click Save
|
|
27
|
+
3. Restart Homebridge
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
## Supported SmartHQ Features
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
This plugin is in developenet
|
|
30
32
|
|
|
31
|
-
</p>
|
|
32
|
-
|
|
33
|
-
2. Type in your SmartHQ.gov API Key and Zip Code
|
|
34
|
-
3. Click Save
|
|
35
|
-
4. Restart Homebridge
|
|
36
|
-
|
|
37
|
-
## Supported SmartHQ Quality Providers
|
|
38
|
-
|
|
39
|
-
Currently supports AQI Services:
|
|
40
|
-
|
|
41
|
-
- [SmartHQ](https://www.airnow.gov/) which is limited to the USA. A valid ZipCode is required.
|
|
42
|
-
- [Aqicn](https://www.aqicn.org/) which has international support, provided by the [World SmartHQ Quality Index Project](http://waqi.info/).
|
|
43
|
-
|
|
44
|
-
Depending on where exactly you would like to monitor AQI, one service may be more appropriate than the other.
|
|
45
|
-
|
|
46
|
-
## Supported SmartHQ Quality Features
|
|
47
|
-
|
|
48
|
-
This plugin will create an DishWasher element. The Home app works well, but the Eve app seems to show more measurements. Measurements retrieved are PM2.5, PM10, & O3 for SmartHQ. Aqicn adds NO2, SO2, CO...
|
|
49
|
-
|
|
50
|
-
## Thanks
|
|
51
|
-
|
|
52
|
-
Thank you to [ToddGreenfield](https://github.com/ToddGreenfield) for the the work done on the accesorry based plugin [homebridge-airnow](https://github.com/ToddGreenfield/homebridge-airnow/blob/master/README.md).
|
package/config.schema.json
CHANGED
|
@@ -17,20 +17,29 @@
|
|
|
17
17
|
},
|
|
18
18
|
"credentials": {
|
|
19
19
|
"type": "object",
|
|
20
|
-
"
|
|
20
|
+
"properties": {
|
|
21
21
|
"username": {
|
|
22
|
-
"title": "Username",
|
|
23
22
|
"type": "string",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
23
|
+
"title": "Username",
|
|
24
|
+
"placeholder": "apple@icloud.com",
|
|
25
|
+
"format": "email"
|
|
26
26
|
},
|
|
27
27
|
"password": {
|
|
28
|
+
"type": "string",
|
|
28
29
|
"title": "Password",
|
|
30
|
+
"format": "password",
|
|
31
|
+
"placeholder": "***************",
|
|
32
|
+
"x-schema-form": {
|
|
33
|
+
"type": "password"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"notice": {
|
|
37
|
+
"title": "Notice",
|
|
29
38
|
"type": "string",
|
|
30
|
-
"
|
|
31
|
-
"default": ""
|
|
39
|
+
"default": "Keep your username and password a secret!"
|
|
32
40
|
}
|
|
33
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"required": ["email", "password"]
|
|
34
43
|
},
|
|
35
44
|
"devices": {
|
|
36
45
|
"type": "array",
|
|
@@ -61,115 +70,109 @@
|
|
|
61
70
|
"type": "string",
|
|
62
71
|
"required": true,
|
|
63
72
|
"default": "",
|
|
64
|
-
"condition": {
|
|
65
|
-
"functionBody": "return (model.devices && model.devices[arrayIndices].city && model.devices[arrayIndices].zipCode);"
|
|
66
|
-
},
|
|
67
73
|
"oneOf": [
|
|
68
74
|
{
|
|
69
75
|
"title": "Default Logging",
|
|
70
|
-
"enum": [
|
|
71
|
-
""
|
|
72
|
-
]
|
|
76
|
+
"enum": [""]
|
|
73
77
|
},
|
|
74
78
|
{
|
|
75
79
|
"title": "Standard Logging",
|
|
76
|
-
"enum": [
|
|
77
|
-
"standard"
|
|
78
|
-
]
|
|
80
|
+
"enum": ["standard"]
|
|
79
81
|
},
|
|
80
82
|
{
|
|
81
83
|
"title": "No Logging",
|
|
82
|
-
"enum": [
|
|
83
|
-
"none"
|
|
84
|
-
]
|
|
84
|
+
"enum": ["none"]
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"title": "Debug Logging",
|
|
88
|
-
"enum": [
|
|
89
|
-
"debug"
|
|
90
|
-
]
|
|
88
|
+
"enum": ["debug"]
|
|
91
89
|
}
|
|
92
|
-
]
|
|
93
|
-
},
|
|
94
|
-
"hide_device": {
|
|
95
|
-
"title": "Delete Device",
|
|
96
|
-
"type": "boolean",
|
|
97
|
-
"description": "Delete this device from the plugin cache.",
|
|
90
|
+
],
|
|
98
91
|
"condition": {
|
|
99
|
-
"functionBody": "return (model.devices && model.devices[arrayIndices].
|
|
92
|
+
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].id && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].deviceClass === 'Thermostat' || model.options.devices[arrayIndices].deviceClass === 'LeakDetector'));"
|
|
100
93
|
}
|
|
101
94
|
}
|
|
102
|
-
}
|
|
95
|
+
},
|
|
96
|
+
"required": ["id", "configDeviceName", "logging"]
|
|
103
97
|
}
|
|
104
98
|
},
|
|
105
99
|
"options": {
|
|
106
100
|
"type": "object",
|
|
107
|
-
"
|
|
101
|
+
"properties": {
|
|
108
102
|
"refreshRate": {
|
|
109
|
-
"title": "
|
|
103
|
+
"title": "Refresh Rate",
|
|
110
104
|
"type": "number",
|
|
111
|
-
"minimum":
|
|
112
|
-
"placeholder":
|
|
113
|
-
"description": "Indicates the number of seconds between polls of the
|
|
114
|
-
"condition": {
|
|
115
|
-
"functionBody": "return (model.devices && model.devices[arrayIndices].city && model.devices[arrayIndices].zipCode);"
|
|
116
|
-
}
|
|
105
|
+
"minimum": 30,
|
|
106
|
+
"placeholder": 120,
|
|
107
|
+
"description": "Indicates the number of seconds between polls of the Meater service."
|
|
117
108
|
},
|
|
118
109
|
"logging": {
|
|
119
|
-
"title": "
|
|
110
|
+
"title": "Logging Setting",
|
|
120
111
|
"type": "string",
|
|
121
112
|
"required": true,
|
|
122
113
|
"default": "",
|
|
123
|
-
"condition": {
|
|
124
|
-
"functionBody": "return (model.devices && model.devices[arrayIndices].city && model.devices[arrayIndices].zipCode);"
|
|
125
|
-
},
|
|
126
114
|
"oneOf": [
|
|
127
115
|
{
|
|
128
116
|
"title": "Default Logging",
|
|
129
|
-
"enum": [
|
|
130
|
-
""
|
|
131
|
-
]
|
|
117
|
+
"enum": [""]
|
|
132
118
|
},
|
|
133
119
|
{
|
|
134
120
|
"title": "Standard Logging",
|
|
135
|
-
"enum": [
|
|
136
|
-
"standard"
|
|
137
|
-
]
|
|
121
|
+
"enum": ["standard"]
|
|
138
122
|
},
|
|
139
123
|
{
|
|
140
124
|
"title": "No Logging",
|
|
141
|
-
"enum": [
|
|
142
|
-
"none"
|
|
143
|
-
]
|
|
125
|
+
"enum": ["none"]
|
|
144
126
|
},
|
|
145
127
|
{
|
|
146
128
|
"title": "Debug Logging",
|
|
147
|
-
"enum": [
|
|
148
|
-
"debug"
|
|
149
|
-
]
|
|
129
|
+
"enum": ["debug"]
|
|
150
130
|
}
|
|
151
131
|
]
|
|
152
132
|
}
|
|
153
|
-
}
|
|
133
|
+
},
|
|
134
|
+
"required": ["logging"]
|
|
154
135
|
}
|
|
155
136
|
}
|
|
156
137
|
},
|
|
157
138
|
"layout": [
|
|
158
|
-
"credentials.username",
|
|
159
|
-
"credentials.password",
|
|
160
139
|
{
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"type": "tabarray",
|
|
164
|
-
"title": "{{ value || 'New SmartHQ Device' }}",
|
|
140
|
+
"type": "fieldset",
|
|
141
|
+
"title": "SmartHQ Account Info",
|
|
165
142
|
"expandable": true,
|
|
166
143
|
"expanded": false,
|
|
167
|
-
"orderable": false,
|
|
168
144
|
"items": [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
145
|
+
{
|
|
146
|
+
"type": "help",
|
|
147
|
+
"helpvalue": "<h5></h5><em class='primary-text'>This is for Manual Setup Only.</em>"
|
|
148
|
+
},
|
|
149
|
+
"credentials.username",
|
|
150
|
+
"credentials.password"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"type": "fieldset",
|
|
155
|
+
"title": "SmartHQ Device Settings",
|
|
156
|
+
"expandable": true,
|
|
157
|
+
"expanded": false,
|
|
158
|
+
"items": [
|
|
159
|
+
{
|
|
160
|
+
"key": "devices",
|
|
161
|
+
"notitle": true,
|
|
162
|
+
"type": "tabarray",
|
|
163
|
+
"title": "{{ value.configDeviceName || value.id || 'New SmartHQ Device' }}",
|
|
164
|
+
"expandable": true,
|
|
165
|
+
"expanded": false,
|
|
166
|
+
"orderable": false,
|
|
167
|
+
"items": [
|
|
168
|
+
"devices[].configDeviceName",
|
|
169
|
+
"devices[].hide_device",
|
|
170
|
+
"devices[].firmware",
|
|
171
|
+
"devices[].external",
|
|
172
|
+
"devices[].refreshRate",
|
|
173
|
+
"devices[].logging"
|
|
174
|
+
]
|
|
175
|
+
}
|
|
173
176
|
]
|
|
174
177
|
},
|
|
175
178
|
{
|
package/dishwasher.json
ADDED
|
@@ -2,18 +2,15 @@ import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
|
2
2
|
import type { SmartHQPlatform } from '../platform.js';
|
|
3
3
|
import type { devicesConfig, SmartHqContext } from '../settings.js';
|
|
4
4
|
import { deviceBase } from './device.js';
|
|
5
|
-
/**
|
|
6
|
-
* Platform Accessory
|
|
7
|
-
* An instance of this class is created for each accessory your platform registers
|
|
8
|
-
* Each accessory may expose multiple services of different service types.
|
|
9
|
-
*/
|
|
10
5
|
export declare class SmartHQDishWasher extends deviceBase {
|
|
11
6
|
readonly platform: SmartHQPlatform;
|
|
12
7
|
readonly device: SmartHqContext['device'] & devicesConfig;
|
|
13
8
|
private DishWasher;
|
|
14
9
|
SensorUpdateInProgress: boolean;
|
|
15
10
|
deviceStatus: any;
|
|
16
|
-
constructor(platform: SmartHQPlatform, accessory: PlatformAccessory
|
|
11
|
+
constructor(platform: SmartHQPlatform, accessory: PlatformAccessory<SmartHqContext>, device: SmartHqContext['device'] & devicesConfig);
|
|
12
|
+
readErd(erd: string): Promise<string>;
|
|
13
|
+
writeErd(erd: string, value: string | boolean): Promise<undefined>;
|
|
17
14
|
/**
|
|
18
15
|
* Parse the device status from the SmartHQ api
|
|
19
16
|
*/
|
|
@@ -30,4 +27,4 @@ export declare class SmartHQDishWasher extends deviceBase {
|
|
|
30
27
|
updateHomeKitCharacteristics(): Promise<void>;
|
|
31
28
|
apiError(e: any): Promise<void>;
|
|
32
29
|
}
|
|
33
|
-
//# sourceMappingURL=
|
|
30
|
+
//# sourceMappingURL=dishwasher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dishwasher.d.ts","sourceRoot":"","sources":["../../src/devices/dishwasher.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,qBAAa,iBAAkB,SAAQ,UAAU;IAa7C,QAAQ,CAAC,QAAQ,EAAE,eAAe;IAElC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;IAb3D,OAAO,CAAC,UAAU,CAIjB;IAGD,sBAAsB,EAAG,OAAO,CAAA;IAChC,YAAY,EAAE,GAAG,CAAA;gBAGN,QAAQ,EAAE,eAAe,EAClC,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,EACnC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;IAsDrD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMrC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAYnD;;OAEG;IACG,WAAW;IAUjB;;OAEG;IACG,aAAa;IAYb,KAAK,CAAC,EAAE,EAAE,mBAAmB;IAS7B,KAAK,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAW3C;;OAEG;IACG,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { skipWhile } from 'rxjs
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import { interval, skipWhile } from 'rxjs';
|
|
3
|
+
import { ERD_TYPES } from '../settings.js';
|
|
3
4
|
import { deviceBase } from './device.js';
|
|
4
|
-
/**
|
|
5
|
-
* Platform Accessory
|
|
6
|
-
* An instance of this class is created for each accessory your platform registers
|
|
7
|
-
* Each accessory may expose multiple services of different service types.
|
|
8
|
-
*/
|
|
9
5
|
export class SmartHQDishWasher extends deviceBase {
|
|
10
6
|
platform;
|
|
11
7
|
device;
|
|
@@ -18,20 +14,39 @@ export class SmartHQDishWasher extends deviceBase {
|
|
|
18
14
|
super(platform, accessory, device);
|
|
19
15
|
this.platform = platform;
|
|
20
16
|
this.device = device;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
17
|
+
this.debugLog(`Dishwasher Features: ${JSON.stringify(accessory.context.device.features)}`);
|
|
18
|
+
accessory.context.device.features.forEach((feature) => {
|
|
19
|
+
/* [
|
|
20
|
+
"COMMON_V1_CONTROL_LOCK",
|
|
21
|
+
"COMMON_V1_SABBATH",
|
|
22
|
+
"COMMON_V1_SOUND_LEVEL",
|
|
23
|
+
"DISHWASHER_V1_CYCLE_DEFINITIONS",
|
|
24
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_BOTTLE_BLAST_OPTION",
|
|
25
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_DELAY_START",
|
|
26
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_DRY_TEMP_SELECTION",
|
|
27
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_SELECTED_CYCLE",
|
|
28
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_STEAM_OPTION",
|
|
29
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_WASH_TEMP_SELECTION",
|
|
30
|
+
"DISHWASHER_V1_CYCLE_SETTINGS_WASH_ZONE_SELECTION",
|
|
31
|
+
"DISHWASHER_V1_FOUNDATION",
|
|
32
|
+
"DISHWASHER_V1_REMAINING_DELAY_START_TIME",
|
|
33
|
+
"DISHWASHER_V1_REMOTE_CYCLE_CONTROL",
|
|
34
|
+
"DISHWASHER_V1_SERVICE",
|
|
35
|
+
"DISHWASHER_V2_SMART_ASSIST",
|
|
36
|
+
"RESOURCE_MANAGEMENT_V1_ELECTRICAL_ENERGY_USAGE_V2"
|
|
37
|
+
] */
|
|
38
|
+
switch (feature) {
|
|
39
|
+
case 'DISHWASHER_V1_FOUNDATION': {
|
|
40
|
+
const dishwasher = this.accessory.getService(accessory.context.device.nickname)
|
|
41
|
+
|| this.accessory.addService(this.platform.Service.Lightbulb, accessory.context.device.nickname, 'Dishwasher');
|
|
42
|
+
dishwasher
|
|
43
|
+
.getCharacteristic(this.platform.Characteristic.On)
|
|
44
|
+
.onGet(() => this.readErd(ERD_TYPES.DISHWASHER_CYCLE).then(r => Number.parseInt(r) !== 0))
|
|
45
|
+
.onSet(value => this.writeErd(ERD_TYPES.DISHWASHER_CYCLE, value));
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
});
|
|
35
50
|
// this is subject we use to track when we need to POST changes to the SmartHQ API
|
|
36
51
|
this.SensorUpdateInProgress = false;
|
|
37
52
|
// Retrieve initial values and updateHomekit
|
|
@@ -43,13 +58,29 @@ export class SmartHQDishWasher extends deviceBase {
|
|
|
43
58
|
await this.refreshStatus();
|
|
44
59
|
});
|
|
45
60
|
}
|
|
61
|
+
async readErd(erd) {
|
|
62
|
+
const d = await axios
|
|
63
|
+
.get(`/appliance/${this.accessory.context.device.applianceId}/erd/${erd}`);
|
|
64
|
+
return String(d.data.value);
|
|
65
|
+
}
|
|
66
|
+
async writeErd(erd, value) {
|
|
67
|
+
await axios
|
|
68
|
+
.post(`/appliance/${this.accessory.context.device.applianceId}/erd/${erd}`, {
|
|
69
|
+
kind: 'appliance#erdListEntry',
|
|
70
|
+
userId: this.accessory.context.userId,
|
|
71
|
+
applianceId: this.accessory.context.device.applianceId,
|
|
72
|
+
erd,
|
|
73
|
+
value: typeof value === 'boolean' ? (value ? '01' : '00') : value,
|
|
74
|
+
});
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
46
77
|
/**
|
|
47
78
|
* Parse the device status from the SmartHQ api
|
|
48
79
|
*/
|
|
49
80
|
async parseStatus() {
|
|
50
81
|
try {
|
|
51
82
|
// On
|
|
52
|
-
this.DishWasher.On = this.deviceStatus.is_on
|
|
83
|
+
// this.DishWasher.On = this.deviceStatus.is_on
|
|
53
84
|
}
|
|
54
85
|
catch (e) {
|
|
55
86
|
await this.errorLog(`failed to parseStatus, Error Message: ${JSON.stringify(e.message ?? e)}`);
|
|
@@ -62,7 +93,7 @@ export class SmartHQDishWasher extends deviceBase {
|
|
|
62
93
|
async refreshStatus() {
|
|
63
94
|
try {
|
|
64
95
|
// const status = await this.platform.client.getDeviceStatus(this.device.device_id)
|
|
65
|
-
this.deviceStatus = status
|
|
96
|
+
// this.deviceStatus = status
|
|
66
97
|
await this.parseStatus();
|
|
67
98
|
await this.updateHomeKitCharacteristics();
|
|
68
99
|
}
|
|
@@ -102,4 +133,4 @@ export class SmartHQDishWasher extends deviceBase {
|
|
|
102
133
|
this.DishWasher.Service.updateCharacteristic(this.hap.Characteristic.On, e);
|
|
103
134
|
}
|
|
104
135
|
}
|
|
105
|
-
//# sourceMappingURL=
|
|
136
|
+
//# sourceMappingURL=dishwasher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dishwasher.js","sourceRoot":"","sources":["../../src/devices/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AC,QAAQ,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;QAC1F,CAAC;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,IAAI,CAAC;YACH,mFAAmF;YACnF,oCAAoC;YACpC,OAAO,IAAI,CAAC,UAAU,CAAC,EAAE,CAAA;QAC3B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,CAAC,QAAQ,CAAC,mCAAmC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,CAAA;YACxF,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,4EAA+D,CAAA;QAC/G,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,4BAA4B;QAChC,aAAa;QACb,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IAChH,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,CAAM;QAC1B,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;IAC7E,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oven.d.ts","sourceRoot":"","sources":["../../src/devices/oven.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oven.d.ts","sourceRoot":"","sources":["../../src/devices/oven.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAOnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,qBAAa,WAAY,SAAQ,UAAU;IAEvC,QAAQ,CAAC,QAAQ,EAAE,eAAe;IAElC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;gBAFhD,QAAQ,EAAE,eAAe,EAClC,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,EACnC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;IAkDrD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMrC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;CAWpD"}
|
package/dist/devices/oven.js
CHANGED
|
@@ -20,8 +20,8 @@ export class SmartHQOven extends deviceBase {
|
|
|
20
20
|
]; */
|
|
21
21
|
switch (feature) {
|
|
22
22
|
case 'COOKING_V1_UPPER_OVEN_FOUNDATION': {
|
|
23
|
-
const ovenLight = this.accessory.getService(
|
|
24
|
-
|| this.accessory.addService(this.platform.Service.Lightbulb,
|
|
23
|
+
const ovenLight = this.accessory.getService(accessory.context.device.nickname)
|
|
24
|
+
|| this.accessory.addService(this.platform.Service.Lightbulb, accessory.context.device.nickname, 'Oven');
|
|
25
25
|
ovenLight
|
|
26
26
|
.getCharacteristic(this.platform.Characteristic.On)
|
|
27
27
|
.onGet(() => this.readErd(ERD_TYPES.UPPER_OVEN_LIGHT).then(r => Number.parseInt(r) !== 0))
|
|
@@ -29,9 +29,9 @@ export class SmartHQOven extends deviceBase {
|
|
|
29
29
|
break;
|
|
30
30
|
}
|
|
31
31
|
case 'COOKING_V1_EXTENDED_COOKTOP_FOUNDATION': {
|
|
32
|
-
this.accessory.getService(
|
|
32
|
+
this.accessory.getService(accessory.context.device.nickname)
|
|
33
33
|
|| this.accessory
|
|
34
|
-
.addService(this.platform.Service.StatefulProgrammableSwitch,
|
|
34
|
+
.addService(this.platform.Service.StatefulProgrammableSwitch, accessory.context.device.nickname, 'Oven')
|
|
35
35
|
.getCharacteristic(this.platform.Characteristic.TargetTemperature)
|
|
36
36
|
.onGet(async () => {
|
|
37
37
|
const erdVal = await this.readErd(ERD_TYPES.UPPER_OVEN_COOK_MODE);
|
package/dist/devices/oven.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oven.js","sourceRoot":"","sources":["../../src/devices/oven.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oven.js","sourceRoot":"","sources":["../../src/devices/oven.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,OAAO,WAAY,SAAQ,UAAU;IAE9B;IAEA;IAHX,YACW,QAAyB,EAClC,SAA4C,EACnC,MAAgD;QAEzD,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;QAJzB,aAAQ,GAAR,QAAQ,CAAiB;QAEzB,WAAM,GAAN,MAAM,CAA0C;QAGzD,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACpD;;;;;;;iBAOK;YAEL,QAAQ,OAAO,EAAE,CAAC;gBAChB,KAAK,kCAAkC,CAAC,CAAC,CAAC;oBACxC,MAAM,SAAS,GACX,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC;2BAC3D,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAA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E,CAAC,CAAA;QACJ,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAED,SAAS,IAAI,CAAC,OAAe;IAC3B,OAAO,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAA;AAC/B,CAAC;AAED,SAAS,IAAI,CAAC,UAAkB;IAC9B,OAAO,CAAC,CAAC,UAAU,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { CharacteristicValue, PlatformAccessory } from 'homebridge';
|
|
2
|
+
import type { SmartHQPlatform } from '../platform.js';
|
|
3
|
+
import type { devicesConfig, SmartHqContext } from '../settings.js';
|
|
4
|
+
import { deviceBase } from './device.js';
|
|
5
|
+
export declare class SmartHQRefrigerator extends deviceBase {
|
|
6
|
+
readonly platform: SmartHQPlatform;
|
|
7
|
+
readonly device: SmartHqContext['device'] & devicesConfig;
|
|
8
|
+
private Refrigerator;
|
|
9
|
+
SensorUpdateInProgress: boolean;
|
|
10
|
+
deviceStatus: any;
|
|
11
|
+
constructor(platform: SmartHQPlatform, accessory: PlatformAccessory<SmartHqContext>, device: SmartHqContext['device'] & devicesConfig);
|
|
12
|
+
readErd(erd: string): Promise<string>;
|
|
13
|
+
writeErd(erd: string, value: string | boolean): Promise<undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* Parse the device status from the SmartHQ api
|
|
16
|
+
*/
|
|
17
|
+
parseStatus(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Asks the SmartHQ API for the latest device information
|
|
20
|
+
*/
|
|
21
|
+
refreshStatus(): Promise<void>;
|
|
22
|
+
setContactSensorState(ContactSensorState: CharacteristicValue): Promise<void>;
|
|
23
|
+
getContactSensorState(): Promise<CharacteristicValue>;
|
|
24
|
+
/**
|
|
25
|
+
* Updates the status for each of the HomeKit Characteristics
|
|
26
|
+
*/
|
|
27
|
+
updateHomeKitCharacteristics(): Promise<void>;
|
|
28
|
+
apiError(e: any): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=refrigerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refrigerator.d.ts","sourceRoot":"","sources":["../../src/devices/refrigerator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMnE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,qBAAa,mBAAoB,SAAQ,UAAU;IAa/C,QAAQ,CAAC,QAAQ,EAAE,eAAe;IAElC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;IAb3D,OAAO,CAAC,YAAY,CAInB;IAGD,sBAAsB,EAAG,OAAO,CAAA;IAChC,YAAY,EAAE,GAAG,CAAA;gBAGN,QAAQ,EAAE,eAAe,EAClC,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAAC,EACnC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,aAAa;IAsCrD,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMrC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAYnD;;OAEG;IACG,WAAW;IAUjB;;OAEG;IACG,aAAa;IAYb,qBAAqB,CAAC,kBAAkB,EAAE,mBAAmB;IAS7D,qBAAqB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAW3D;;OAEG;IACG,4BAA4B,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtC,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|