Skip to content

Commit

Permalink
Allow for fuel level threshold, ref #5
Browse files Browse the repository at this point in the history
  • Loading branch information
trympet committed Jul 18, 2020
1 parent 1767f9b commit 40efd96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
"description": "Duration of engine remote start. Only applicable if feature is supported by your car."
},
"batteryLowThreshold": {
"title": "EV Battery threshold",
"title": "EV Battery/fuel threshold",
"type": "integer",
"placeholder": 20,
"minimum": 1,
"maximum": 99,
"description": "Threshold (percentage) for battery low status in HomeKit. Only applicable for EV or plugin hybrids."
"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."
},
"enabledFeatures": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion src/util/vehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class Vehicle extends VehicleApi {

case VolvoSensorBindings.FUEL_PERCENT_LOW:
value =
this.state.fuelAmountLevel < 20
this.state.fuelAmountLevel < this.config.batteryLowThreshold
? this.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW
: this.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
break;
Expand Down

0 comments on commit 40efd96

Please sign in to comment.