Skip to content

Commit

Permalink
Handle case where EXTERNAL_DEVICE_LOAD has a unit
Browse files Browse the repository at this point in the history
Fixes keshavdv#123
Alternative to keshavdv#99
  • Loading branch information
jamezpolley authored Oct 28, 2024
1 parent a8eee7c commit 3f01ec2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/victron_ble/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
native_unit_of_measurement=Units.ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT,
),
(VictronSensor.EXTERNAL_DEVICE_LOAD, Units.ELECTRIC_CURRENT_AMPERE): SensorEntityDescription(
key=VictronSensor.EXTERNAL_DEVICE_LOAD,
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=Units.ELECTRIC_CURRENT_AMPERE,
state_class=SensorStateClass.MEASUREMENT,
),
(VictronSensor.TIME_REMAINING, Units.TIME_MINUTES): SensorEntityDescription(
key=VictronSensor.TIME_REMAINING,
device_class=SensorDeviceClass.DURATION,
Expand Down

0 comments on commit 3f01ec2

Please sign in to comment.