Skip to content

Commit 40efd96

Browse files
committed
Allow for fuel level threshold, ref #5
1 parent 1767f9b commit 40efd96

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

config.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@
5858
"description": "Duration of engine remote start. Only applicable if feature is supported by your car."
5959
},
6060
"batteryLowThreshold": {
61-
"title": "EV Battery threshold",
61+
"title": "EV Battery/fuel threshold",
6262
"type": "integer",
6363
"placeholder": 20,
6464
"minimum": 1,
6565
"maximum": 99,
66-
"description": "Threshold (percentage) for battery low status in HomeKit. Only applicable for EV or plugin hybrids."
66+
"description": "Threshold (percentage) for battery low status in HomeKit. If your vehicle is not an EV, this will reflect the fuel level for your car."
6767
},
6868
"enabledFeatures": {
6969
"type": "object",

src/util/vehicle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class Vehicle extends VehicleApi {
112112

113113
case VolvoSensorBindings.FUEL_PERCENT_LOW:
114114
value =
115-
this.state.fuelAmountLevel < 20
115+
this.state.fuelAmountLevel < this.config.batteryLowThreshold
116116
? this.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
117117
: this.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
118118
break;

0 commit comments

Comments
 (0)