@thecloudseeker/homebridge-skoda 0.1.2 → 0.2.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 +14 -0
- package/README.md +44 -22
- package/config.schema.json +25 -6
- package/dist/accessory/services/battery.d.ts +21 -0
- package/dist/accessory/services/battery.js +38 -1
- package/dist/accessory/services/battery.js.map +1 -1
- package/dist/accessory/services/body.d.ts +2 -2
- package/dist/accessory/services/body.js +1 -0
- package/dist/accessory/services/body.js.map +1 -1
- package/dist/accessory/services/charging.js +31 -13
- package/dist/accessory/services/charging.js.map +1 -1
- package/dist/accessory/services/climate.js +51 -23
- package/dist/accessory/services/climate.js.map +1 -1
- package/dist/accessory/services/common.d.ts +8 -5
- package/dist/accessory/services/common.js +13 -8
- package/dist/accessory/services/common.js.map +1 -1
- package/dist/accessory/vehicleAccessory.d.ts +5 -2
- package/dist/accessory/vehicleAccessory.js +32 -5
- package/dist/accessory/vehicleAccessory.js.map +1 -1
- package/dist/api/client.js +6 -4
- package/dist/api/client.js.map +1 -1
- package/dist/config.d.ts +8 -1
- package/dist/config.js +8 -3
- package/dist/config.js.map +1 -1
- package/dist/platform.js +12 -2
- package/dist/platform.js.map +1 -1
- package/dist/vehicle/mapping.d.ts +8 -0
- package/dist/vehicle/mapping.js +23 -0
- package/dist/vehicle/mapping.js.map +1 -1
- package/dist/vehicle/snapshot.js +21 -0
- package/dist/vehicle/snapshot.js.map +1 -1
- package/dist/vehicle/vehicleController.d.ts +31 -5
- package/dist/vehicle/vehicleController.js +80 -11
- package/dist/vehicle/vehicleController.js.map +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
- **Commands cost one request.** HomeKit keeps the expected state until a regular update carries the vehicle's new report of that part, at most 15 minutes, instead of an extra refresh after every command. With the default polling interval, that leaves 8 instead of about 4 commands per hour. `commandRefreshDelaySeconds` now defaults to `0` (no refresh); set it to 15–600 to keep the old behaviour. If you set it explicitly, nothing changes for you.
|
|
6
|
+
- **Controls follow the vehicle more carefully.** A control is removed only when two updates report its operation as unsupported, so a single odd response no longer costs you its room and automations in the Home app. A command the vehicle rejects as unsupported (`operation-not-supported`) removes its control as well. Disabled functions (`operation-disabled`) keep their control.
|
|
7
|
+
- **Fixed:** services added to or removed from a vehicle that was already in HomeKit were only saved to Homebridge's accessory cache on a clean shutdown. They are now saved right away.
|
|
8
|
+
- **Fixed:** a request the vehicle declined (`429 vehicle-not-accepting-requests`) was not counted against the request budget. The API counts it.
|
|
9
|
+
- **Fuel level** for petrol, diesel, CNG and LPG vehicles, as a battery "Fuel" that cannot be charged, with low battery below `lowBatteryThreshold`. It is on by default, so existing combustion vehicles get the new service after the update. An optional humidity sensor "Fuel Level" mirrors it for automations, also for plug-in hybrids (`features.fuelLevelSensor`).
|
|
10
|
+
- **Lights** as an optional contact sensor, open while the lights are on (`features.lights`).
|
|
11
|
+
- The log shows at startup how many requests per hour polling uses and how many are left for commands.
|
|
12
|
+
|
|
13
|
+
## 0.1.3
|
|
14
|
+
|
|
15
|
+
- The author link on npm points to [eikedreier.com](https://eikedreier.com/).
|
|
16
|
+
|
|
3
17
|
## 0.1.2
|
|
4
18
|
|
|
5
19
|
- **Fixed:** while pairing, the Home app could replace the sensor names with generic ones ("Contact Sensor 2"). A new vehicle was published to HomeKit before its sensors existed, so they were added during pairing. Now a new vehicle is published once the first update has created all its sensors. If your sensors already have generic names, remove the bridge from the Home app and pair it again.
|
package/README.md
CHANGED
|
@@ -17,12 +17,17 @@ air conditioning, auxiliary heating, "at home" detection, doors, windows and loc
|
|
|
17
17
|
## Features
|
|
18
18
|
|
|
19
19
|
Each vehicle becomes one HomeKit accessory. A service is only created if it is enabled in the
|
|
20
|
-
config **and** the vehicle reports that it supports it.
|
|
20
|
+
config **and** the vehicle reports that it supports it. For the controls, that is the list of
|
|
21
|
+
remote operations the API reports for the vehicle. If two updates report a control as no longer
|
|
22
|
+
supported, or the vehicle rejects a command as unsupported, the service is removed. A single odd
|
|
23
|
+
update or an unreachable API never removes services.
|
|
21
24
|
|
|
22
25
|
| HomeKit service | Shows | Controls | Default |
|
|
23
26
|
| ---------------------------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------- | ------- |
|
|
24
27
|
| Battery | State of charge, charging state, low battery below a threshold | – | on |
|
|
25
28
|
| Humidity sensor "State of Charge" | State of charge in %, so you can build automations on it | – | off |
|
|
29
|
+
| Battery "Fuel" | Fuel level, low below the threshold (petrol, diesel, CNG, LPG) | – | on |
|
|
30
|
+
| Humidity sensor "Fuel Level" | Fuel level in %, so you can build automations on it | – | off |
|
|
26
31
|
| Outlet "Charging" | _On_ = charging, _Outlet In Use_ = cable plugged in | Start / stop charging | on |
|
|
27
32
|
| Lightbulb "Charge Limit" | Brightness = charging limit (50–100 % in steps of 10) | Set charging limit | on |
|
|
28
33
|
| Heater Cooler "Climate" | Active, heating / cooling, target temperature | Start / stop air conditioning, set temperature | on |
|
|
@@ -31,6 +36,9 @@ config **and** the vehicle reports that it supports it.
|
|
|
31
36
|
| Occupancy sensor "Home" | Parked within a radius around your home | – | on |
|
|
32
37
|
| Contact sensors "Doors", "Windows", "Trunk", "Bonnet", "Sunroof" | Open / closed | – | on |
|
|
33
38
|
| Contact sensor "Locked" | Closed = locked, open = unlocked | – (the API cannot lock or unlock) | on |
|
|
39
|
+
| Contact sensor "Lights" | Open = lights on | – | off |
|
|
40
|
+
|
|
41
|
+
HomeKit has no services for range or mileage, so the plugin does not show them.
|
|
34
42
|
|
|
35
43
|
What the API does **not** offer, and therefore this plugin neither: locking and unlocking, honking
|
|
36
44
|
and flashing, waking the vehicle up, cabin temperature, and push updates.
|
|
@@ -52,8 +60,15 @@ and flashing, waking the vehicle up, cabin temperature, and push updates.
|
|
|
52
60
|
therefore always shows the reported state: after you switch it on in HomeKit it returns to _off_
|
|
53
61
|
once the vehicle has accepted the start (see the log), and it shows _on_ when the ventilation
|
|
54
62
|
was started in the app.
|
|
63
|
+
- **Fuel.** HomeKit has no fuel service, so combustion vehicles show their fuel level as a battery
|
|
64
|
+
that cannot be charged. Low battery uses `lowBatteryThreshold`. Plug-in hybrids keep the
|
|
65
|
+
high-voltage battery in the battery service; their fuel level is available as the "Fuel Level"
|
|
66
|
+
humidity sensor.
|
|
55
67
|
- **Lock.** Exposed as a read-only contact sensor rather than a lock, because the API cannot
|
|
56
68
|
lock or unlock. A lock tile in the Home app would suggest otherwise.
|
|
69
|
+
- **Expected state after a command.** HomeKit shows the expected state right away and keeps it
|
|
70
|
+
until the vehicle reports that part again, at most 15 minutes. If the vehicle reports something
|
|
71
|
+
else, for example because charging could not start, HomeKit shows what the vehicle reports.
|
|
57
72
|
- **Stale data.** If the last successful update is older than three polling intervals, the sensors
|
|
58
73
|
show a fault (_StatusFault_). Battery, outlet, switches and the heater cooler have no fault
|
|
59
74
|
indicator in HomeKit.
|
|
@@ -117,22 +132,22 @@ The easiest way is the Homebridge UI. In `config.json` it looks like this:
|
|
|
117
132
|
}
|
|
118
133
|
```
|
|
119
134
|
|
|
120
|
-
| Option | Default | Description
|
|
121
|
-
| ------------------------------------- | ----------------------- |
|
|
122
|
-
| `name` | `Škoda <last 4 of VIN>` | Accessory name in HomeKit
|
|
123
|
-
| `vin` | – | Vehicle identification number (required)
|
|
124
|
-
| `token` | – | API key (required)
|
|
125
|
-
| `commandToken` | – | Separate API key for commands
|
|
126
|
-
| `spin` | – | S-PIN, only needed for the auxiliary heating
|
|
127
|
-
| `home.lat`, `home.lon` | – | Home coordinates for the "Home" sensor
|
|
128
|
-
| `home.radiusMeters` | `150` | Radius around home, at least 10 m
|
|
129
|
-
| `pollingIntervalMinutes` | `5` | Polling interval, at least 4 (see below)
|
|
130
|
-
| `commandRefreshDelaySeconds` | `
|
|
131
|
-
| `lowBatteryThreshold` | `20` | Low battery below this state of charge (%)
|
|
132
|
-
| `climateTemperature` | `21` | Cabin temperature (°C) until the vehicle reports one
|
|
133
|
-
| `airConditioningWithoutExternalPower` | – | Allow air conditioning on battery; unset keeps the vehicle setting
|
|
134
|
-
| `auxiliaryHeatingDurationMinutes` | – | Auxiliary heating run time; unset keeps the vehicle setting
|
|
135
|
-
| `features.*` | see table above | `battery`, `stateOfChargeSensor`, `charging`, `chargingLimit`, `climate`, `auxiliaryHeating`, `activeVentilation`, `presence`, `doors`, `windows`, `trunk`, `bonnet`, `sunroof`, `lock` |
|
|
135
|
+
| Option | Default | Description |
|
|
136
|
+
| ------------------------------------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
137
|
+
| `name` | `Škoda <last 4 of VIN>` | Accessory name in HomeKit |
|
|
138
|
+
| `vin` | – | Vehicle identification number (required) |
|
|
139
|
+
| `token` | – | API key (required) |
|
|
140
|
+
| `commandToken` | – | Separate API key for commands |
|
|
141
|
+
| `spin` | – | S-PIN, only needed for the auxiliary heating |
|
|
142
|
+
| `home.lat`, `home.lon` | – | Home coordinates for the "Home" sensor |
|
|
143
|
+
| `home.radiusMeters` | `150` | Radius around home, at least 10 m |
|
|
144
|
+
| `pollingIntervalMinutes` | `5` | Polling interval, at least 4 (see below) |
|
|
145
|
+
| `commandRefreshDelaySeconds` | `0` | Extra refresh after a command, in seconds (15–600); `0` = none |
|
|
146
|
+
| `lowBatteryThreshold` | `20` | Low battery below this state of charge or fuel level (%) |
|
|
147
|
+
| `climateTemperature` | `21` | Cabin temperature (°C) until the vehicle reports one |
|
|
148
|
+
| `airConditioningWithoutExternalPower` | – | Allow air conditioning on battery; unset keeps the vehicle setting |
|
|
149
|
+
| `auxiliaryHeatingDurationMinutes` | – | Auxiliary heating run time; unset keeps the vehicle setting |
|
|
150
|
+
| `features.*` | see table above | `battery`, `stateOfChargeSensor`, `fuelLevel`, `fuelLevelSensor`, `charging`, `chargingLimit`, `climate`, `auxiliaryHeating`, `activeVentilation`, `presence`, `doors`, `windows`, `trunk`, `bonnet`, `sunroof`, `lock`, `lights` |
|
|
136
151
|
|
|
137
152
|
## Rate limit
|
|
138
153
|
|
|
@@ -144,11 +159,14 @@ The plugin is built around that limit:
|
|
|
144
159
|
|
|
145
160
|
- **One request per update.** A single call returns all vehicle data.
|
|
146
161
|
- **HomeKit never triggers requests.** Opening the Home app reads from the plugin's cache.
|
|
147
|
-
- **Four requests per hour stay free** for commands
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
- **
|
|
151
|
-
|
|
162
|
+
- **Four requests per hour stay free** for commands. That makes 4 minutes the shortest polling
|
|
163
|
+
interval; shorter values are raised with a warning. The default of 5 minutes uses 12 requests
|
|
164
|
+
per hour and leaves 8 for commands. The log shows this split at startup.
|
|
165
|
+
- **A command costs one request.** The vehicle reports new state with a delay, so instead of an
|
|
166
|
+
extra refresh the plugin keeps the expected state until a regular update carries the vehicle's
|
|
167
|
+
new report. If you want a quicker confirmation, set `commandRefreshDelaySeconds` (15–600): the
|
|
168
|
+
plugin then refreshes once that long after a command, and several commands in a row share one
|
|
169
|
+
refresh. Each refresh costs one more request.
|
|
152
170
|
- **When the budget is used up**, commands are rejected ("No Response" in the Home app) instead of
|
|
153
171
|
being sent, and polling waits until requests are available again.
|
|
154
172
|
- **Errors back off.** On `429` and `503` the plugin waits for `Retry-After`. On other server and
|
|
@@ -175,6 +193,7 @@ suggests, and a command may take a minute or two to show up.
|
|
|
175
193
|
| `rate limit budget exhausted` | Too many commands in the last hour; try again later |
|
|
176
194
|
| `the vehicle declined the request` | The vehicle refused for now (e.g. low battery); try again later |
|
|
177
195
|
| `this function is currently disabled for the vehicle` | Enable the service for the vehicle in the MyŠkoda app |
|
|
196
|
+
| `The vehicle does not support …` | The vehicle rejected the command; its control is removed |
|
|
178
197
|
|
|
179
198
|
## Development
|
|
180
199
|
|
|
@@ -188,6 +207,9 @@ npm run build
|
|
|
188
207
|
|
|
189
208
|
The tests mock the API completely and contain no real keys or vehicle data.
|
|
190
209
|
|
|
210
|
+
Upstream changes worth following (the API, the Python library and the Home Assistant integration)
|
|
211
|
+
are listed in [MAINTAINING.md](MAINTAINING.md).
|
|
212
|
+
|
|
191
213
|
## License
|
|
192
214
|
|
|
193
215
|
[BSD 3-Clause](LICENSE)
|
package/config.schema.json
CHANGED
|
@@ -75,22 +75,23 @@
|
|
|
75
75
|
"minimum": 4,
|
|
76
76
|
"maximum": 1440,
|
|
77
77
|
"placeholder": 5,
|
|
78
|
-
"description": "Minimum 4: 20 requests per hour minus 4 kept free for commands
|
|
78
|
+
"description": "Minimum 4: 20 requests per hour minus 4 kept free for commands."
|
|
79
79
|
},
|
|
80
80
|
"commandRefreshDelaySeconds": {
|
|
81
81
|
"title": "Refresh after command (seconds)",
|
|
82
82
|
"type": "integer",
|
|
83
|
-
"minimum":
|
|
83
|
+
"minimum": 0,
|
|
84
84
|
"maximum": 600,
|
|
85
|
-
"placeholder":
|
|
86
|
-
"description": "
|
|
85
|
+
"placeholder": 0,
|
|
86
|
+
"description": "0 (default): no extra request, the next regular update confirms a command. Otherwise the delay (15-600) before one extra refresh after a command."
|
|
87
87
|
},
|
|
88
88
|
"lowBatteryThreshold": {
|
|
89
89
|
"title": "Low battery threshold (%)",
|
|
90
90
|
"type": "integer",
|
|
91
91
|
"minimum": 0,
|
|
92
92
|
"maximum": 100,
|
|
93
|
-
"placeholder": 20
|
|
93
|
+
"placeholder": 20,
|
|
94
|
+
"description": "Battery or fuel level below which HomeKit reports low battery."
|
|
94
95
|
},
|
|
95
96
|
"climateTemperature": {
|
|
96
97
|
"title": "Default cabin temperature (°C)",
|
|
@@ -127,6 +128,16 @@
|
|
|
127
128
|
"type": "boolean",
|
|
128
129
|
"default": false
|
|
129
130
|
},
|
|
131
|
+
"fuelLevel": {
|
|
132
|
+
"title": "Fuel level as battery (combustion vehicles)",
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"default": true
|
|
135
|
+
},
|
|
136
|
+
"fuelLevelSensor": {
|
|
137
|
+
"title": "Fuel level as humidity sensor (for automations)",
|
|
138
|
+
"type": "boolean",
|
|
139
|
+
"default": false
|
|
140
|
+
},
|
|
130
141
|
"charging": {
|
|
131
142
|
"title": "Charging (outlet)",
|
|
132
143
|
"type": "boolean",
|
|
@@ -186,6 +197,11 @@
|
|
|
186
197
|
"title": "Locked (read-only)",
|
|
187
198
|
"type": "boolean",
|
|
188
199
|
"default": true
|
|
200
|
+
},
|
|
201
|
+
"lights": {
|
|
202
|
+
"title": "Lights (open = on)",
|
|
203
|
+
"type": "boolean",
|
|
204
|
+
"default": false
|
|
189
205
|
}
|
|
190
206
|
}
|
|
191
207
|
}
|
|
@@ -267,6 +283,8 @@
|
|
|
267
283
|
"items": [
|
|
268
284
|
"vehicles[].features.battery",
|
|
269
285
|
"vehicles[].features.stateOfChargeSensor",
|
|
286
|
+
"vehicles[].features.fuelLevel",
|
|
287
|
+
"vehicles[].features.fuelLevelSensor",
|
|
270
288
|
"vehicles[].features.charging",
|
|
271
289
|
"vehicles[].features.chargingLimit",
|
|
272
290
|
"vehicles[].features.climate",
|
|
@@ -278,7 +296,8 @@
|
|
|
278
296
|
"vehicles[].features.trunk",
|
|
279
297
|
"vehicles[].features.bonnet",
|
|
280
298
|
"vehicles[].features.sunroof",
|
|
281
|
-
"vehicles[].features.lock"
|
|
299
|
+
"vehicles[].features.lock",
|
|
300
|
+
"vehicles[].features.lights"
|
|
282
301
|
]
|
|
283
302
|
}
|
|
284
303
|
]
|
|
@@ -18,3 +18,24 @@ export declare class StateOfChargeSensorBinding extends ServiceBinding {
|
|
|
18
18
|
protected get hasStatusFault(): boolean;
|
|
19
19
|
protected render(_service: Service, vehicle: Vehicle): void;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Battery service for combustion vehicles: the level is the fuel level, low below the configured
|
|
23
|
+
* threshold. HomeKit has no fuel service; hybrids show their high-voltage battery instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare class FuelBinding extends ServiceBinding {
|
|
26
|
+
readonly feature = "fuelLevel";
|
|
27
|
+
protected readonly serviceType: ServiceType;
|
|
28
|
+
protected readonly subtype = "fuel";
|
|
29
|
+
protected readonly displayName = "Fuel";
|
|
30
|
+
protected configure(service: Service): void;
|
|
31
|
+
protected render(_service: Service, vehicle: Vehicle): void;
|
|
32
|
+
}
|
|
33
|
+
/** Humidity sensor that mirrors the fuel level, because HomeKit cannot trigger on battery levels. */
|
|
34
|
+
export declare class FuelLevelSensorBinding extends ServiceBinding {
|
|
35
|
+
readonly feature = "fuelLevelSensor";
|
|
36
|
+
protected readonly serviceType: ServiceType;
|
|
37
|
+
protected readonly subtype = "fuel-level";
|
|
38
|
+
protected readonly displayName = "Fuel Level";
|
|
39
|
+
protected get hasStatusFault(): boolean;
|
|
40
|
+
protected render(_service: Service, vehicle: Vehicle): void;
|
|
41
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { batteryValues, stateOfCharge } from "../../vehicle/mapping.js";
|
|
1
|
+
import { batteryValues, fuelLevel, fuelValues, stateOfCharge, } from "../../vehicle/mapping.js";
|
|
2
2
|
import { ServiceBinding } from "./common.js";
|
|
3
3
|
/** Battery: level, charging state and low battery below the configured threshold. */
|
|
4
4
|
export class BatteryBinding extends ServiceBinding {
|
|
@@ -33,4 +33,41 @@ export class StateOfChargeSensorBinding extends ServiceBinding {
|
|
|
33
33
|
this.set(this.ctx.hap.Characteristic.CurrentRelativeHumidity, stateOfCharge(vehicle));
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Battery service for combustion vehicles: the level is the fuel level, low below the configured
|
|
38
|
+
* threshold. HomeKit has no fuel service; hybrids show their high-voltage battery instead.
|
|
39
|
+
*/
|
|
40
|
+
export class FuelBinding extends ServiceBinding {
|
|
41
|
+
feature = "fuelLevel";
|
|
42
|
+
serviceType = this.ctx.hap.Service.Battery;
|
|
43
|
+
subtype = "fuel";
|
|
44
|
+
displayName = "Fuel";
|
|
45
|
+
configure(service) {
|
|
46
|
+
const { ChargingState } = this.ctx.hap.Characteristic;
|
|
47
|
+
service.updateCharacteristic(ChargingState, ChargingState.NOT_CHARGEABLE);
|
|
48
|
+
}
|
|
49
|
+
render(_service, vehicle) {
|
|
50
|
+
const { BatteryLevel, StatusLowBattery } = this.ctx.hap.Characteristic;
|
|
51
|
+
const values = fuelValues(vehicle, this.ctx.settings.lowBatteryThreshold);
|
|
52
|
+
this.set(BatteryLevel, values.level);
|
|
53
|
+
if (values.low !== undefined) {
|
|
54
|
+
this.set(StatusLowBattery, values.low
|
|
55
|
+
? StatusLowBattery.BATTERY_LEVEL_LOW
|
|
56
|
+
: StatusLowBattery.BATTERY_LEVEL_NORMAL);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/** Humidity sensor that mirrors the fuel level, because HomeKit cannot trigger on battery levels. */
|
|
61
|
+
export class FuelLevelSensorBinding extends ServiceBinding {
|
|
62
|
+
feature = "fuelLevelSensor";
|
|
63
|
+
serviceType = this.ctx.hap.Service.HumiditySensor;
|
|
64
|
+
subtype = "fuel-level";
|
|
65
|
+
displayName = "Fuel Level";
|
|
66
|
+
get hasStatusFault() {
|
|
67
|
+
return true;
|
|
68
|
+
}
|
|
69
|
+
render(_service, vehicle) {
|
|
70
|
+
this.set(this.ctx.hap.Characteristic.CurrentRelativeHumidity, fuelLevel(vehicle));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
36
73
|
//# sourceMappingURL=battery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../src/accessory/services/battery.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"battery.js","sourceRoot":"","sources":["../../../src/accessory/services/battery.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,cAAc,EAAoB,MAAM,aA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G;AACrG,MAAM,OAAO,sBAAuB,SAAQ,cAAc;IAC/C,OAAO,GAAG,iBAAiB,CAAC;IAClB,WAAW,GAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC;IACnB,OAAO,GAAG,YAAY,CAAC;IACvB,WAAW,GAAG,YAAY,CAAC;IAE9C,IAAuB,cAAc;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAES,MAAM,CAAC,QAAiB,EAAE,OAAgB;QAClD,IAAI,CAAC,GAAG,CACN,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,uBAAuB,EACnD,SAAS,CAAC,OAAO,CAAC,CACnB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -3,11 +3,11 @@ import type { Vehicle } from "../../api/types.js";
|
|
|
3
3
|
import type { FeatureToggles } from "../../config.js";
|
|
4
4
|
import { type BodyValues } from "../../vehicle/mapping.js";
|
|
5
5
|
import { ServiceBinding, type BindingContext, type ServiceType } from "./common.js";
|
|
6
|
-
type BodyFeature = Extract<keyof FeatureToggles, "doors" | "windows" | "trunk" | "bonnet" | "sunroof" | "lock">;
|
|
6
|
+
type BodyFeature = Extract<keyof FeatureToggles, "doors" | "windows" | "trunk" | "bonnet" | "sunroof" | "lock" | "lights">;
|
|
7
7
|
interface ContactDefinition {
|
|
8
8
|
feature: BodyFeature;
|
|
9
9
|
displayName: string;
|
|
10
|
-
/** `true` means "contact not detected"
|
|
10
|
+
/** `true` means "contact not detected": open, unlocked for the lock sensor, on for the lights. */
|
|
11
11
|
isOpen: (values: BodyValues) => boolean | undefined;
|
|
12
12
|
}
|
|
13
13
|
export declare class ContactBinding extends ServiceBinding {
|
|
@@ -12,6 +12,7 @@ const CONTACTS = [
|
|
|
12
12
|
displayName: "Locked",
|
|
13
13
|
isOpen: (v) => (v.locked === undefined ? undefined : !v.locked),
|
|
14
14
|
},
|
|
15
|
+
{ feature: "lights", displayName: "Lights", isOpen: (v) => v.lightsOn },
|
|
15
16
|
];
|
|
16
17
|
export class ContactBinding extends ServiceBinding {
|
|
17
18
|
definition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/accessory/services/body.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,UAAU,EACV,QAAQ,GAET,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,GAGf,MAAM,aAAa,CAAC;AAcrB,MAAM,QAAQ,GAAiC;IAC7C,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE;IACtE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;IAC5E,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE;IACtE,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE;IACzE,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE;IAC5E,2FAA2F;IAC3F;QACE,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,QAAQ;QACrB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;KAChE;
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/accessory/services/body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;IACjB,WAAW,GAAG,MAAM,CAAC;IAExC,IAAuB,cAAc;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAES,MAAM,CAAC,QAAiB,EAAE,OAAgB;QAClD,MAAM,IAAI,GAA6B,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;QAC9D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO;QACT,CAAC;QACD,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACvC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,GAAG,CACN,iBAAiB,EACjB,MAAM;gBACJ,CAAC,CAAC,iBAAiB,CAAC,kBAAkB;gBACtC,CAAC,CAAC,iBAAiB,CAAC,sBAAsB,CAC7C,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
|
|
@@ -12,16 +12,28 @@ export class ChargingBinding extends ServiceBinding {
|
|
|
12
12
|
.getCharacteristic(this.ctx.hap.Characteristic.On)
|
|
13
13
|
.onSet(async (value) => {
|
|
14
14
|
if (value === true) {
|
|
15
|
-
await this.command("Start charging", (client) => client.startCharging(),
|
|
16
|
-
|
|
15
|
+
await this.command("Start charging", (client) => client.startCharging(), {
|
|
16
|
+
operations: ["startCharging"],
|
|
17
|
+
optimistic: {
|
|
18
|
+
part: "charging",
|
|
19
|
+
apply: (vehicle) => {
|
|
20
|
+
patchChargingStatus(vehicle, { state: "CHARGING" });
|
|
21
|
+
},
|
|
22
|
+
},
|
|
17
23
|
});
|
|
18
24
|
}
|
|
19
25
|
else {
|
|
20
|
-
await this.command("Stop charging", (client) => client.stopCharging(),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
await this.command("Stop charging", (client) => client.stopCharging(), {
|
|
27
|
+
operations: ["stopCharging"],
|
|
28
|
+
optimistic: {
|
|
29
|
+
part: "charging",
|
|
30
|
+
apply: (vehicle) => {
|
|
31
|
+
patchChargingStatus(vehicle, {
|
|
32
|
+
state: "READY_FOR_CHARGING",
|
|
33
|
+
chargePowerInKw: 0,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
},
|
|
25
37
|
});
|
|
26
38
|
}
|
|
27
39
|
});
|
|
@@ -43,12 +55,18 @@ export class ChargingLimitBinding extends ServiceBinding {
|
|
|
43
55
|
subtype = "charging-limit";
|
|
44
56
|
displayName = "Charge Limit";
|
|
45
57
|
sendLimit = debounce(SLIDER_DEBOUNCE_MS, (percent) => {
|
|
46
|
-
this.command(`Set charging limit to ${percent} %`, (client) => client.setChargingLimit(percent),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
this.command(`Set charging limit to ${percent} %`, (client) => client.setChargingLimit(percent), {
|
|
59
|
+
operations: ["setChargingLimit"],
|
|
60
|
+
optimistic: {
|
|
61
|
+
part: "charging",
|
|
62
|
+
apply: (vehicle) => {
|
|
63
|
+
vehicle.charging ??= { isVehicleInSavedLocation: false };
|
|
64
|
+
vehicle.charging.settings = {
|
|
65
|
+
...vehicle.charging.settings,
|
|
66
|
+
targetStateOfChargeInPercent: percent,
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
},
|
|
52
70
|
}).catch(() => {
|
|
53
71
|
// Already logged and reverted.
|
|
54
72
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"charging.js","sourceRoot":"","sources":["../../../src/accessory/services/charging.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,UAAU,EACV,eAAe,EACf,sBAAsB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,cAAc,EACd,QAAQ,EACR,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AAErB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAEhC,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,CAAC,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;YACxE,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO;aACJ,iBAAiB,CAAC,UAAU,CAAC;aAC7B,KAAK,CAAC,CAAC,KAA0B,EAAE,EAAE;YACpC,MAAM,OAAO,GAAG,sBAAsB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACtD,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;gBACtB,UAAU,CACR,GAAG,EAAE,CAAC,OAAO,CAAC,oBAAoB,CAAC,UAAU,EAAE,OAAO,CAAC,EACvD,GAAG,CACJ,CAAC,KAAK,EAAE,CAAC;YACZ,CAAC;YACD,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;IACP,CAAC;IAES,MAAM,CAAC,QAAiB,EAAE,OAAgB;QAClD,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;QACvD,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -44,10 +44,16 @@ export class ClimateBinding extends ServiceBinding {
|
|
|
44
44
|
await this.start();
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
await this.command("Stop air conditioning", (client) => client.stopAirConditioning(),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
await this.command("Stop air conditioning", (client) => client.stopAirConditioning(), {
|
|
48
|
+
operations: ["stopAirConditioning"],
|
|
49
|
+
optimistic: {
|
|
50
|
+
part: "airConditioning",
|
|
51
|
+
apply: (vehicle) => {
|
|
52
|
+
if (vehicle.airConditioning) {
|
|
53
|
+
vehicle.airConditioning.state = "OFF";
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
},
|
|
51
57
|
});
|
|
52
58
|
}
|
|
53
59
|
});
|
|
@@ -108,13 +114,19 @@ export class ClimateBinding extends ServiceBinding {
|
|
|
108
114
|
...(airConditioningWithoutExternalPower === undefined
|
|
109
115
|
? {}
|
|
110
116
|
: { airConditioningWithoutExternalPower }),
|
|
111
|
-
}),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
}), {
|
|
118
|
+
operations: ["startAirConditioning"],
|
|
119
|
+
optimistic: {
|
|
120
|
+
part: "airConditioning",
|
|
121
|
+
apply: (vehicle) => {
|
|
122
|
+
// Heating or cooling is not known until the vehicle reports back.
|
|
123
|
+
vehicle.airConditioning = {
|
|
124
|
+
...vehicle.airConditioning,
|
|
125
|
+
state: "VENTILATION",
|
|
126
|
+
targetTemperature: { value: celsius, unit: "CELSIUS" },
|
|
127
|
+
};
|
|
128
|
+
},
|
|
129
|
+
},
|
|
118
130
|
});
|
|
119
131
|
}
|
|
120
132
|
/** A new temperature only takes effect on a restart; while off it is kept for the next start. */
|
|
@@ -125,7 +137,7 @@ export class ClimateBinding extends ServiceBinding {
|
|
|
125
137
|
return;
|
|
126
138
|
}
|
|
127
139
|
try {
|
|
128
|
-
await this.ctx.controller.runCommand("Stop air conditioning for new temperature", (client) => client.stopAirConditioning());
|
|
140
|
+
await this.ctx.controller.runCommand("Stop air conditioning for new temperature", (client) => client.stopAirConditioning(), { operations: ["stopAirConditioning"] });
|
|
129
141
|
await new Promise((resolve) => setTimeout(resolve, RESTART_PAUSE_MS).unref());
|
|
130
142
|
await this.start();
|
|
131
143
|
}
|
|
@@ -153,19 +165,31 @@ export class AuxiliaryHeatingBinding extends ServiceBinding {
|
|
|
153
165
|
: {
|
|
154
166
|
durationInSeconds: auxiliaryHeatingDurationMinutes * 60,
|
|
155
167
|
}),
|
|
156
|
-
}),
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
}), {
|
|
169
|
+
operations: ["startAuxiliaryHeating"],
|
|
170
|
+
optimistic: {
|
|
171
|
+
part: "auxiliaryHeating",
|
|
172
|
+
apply: (vehicle) => {
|
|
173
|
+
vehicle.auxiliaryHeating = {
|
|
174
|
+
...vehicle.auxiliaryHeating,
|
|
175
|
+
state: "HEATING_AUXILIARY",
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
},
|
|
161
179
|
});
|
|
162
180
|
}
|
|
163
181
|
else if (value !== true) {
|
|
164
|
-
await this.command("Stop auxiliary heating", (client) => client.stopAuxiliaryHeating(),
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
182
|
+
await this.command("Stop auxiliary heating", (client) => client.stopAuxiliaryHeating(), {
|
|
183
|
+
operations: ["stopAuxiliaryHeating"],
|
|
184
|
+
optimistic: {
|
|
185
|
+
part: "auxiliaryHeating",
|
|
186
|
+
apply: (vehicle) => {
|
|
187
|
+
vehicle.auxiliaryHeating = {
|
|
188
|
+
...vehicle.auxiliaryHeating,
|
|
189
|
+
state: "OFF",
|
|
190
|
+
};
|
|
191
|
+
},
|
|
192
|
+
},
|
|
169
193
|
});
|
|
170
194
|
}
|
|
171
195
|
});
|
|
@@ -193,7 +217,11 @@ export class ActiveVentilationBinding extends ServiceBinding {
|
|
|
193
217
|
const on = value === true;
|
|
194
218
|
await this.command(on ? "Start active ventilation" : "Stop active ventilation", (client) => on
|
|
195
219
|
? client.startActiveVentilation()
|
|
196
|
-
: client.stopActiveVentilation()
|
|
220
|
+
: client.stopActiveVentilation(), {
|
|
221
|
+
operations: [
|
|
222
|
+
on ? "startActiveVentilation" : "stopActiveVentilation",
|
|
223
|
+
],
|
|
224
|
+
});
|
|
197
225
|
setTimeout(() => {
|
|
198
226
|
this.rerender();
|
|
199
227
|
}, 500).unref();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"climate.js","sourceRoot":"","sources":["../../../src/accessory/services/climate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