homebridge-flume 3.1.0 → 3.1.2-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/CHANGELOG.md +19 -41
- package/config.schema.json +41 -20
- package/dist/homebridge/accessory.js +16 -15
- package/dist/homebridge/accessory.js.map +1 -1
- package/dist/homebridge/index.d.ts +0 -3
- package/dist/homebridge/index.js +2 -4
- package/dist/homebridge/index.js.map +1 -1
- package/dist/homebridge/platform.d.ts +4 -8
- package/dist/homebridge/platform.js +31 -37
- package/dist/homebridge/platform.js.map +1 -1
- package/dist/homebridge/settings.d.ts +2 -0
- package/dist/homebridge/settings.js +3 -0
- package/dist/homebridge/settings.js.map +1 -0
- package/dist/homebridge-ui/public/index.html +17 -0
- package/dist/homebridge-ui/public/ui.js +1 -0
- package/dist/homebridge-ui/server.js +8 -2
- package/dist/homebridge-ui/server.js.map +1 -1
- package/dist/i18n/en.d.ts +66 -0
- package/dist/i18n/en.js +72 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/i18n.d.ts +75 -0
- package/dist/i18n/i18n.js +38 -0
- package/dist/i18n/i18n.js.map +1 -0
- package/dist/i18n/template.d.ts +66 -0
- package/dist/i18n/template.js +8 -0
- package/dist/i18n/template.js.map +1 -0
- package/dist/i18n/zz.d.ts +92 -0
- package/dist/i18n/zz.js +32 -0
- package/dist/i18n/zz.js.map +1 -0
- package/dist/model/api.d.ts +3 -4
- package/dist/model/api.js +21 -24
- package/dist/model/api.js.map +1 -1
- package/dist/model/auth.d.ts +4 -2
- package/dist/model/auth.js +30 -18
- package/dist/model/auth.js.map +1 -1
- package/dist/model/device.d.ts +1 -1
- package/dist/tools/storage.d.ts +3 -3
- package/dist/tools/storage.js +21 -18
- package/dist/tools/storage.js.map +1 -1
- package/dist/tools/version.d.ts +1 -0
- package/dist/tools/version.js +18 -0
- package/dist/tools/version.js.map +1 -0
- package/{eslint.config.js → eslint.config.ts} +1 -12
- package/package.json +13 -8
- package/src/homebridge-ui/public/index.html +6 -93
- package/.vscode/settings.json +0 -10
- package/dist/lang/en.d.ts +0 -28
- package/dist/lang/en.js +0 -39
- package/dist/lang/en.js.map +0 -1
- package/src/homebridge/accessory.ts +0 -167
- package/src/homebridge/index.ts +0 -10
- package/src/homebridge/platform.ts +0 -144
- package/src/homebridge-ui/server.ts +0 -10
- package/src/lang/en.ts +0 -44
- package/src/model/api.ts +0 -398
- package/src/model/auth.ts +0 -72
- package/src/model/device.ts +0 -55
- package/src/model/types.ts +0 -69
- package/src/tools/storage.ts +0 -26
- package/src/tools/time.ts +0 -4
- package/tsconfig.json +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
+
### HELP NEEDED!
|
|
2
|
+
|
|
3
|
+
Would you like to see Homebridge Flume in your language? Please consider [getting involved](https://github.com/mpatfield/homebridge-flume/issues/107).
|
|
4
|
+
|
|
1
5
|
# Change Log
|
|
2
6
|
|
|
3
7
|
All notable changes to homebridge-flume will be documented in this file.
|
|
4
8
|
|
|
5
|
-
## 3.1.
|
|
9
|
+
## 3.1.2 (####-##-##)
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
- Dynamic translations
|
|
13
|
+
- Use node-persist for auth token caching
|
|
14
|
+
|
|
15
|
+
## 3.1.1 (2025-06-02)
|
|
6
16
|
|
|
7
17
|
### Added
|
|
18
|
+
- Fetch device name from Flume locations api
|
|
8
19
|
|
|
20
|
+
### Changed
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
23
|
+
## 3.1.0 (2025-05-28)
|
|
24
|
+
|
|
25
|
+
### Added
|
|
9
26
|
- Devices can now be excluded from HomeKit by adding device IDs in config
|
|
10
27
|
- Fetch device name from Flume location information
|
|
11
28
|
- Volume units for usage data can be changed in config
|
|
12
29
|
|
|
13
30
|
### Changed
|
|
14
|
-
|
|
15
31
|
- Persist tokens across launches to avoid unnecessary authentication calls
|
|
16
32
|
- Limit the number of http retries with exponential backoff
|
|
17
33
|
- Beta versions no longer log unless "verbose" config flag is set to true
|
|
@@ -19,57 +35,47 @@ All notable changes to homebridge-flume will be documented in this file.
|
|
|
19
35
|
- Redact all personal info in logs
|
|
20
36
|
|
|
21
37
|
### Fixed
|
|
22
|
-
|
|
23
38
|
- `disableDeviceLogging` actually stops logging accessory changes
|
|
24
39
|
|
|
25
40
|
## 3.0.5 (2025-05-24)
|
|
26
41
|
|
|
27
42
|
### Changed
|
|
28
|
-
|
|
29
|
-
While there are no new features, this release is a major rewrite to cleanup and modernize a lot of very old code. This will make it much easier to maintain and improve this plugin going forward.
|
|
43
|
+
- While there are no new features, this release is a major rewrite to cleanup and modernize a lot of very old code. This will make it much easier to maintain and improve this plugin going forward.
|
|
30
44
|
|
|
31
45
|
## 3.0.4 (2025-05-19)
|
|
32
|
-
|
|
33
46
|
- Updating README and other metadata to reflect new plugin ownership
|
|
34
47
|
- Getting plugin ready for Homebridge v2
|
|
35
48
|
|
|
36
49
|
## 3.0.3 (2024-07-23)
|
|
37
|
-
|
|
38
50
|
- Maintenance release
|
|
39
51
|
|
|
40
52
|
## 3.0.2 (2023-03-24)
|
|
41
53
|
|
|
42
54
|
### Fixed
|
|
43
|
-
|
|
44
55
|
- Debug logging
|
|
45
56
|
|
|
46
57
|
## 3.0.1 (2023-03-11)
|
|
47
58
|
|
|
48
59
|
### Fixed
|
|
49
|
-
|
|
50
60
|
- Put `getLeakInfo()` into debug logging
|
|
51
61
|
|
|
52
62
|
## 3.0.0 (2023-03-11)
|
|
53
63
|
|
|
54
64
|
### Breaking
|
|
55
|
-
|
|
56
65
|
- Remove official support for Node 14
|
|
57
66
|
- Remove option to disable plugin - this is now available in the Homebridge UI
|
|
58
67
|
- Remove option for debug logging - this will be enabled when using a beta version of the plugin
|
|
59
68
|
|
|
60
69
|
### Added
|
|
61
|
-
|
|
62
70
|
- Support for shared devices (thanks [@ssmoss](https://github.com/ssmoss)!)
|
|
63
71
|
|
|
64
72
|
### Changed
|
|
65
|
-
|
|
66
73
|
- Fix a potential login issue that might be terminating the process incorrectly
|
|
67
74
|
- Bump `node` recommended versions to v16.19.1 or v18.15.0
|
|
68
75
|
|
|
69
76
|
## 2.0.9 (2023-01-07)
|
|
70
77
|
|
|
71
78
|
### Changed
|
|
72
|
-
|
|
73
79
|
- Bump `axios` to v1.2.2
|
|
74
80
|
- Bump `homebridge` recommended version to v1.6.0 or v2.0.0-beta
|
|
75
81
|
- Bump `node` recommended versions to v14.21.2 or v16.19.0 or v18.13.0
|
|
@@ -77,7 +83,6 @@ While there are no new features, this release is a major rewrite to cleanup and
|
|
|
77
83
|
## 2.0.8 (2022-10-16)
|
|
78
84
|
|
|
79
85
|
### Changed
|
|
80
|
-
|
|
81
86
|
- Requests for device info will occur less often, meaning requests for leak info can occur more frequently
|
|
82
87
|
- Minimum refresh interval reduced to 1 minute
|
|
83
88
|
- Bump `node` recommended versions to v14.20.1 or v16.18.0 or v18.11.0
|
|
@@ -86,46 +91,39 @@ While there are no new features, this release is a major rewrite to cleanup and
|
|
|
86
91
|
## 2.0.7 (2022-09-25)
|
|
87
92
|
|
|
88
93
|
### Changed
|
|
89
|
-
|
|
90
94
|
- Bump `node` recommended versions to v14.20.1 or v16.17.1
|
|
91
95
|
- Updated dev dependencies
|
|
92
96
|
|
|
93
97
|
## 2.0.6 (2022-08-23)
|
|
94
98
|
|
|
95
99
|
### Changed
|
|
96
|
-
|
|
97
100
|
- Bump `node` recommended versions to v14.20.0 or v16.17.0
|
|
98
101
|
- Bump `homebridge` recommended version to v1.5.0
|
|
99
102
|
|
|
100
103
|
## 2.0.5 (2022-06-26)
|
|
101
104
|
|
|
102
105
|
### Changed
|
|
103
|
-
|
|
104
106
|
- Updated dependencies
|
|
105
107
|
|
|
106
108
|
## 2.0.4 (2022-06-21)
|
|
107
109
|
|
|
108
110
|
### Changed
|
|
109
|
-
|
|
110
111
|
- Bump `node` recommended versions to v14.19.3 or v16.15.1
|
|
111
112
|
|
|
112
113
|
## 2.0.3 (2022-05-28)
|
|
113
114
|
|
|
114
115
|
### Changed
|
|
115
|
-
|
|
116
116
|
- More fixes and refactoring
|
|
117
117
|
|
|
118
118
|
## 2.0.2 (2022-05-28)
|
|
119
119
|
|
|
120
120
|
### Changed
|
|
121
|
-
|
|
122
121
|
- Bump `node` recommended versions to v14.19.3 or v16.15.0
|
|
123
122
|
- Updated dependencies
|
|
124
123
|
|
|
125
124
|
## 2.0.1 (2022-04-30)
|
|
126
125
|
|
|
127
126
|
### Changed
|
|
128
|
-
|
|
129
127
|
- Bump `axios` to v0.27.2
|
|
130
128
|
- Bump `node` recommended versions to v14.19.1 or v16.15.0
|
|
131
129
|
|
|
@@ -137,44 +135,37 @@ While there are no new features, this release is a major rewrite to cleanup and
|
|
|
137
135
|
⚠️ The minimum required version of Node is now v14
|
|
138
136
|
|
|
139
137
|
### Changed
|
|
140
|
-
|
|
141
138
|
- Changed to ESM package
|
|
142
139
|
|
|
143
140
|
## 1.2.7 (2022-04-03)
|
|
144
141
|
|
|
145
142
|
### Changed
|
|
146
|
-
|
|
147
143
|
- Bump `axios` to v0.26.1
|
|
148
144
|
- Updated dependencies
|
|
149
145
|
|
|
150
146
|
## 1.2.6 (2022-02-27)
|
|
151
147
|
|
|
152
148
|
### Changed
|
|
153
|
-
|
|
154
149
|
- Bump `axios` to v0.26.0
|
|
155
150
|
- Bump `node` recommended versions to v14.19.0 or v16.14.0
|
|
156
151
|
|
|
157
152
|
## 1.2.5 (2022-01-24)
|
|
158
153
|
|
|
159
154
|
### Changed
|
|
160
|
-
|
|
161
155
|
- Bump `homebridge` recommended version to v1.4.0
|
|
162
156
|
- Bump `axios` to v0.25.0
|
|
163
157
|
|
|
164
158
|
## 1.2.4 (2022-01-13)
|
|
165
159
|
|
|
166
160
|
### Changed
|
|
167
|
-
|
|
168
161
|
- Bump `node` recommended versions to v14.18.3 or v16.13.2
|
|
169
162
|
|
|
170
163
|
### Fixed
|
|
171
|
-
|
|
172
164
|
- Plugin crash for older versions of Homebridge
|
|
173
165
|
|
|
174
166
|
## 1.2.3 (2022-01-03)
|
|
175
167
|
|
|
176
168
|
### Changed
|
|
177
|
-
|
|
178
169
|
- HOOBS certified badge on README
|
|
179
170
|
- Plugin will log HAPNodeJS version on startup
|
|
180
171
|
- Bump `homebridge` recommended version to v1.3.9
|
|
@@ -182,74 +173,61 @@ While there are no new features, this release is a major rewrite to cleanup and
|
|
|
182
173
|
## 1.2.2 (2021-12-21)
|
|
183
174
|
|
|
184
175
|
### Changed
|
|
185
|
-
|
|
186
176
|
- Some config options rearranged for easier access
|
|
187
177
|
|
|
188
178
|
## 1.2.1 (2021-12-08)
|
|
189
179
|
|
|
190
180
|
### Changed
|
|
191
|
-
|
|
192
181
|
- Bump `homebridge` recommended version to v1.3.8
|
|
193
182
|
- Bump `node` recommended versions to v14.18.2 or v16.13.1
|
|
194
183
|
|
|
195
184
|
## 1.2.0 (2021-12-01)
|
|
196
185
|
|
|
197
186
|
### Added
|
|
198
|
-
|
|
199
187
|
- Previous month usage custom characteristic (viewable in HomeKit apps like Eve)
|
|
200
188
|
|
|
201
189
|
## 1.1.0 (2021-11-30)
|
|
202
190
|
|
|
203
191
|
### Added
|
|
204
|
-
|
|
205
192
|
- Daily and monthly usage custom characteristics (viewable in HomeKit apps like Eve)
|
|
206
193
|
|
|
207
194
|
### Removed
|
|
208
|
-
|
|
209
195
|
- `threshold` configuration option as unused
|
|
210
196
|
|
|
211
197
|
## 1.0.0 (2021-11-29)
|
|
212
198
|
|
|
213
199
|
### Added
|
|
214
|
-
|
|
215
200
|
- Plugin logo
|
|
216
201
|
|
|
217
202
|
## 0.7.0 (2021-11-24)
|
|
218
203
|
|
|
219
204
|
### Added
|
|
220
|
-
|
|
221
205
|
- `StatusFault` and `StatusLowBattery` characteristics to the `LeakSensor` service
|
|
222
206
|
|
|
223
207
|
## 0.6.0 (2021-11-24)
|
|
224
208
|
|
|
225
209
|
### Added
|
|
226
|
-
|
|
227
210
|
- Leak sensor service
|
|
228
211
|
|
|
229
212
|
### Changed
|
|
230
|
-
|
|
231
213
|
- Minimum refresh interval increased to two minutes
|
|
232
214
|
|
|
233
215
|
## 0.5.0 (2021-11-23)
|
|
234
216
|
|
|
235
217
|
### Added
|
|
236
|
-
|
|
237
218
|
- Make use of the debug logging option for HTTP responses
|
|
238
219
|
|
|
239
220
|
### Changed
|
|
240
|
-
|
|
241
221
|
- `client_id` and `client_secret` config options changed to `clientId` and `clientSecret` for consistency
|
|
242
222
|
|
|
243
223
|
## 0.4.0 (2021-11-23)
|
|
244
224
|
|
|
245
225
|
### Added
|
|
246
|
-
|
|
247
226
|
- The plugin will remove 'stale' accessories that don't appear in the obtained device list
|
|
248
227
|
|
|
249
228
|
## 0.3.1 (2021-11-23)
|
|
250
229
|
|
|
251
230
|
### Fixed
|
|
252
|
-
|
|
253
231
|
- Some logging references to Thermobit rather than Flume
|
|
254
232
|
|
|
255
233
|
## 0.3.0 (2021-11-22)
|
package/config.schema.json
CHANGED
|
@@ -3,75 +3,73 @@
|
|
|
3
3
|
"pluginType": "platform",
|
|
4
4
|
"singular": true,
|
|
5
5
|
"customUi": true,
|
|
6
|
-
"customUiPath": "./
|
|
6
|
+
"customUiPath": "./dist/homebridge-ui",
|
|
7
7
|
"schema": {
|
|
8
8
|
"type": "object",
|
|
9
9
|
"required": ["username", "password", "clientId", "clientSecret", "refreshInterval", "units"],
|
|
10
10
|
"properties": {
|
|
11
11
|
"name": {
|
|
12
12
|
"type": "string",
|
|
13
|
-
"title": "Plugin Name",
|
|
14
13
|
"default": "Flume"
|
|
15
14
|
},
|
|
16
15
|
"username": {
|
|
17
16
|
"type": "string",
|
|
18
|
-
"title": "
|
|
17
|
+
"title": "${config.title.username}",
|
|
19
18
|
"required": true
|
|
20
19
|
},
|
|
21
20
|
"password": {
|
|
22
21
|
"type": "string",
|
|
23
|
-
"title": "
|
|
22
|
+
"title": "${config.title.password}",
|
|
24
23
|
"required": true
|
|
25
24
|
},
|
|
26
25
|
"clientId": {
|
|
27
26
|
"type": "string",
|
|
28
|
-
"title": "
|
|
27
|
+
"title": "${config.title.clientId}",
|
|
29
28
|
"placeholder": "1234567890ABCD",
|
|
30
29
|
"required": true
|
|
31
30
|
},
|
|
32
31
|
"clientSecret": {
|
|
33
32
|
"type": "string",
|
|
34
|
-
"title": "
|
|
35
|
-
"description": "
|
|
33
|
+
"title": "${config.title.clientSecret}",
|
|
34
|
+
"description": "${config.description.clientSecret}",
|
|
36
35
|
"placeholder": "1234567890ABCDEFGHIJ",
|
|
37
36
|
"required": true
|
|
38
37
|
},
|
|
39
38
|
"refreshInterval": {
|
|
40
39
|
"type": "integer",
|
|
41
|
-
"title": "
|
|
42
|
-
"description": "
|
|
40
|
+
"title": "${config.title.refreshInterval}",
|
|
41
|
+
"description": "${config.description.refreshInterval}",
|
|
43
42
|
"default": 2,
|
|
44
43
|
"minimum": 1,
|
|
45
44
|
"required": true
|
|
46
45
|
},
|
|
47
46
|
"units": {
|
|
48
47
|
"type": "string",
|
|
49
|
-
"title": "
|
|
50
|
-
"description": "
|
|
48
|
+
"title": "${config.title.units}",
|
|
49
|
+
"description": "${config.description.units}",
|
|
51
50
|
"enum": ["GALLONS", "LITERS", "CUBIC_FEET", "CUBIC_METERS"],
|
|
52
|
-
"enumNames": ["
|
|
51
|
+
"enumNames": ["${config.enumNames.gallons}", "${config.enumNames.liters}", "${config.enumNames.cubicFeet}", "${config.enumNames.cubicMeters}"],
|
|
53
52
|
"default": "GALLONS",
|
|
54
53
|
"required": true
|
|
55
54
|
},
|
|
56
55
|
"disableDeviceLogging": {
|
|
57
56
|
"type": "boolean",
|
|
58
|
-
"title": "
|
|
59
|
-
"description": "
|
|
57
|
+
"title": "${config.title.disableDeviceLogging}",
|
|
58
|
+
"description": "${config.description.disableDeviceLogging}",
|
|
60
59
|
"default": false,
|
|
61
60
|
"required": false
|
|
62
61
|
},
|
|
63
62
|
"verbose": {
|
|
64
63
|
"type": "boolean",
|
|
65
|
-
"title": "
|
|
66
|
-
"description": "
|
|
64
|
+
"title": "${config.title.verbose}",
|
|
65
|
+
"description": "${config.description.verbose}",
|
|
67
66
|
"required": false
|
|
68
67
|
},
|
|
69
68
|
"excludeDevices": {
|
|
70
69
|
"type": "array",
|
|
71
|
-
"title": "
|
|
72
|
-
"description": "
|
|
70
|
+
"title": "${config.title.excludeDevices}",
|
|
71
|
+
"description": "${config.description.excludeDevices}",
|
|
73
72
|
"items": {
|
|
74
|
-
"title": "Device ID",
|
|
75
73
|
"type": "string"
|
|
76
74
|
},
|
|
77
75
|
"uniqueItems": true,
|
|
@@ -79,5 +77,28 @@
|
|
|
79
77
|
"required": false
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
|
-
}
|
|
80
|
+
},
|
|
81
|
+
"layout": [
|
|
82
|
+
{
|
|
83
|
+
"type": "fieldset",
|
|
84
|
+
"items": [
|
|
85
|
+
"username",
|
|
86
|
+
"password",
|
|
87
|
+
"clientId",
|
|
88
|
+
"clientSecret",
|
|
89
|
+
"refreshInterval",
|
|
90
|
+
"units",
|
|
91
|
+
"disableDeviceLogging",
|
|
92
|
+
"verbose",
|
|
93
|
+
{
|
|
94
|
+
"key": "excludeDevices",
|
|
95
|
+
"type": "array",
|
|
96
|
+
"items": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"title": "${config.title.deviceId}"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
83
104
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import strings from '../
|
|
1
|
+
import { strings } from '../i18n/i18n.js';
|
|
2
2
|
import { VolumeUnits } from '../model/types.js';
|
|
3
|
+
import getVersion from '../tools/version.js';
|
|
3
4
|
class CustomCharacteristic {
|
|
4
5
|
uuid;
|
|
5
6
|
name;
|
|
@@ -8,9 +9,9 @@ class CustomCharacteristic {
|
|
|
8
9
|
this.name = name;
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
|
-
const TODAY_USAGE = new CustomCharacteristic('f25cc272-83cb-46a7-915a-259fa17364ed', strings.todayUsage);
|
|
12
|
-
const MONTH_USAGE = new CustomCharacteristic('580e224d-edf2-4c23-af79-cdbebfc509c5', strings.monthUsage);
|
|
13
|
-
const LAST_MONTH_USAGE = new CustomCharacteristic('69129d54-bdb8-46a1-a93b-f7e8d16d32a8', strings.lastMonth);
|
|
12
|
+
const TODAY_USAGE = new CustomCharacteristic('f25cc272-83cb-46a7-915a-259fa17364ed', strings.customChar.todayUsage);
|
|
13
|
+
const MONTH_USAGE = new CustomCharacteristic('580e224d-edf2-4c23-af79-cdbebfc509c5', strings.customChar.monthUsage);
|
|
14
|
+
const LAST_MONTH_USAGE = new CustomCharacteristic('69129d54-bdb8-46a1-a93b-f7e8d16d32a8', strings.customChar.lastMonth);
|
|
14
15
|
export class FlumeAccessory {
|
|
15
16
|
platform;
|
|
16
17
|
accessory;
|
|
@@ -40,12 +41,12 @@ export class FlumeAccessory {
|
|
|
40
41
|
this.Characteristic = this.HAP.Characteristic;
|
|
41
42
|
this.Service = this.HAP.Service;
|
|
42
43
|
accessory.getService(this.Service.AccessoryInformation)
|
|
43
|
-
.setCharacteristic(this.Characteristic.Name, name ?? strings.brand)
|
|
44
|
-
.setCharacteristic(this.Characteristic.ConfiguredName, name ?? strings.brand)
|
|
45
|
-
.setCharacteristic(this.Characteristic.Manufacturer, strings.brand)
|
|
44
|
+
.setCharacteristic(this.Characteristic.Name, name ?? strings.general.brand)
|
|
45
|
+
.setCharacteristic(this.Characteristic.ConfiguredName, name ?? strings.general.brand)
|
|
46
|
+
.setCharacteristic(this.Characteristic.Manufacturer, strings.general.brand)
|
|
46
47
|
.setCharacteristic(this.Characteristic.SerialNumber, device.id)
|
|
47
48
|
.setCharacteristic(this.Characteristic.Model, device.productName)
|
|
48
|
-
.setCharacteristic(this.Characteristic.FirmwareRevision,
|
|
49
|
+
.setCharacteristic(this.Characteristic.FirmwareRevision, getVersion());
|
|
49
50
|
this.charLeakDetected = this.Characteristic.LeakDetected;
|
|
50
51
|
this.charStatusLowBattery = this.Characteristic.StatusLowBattery;
|
|
51
52
|
this.charStatusFault = this.Characteristic.StatusFault;
|
|
@@ -71,19 +72,19 @@ export class FlumeAccessory {
|
|
|
71
72
|
this.isLeakDetected = this.device.isLeakDetected;
|
|
72
73
|
const value = this.isLeakDetected ? this.charLeakDetected.LEAK_DETECTED : this.charLeakDetected.LEAK_NOT_DETECTED;
|
|
73
74
|
this.leakService.updateCharacteristic(this.charLeakDetected, value);
|
|
74
|
-
this.logState(this.isLeakDetected ? "error" /* LogLevel.ERROR */ : "info" /* LogLevel.INFO */, this.isLeakDetected ? strings.leakDetected : strings.leakNotDetected);
|
|
75
|
+
this.logState(this.isLeakDetected ? "error" /* LogLevel.ERROR */ : "info" /* LogLevel.INFO */, this.isLeakDetected ? strings.status.leakDetected : strings.status.leakNotDetected);
|
|
75
76
|
}
|
|
76
77
|
if (this.device.isBatteryLow !== this.isBatteryLow) {
|
|
77
78
|
this.isBatteryLow = this.device.isBatteryLow;
|
|
78
79
|
const value = this.isBatteryLow ? this.charStatusLowBattery.BATTERY_LEVEL_LOW : this.charStatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
79
80
|
this.leakService.updateCharacteristic(this.charStatusLowBattery, value);
|
|
80
|
-
this.logState(this.isBatteryLow ? "warn" /* LogLevel.WARN */ : "info" /* LogLevel.INFO */, this.isBatteryLow ? strings.batteryLow : strings.batteryNormal);
|
|
81
|
+
this.logState(this.isBatteryLow ? "warn" /* LogLevel.WARN */ : "info" /* LogLevel.INFO */, this.isBatteryLow ? strings.status.batteryLow : strings.status.batteryNormal);
|
|
81
82
|
}
|
|
82
83
|
if (this.device.isDisconnected !== this.isDisconnected) {
|
|
83
84
|
this.isDisconnected = this.device.isDisconnected;
|
|
84
85
|
const value = this.isDisconnected ? this.charStatusFault.GENERAL_FAULT : this.charStatusFault.NO_FAULT;
|
|
85
86
|
this.leakService.updateCharacteristic(this.charStatusFault, value);
|
|
86
|
-
this.logState(this.isDisconnected ? "warn" /* LogLevel.WARN */ : "info" /* LogLevel.INFO */, this.isDisconnected ? strings.connectionFault : strings.connectionNormal);
|
|
87
|
+
this.logState(this.isDisconnected ? "warn" /* LogLevel.WARN */ : "info" /* LogLevel.INFO */, this.isDisconnected ? strings.status.connectionFault : strings.status.connectionNormal);
|
|
87
88
|
}
|
|
88
89
|
this.todayUsageChar.updateValue(this.device.usageToday);
|
|
89
90
|
this.monthUsageChar.updateValue(this.device.usageMonth);
|
|
@@ -91,10 +92,10 @@ export class FlumeAccessory {
|
|
|
91
92
|
}
|
|
92
93
|
stringForUnits() {
|
|
93
94
|
switch (this.units) {
|
|
94
|
-
case VolumeUnits.GALLONS: return strings.
|
|
95
|
-
case VolumeUnits.LITERS: return strings.
|
|
96
|
-
case VolumeUnits.CUBIC_FEET: return strings.
|
|
97
|
-
case VolumeUnits.CUBIC_METERS: return strings.
|
|
95
|
+
case VolumeUnits.GALLONS: return strings.config.enumNames.gallons;
|
|
96
|
+
case VolumeUnits.LITERS: return strings.config.enumNames.liters;
|
|
97
|
+
case VolumeUnits.CUBIC_FEET: return strings.config.enumNames.cubicFeet;
|
|
98
|
+
case VolumeUnits.CUBIC_METERS: return strings.config.enumNames.cubicMeters;
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
clearCustomCharacteristics() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../../src/homebridge/accessory.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"accessory.js","sourceRoot":"","sources":["../../src/homebridge/accessory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,UAAU,MAAM,qBAAqB,CAAC;AAE7C,MAAM,oBAAoB;IACH;IAAuB;IAA5C,YAAqB,IAAY,EAAW,IA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/dist/homebridge/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { FlumePlatform
|
|
2
|
-
|
|
3
|
-
* This method registers the platform with Homebridge
|
|
4
|
-
*/
|
|
1
|
+
import { FlumePlatform } from './platform.js';
|
|
2
|
+
import { PLATFORM_ALIAS } from './settings.js';
|
|
5
3
|
export default (api) => {
|
|
6
4
|
api.registerPlatform(PLATFORM_ALIAS, FlumePlatform);
|
|
7
5
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/homebridge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/homebridge/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,eAAe,CAAC,GAAQ,EAAE,EAAE;IAC1B,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AACtD,CAAC,CAAC"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig } from 'homebridge';
|
|
2
|
-
import { Device } from '../model/device.js';
|
|
3
|
-
export declare const PLATFORM_ALIAS = "Flume";
|
|
4
2
|
export declare class FlumePlatform implements DynamicPlatformPlugin {
|
|
5
3
|
readonly log: Logger;
|
|
6
4
|
readonly config: PlatformConfig;
|
|
7
5
|
readonly api: API;
|
|
8
|
-
private readonly storagePath;
|
|
9
6
|
private flumeAPI;
|
|
10
7
|
private readonly accessories;
|
|
11
8
|
constructor(log: Logger, config: PlatformConfig, api: API);
|
|
12
|
-
didFinishLaunching
|
|
13
|
-
shutdown
|
|
14
|
-
|
|
9
|
+
private didFinishLaunching;
|
|
10
|
+
private shutdown;
|
|
11
|
+
private initializeAccessory;
|
|
15
12
|
configureAccessory(accessory: PlatformAccessory): void;
|
|
16
|
-
removeAccessory
|
|
17
|
-
get packageVersion(): string;
|
|
13
|
+
private removeAccessory;
|
|
18
14
|
}
|