Skip to content

Commit

Permalink
Updated battery and fixed car fuel type
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarons committed Nov 6, 2024
1 parent 3d94543 commit 3cfa572
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/bouncie/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def update_car_info_attributes(vehicle_info):
value_fn=lambda vehicle_info: vehicle_info["stats"]["lastUpdated"],
extra_attrs_fn=lambda vehicle_info: {
const.ATTR_VEHICLE_STATS_LAST_UPDATE_JSON_KEY: json.dumps(vehicle_info)
}
},
),
BouncieSensorEntityDescription(
key="car-info",
Expand Down Expand Up @@ -94,7 +94,7 @@ def update_car_info_attributes(vehicle_info):
key="car-fuel",
icon="mdi:gas-station",
name="Car Fuel",
device_class=SensorDeviceClass.BATTERY,
device_class=SensorDeviceClass.VOLUME_STORAGE,
native_unit_of_measurement="%",
value_fn=lambda vehicle_info: int(vehicle_info["stats"]["fuelLevel"]),
extra_attrs_fn=update_car_stats_attributes,
Expand Down Expand Up @@ -125,9 +125,9 @@ def update_car_info_attributes(vehicle_info):
key="car-battery",
icon="mdi:car-battery",
name="Car Battery",
value_fn=lambda vehicle_info: vehicle_info["stats"]["battery"]["status"],
value_fn=lambda vehicle_info: vehicle_info["stats"]["mil"]["battery"]["status"],
extra_attrs_fn=lambda vehicle_info: {
const.ATTR_VEHICLE_BATTERY_LAST_UPDATED_KEY: vehicle_info["stats"][
const.ATTR_VEHICLE_BATTERY_LAST_UPDATED_KEY: vehicle_info["stats"]["mil"][
"battery"
]["lastUpdated"]
},
Expand Down

0 comments on commit 3cfa572

Please sign in to comment.