File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
custom_components/victron_ble Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class VictronSensor(StrEnum):
27
27
CHARGER_ERROR = "charger_error"
28
28
STARTER_BATTERY_VOLTAGE = "starter_battery_voltage"
29
29
MIDPOINT_VOLTAGE = "midpoint_voltage"
30
+ TIME_REMAINING = "time_remaining"
30
31
31
32
32
33
class VictronBluetoothDeviceData (BluetoothData ):
@@ -91,6 +92,14 @@ def _process_mfr_data(
91
92
SensorLibrary .BATTERY__PERCENTAGE , parsed .get_soc ()
92
93
)
93
94
95
+ self .update_sensor (
96
+ key = VictronSensor .TIME_REMAINING ,
97
+ name = "Time remaining" ,
98
+ native_unit_of_measurement = Units .TIME_MINUTES ,
99
+ native_value = parsed .get_remaining_mins (),
100
+ device_class = SensorDeviceClass .DURATION ,
101
+ )
102
+
94
103
aux_mode = parsed .get_aux_mode ()
95
104
self .update_sensor (
96
105
key = VictronSensor .AUX_MODE ,
Original file line number Diff line number Diff line change 91
91
options = [x .lower () for x in ChargerError ._member_names_ ],
92
92
),
93
93
(VictronSensor .EXTERNAL_DEVICE_LOAD , None ): SensorEntityDescription (
94
- key = f" { SensorDeviceClass . CURRENT } _ { Units . ELECTRIC_CURRENT_AMPERE } " ,
94
+ key = VictronSensor . EXTERNAL_DEVICE_LOAD ,
95
95
device_class = SensorDeviceClass .CURRENT ,
96
96
native_unit_of_measurement = Units .ELECTRIC_CURRENT_AMPERE ,
97
97
state_class = SensorStateClass .MEASUREMENT ,
98
98
),
99
+ (VictronSensor .TIME_REMAINING , Units .TIME_MINUTES ): SensorEntityDescription (
100
+ key = VictronSensor .TIME_REMAINING ,
101
+ device_class = SensorDeviceClass .DURATION ,
102
+ native_unit_of_measurement = Units .TIME_MINUTES ,
103
+ state_class = SensorStateClass .MEASUREMENT ,
104
+ ),
99
105
(
100
106
VictronSensor .INPUT_VOLTAGE ,
101
107
Units .ELECTRIC_POTENTIAL_VOLT ,
You can’t perform that action at this time.
0 commit comments