From 3f01ec2684d518edb573128bfd306d1dd494c5d5 Mon Sep 17 00:00:00 2001 From: James Polley Date: Mon, 28 Oct 2024 15:23:34 +1100 Subject: [PATCH] Handle case where EXTERNAL_DEVICE_LOAD has a unit Fixes https://github.com/keshavdv/victron-hacs/issues/123 Alternative to https://github.com/keshavdv/victron-hacs/issues/99 --- custom_components/victron_ble/sensor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/custom_components/victron_ble/sensor.py b/custom_components/victron_ble/sensor.py index 1d3caa4..2c3e116 100644 --- a/custom_components/victron_ble/sensor.py +++ b/custom_components/victron_ble/sensor.py @@ -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,