From 2a56b958e57197e84ded216840237e93bb82bb73 Mon Sep 17 00:00:00 2001 From: jontofront Date: Fri, 12 Jan 2024 22:53:01 +0200 Subject: [PATCH 1/2] add fuelStream --- custom_components/econet300/sensor.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/custom_components/econet300/sensor.py b/custom_components/econet300/sensor.py index 907de9d..b29cafd 100644 --- a/custom_components/econet300/sensor.py +++ b/custom_components/econet300/sensor.py @@ -164,6 +164,13 @@ class EconetSensorEntityDescription(SensorEntityDescription): native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, process_val=lambda x: round(x, 1), + ), + EconetSensorEntityDescription( + key="fuelStream", + translation_key="fuel_stream", + name="Fuel stream", + state_class=SensorStateClass.MEASUREMENT, + process_val=lambda x: round(x, 1), ), EconetSensorEntityDescription( key="mode", From c702409f0949fa7422f92bf4ebfe92630a2aa65f Mon Sep 17 00:00:00 2001 From: Maciej Przybylski Date: Sat, 13 Jan 2024 09:23:17 +0100 Subject: [PATCH 2/2] bugfix: Fix adding mixer sensor --- custom_components/econet300/binary_sensor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/custom_components/econet300/binary_sensor.py b/custom_components/econet300/binary_sensor.py index 60494b7..54db666 100644 --- a/custom_components/econet300/binary_sensor.py +++ b/custom_components/econet300/binary_sensor.py @@ -183,10 +183,10 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api): entities = [] for i in range(1, AVAILABLE_NUMBER_OF_MIXERS + 1): - availaimility_mixer_key = f"mixerTemp{i}" - if can_add_mixer(availaimility_mixer_key, coordinator): + availability_mixer_key = f"mixerTemp{i}" + if can_add_mixer(availability_mixer_key, coordinator): description = EconetBinarySensorEntityDescription( - availability_key=availaimility_mixer_key, + availability_key=availability_mixer_key, key=f"mixerPumpWorks{i}", name=f"Mixer {i}", icon="mdi:pump", @@ -197,7 +197,7 @@ def create_mixer_sensors(coordinator: EconetDataCoordinator, api: Econet300Api): else: _LOGGER.debug( "Availability key: %s does not exist, entity will not be added", - description.key, + availability_mixer_key, ) return entities