Skip to content

Commit

Permalink
Merge pull request #165 from henricm/more-total-increasing
Browse files Browse the repository at this point in the history
fix: make four more sensors total increasing
  • Loading branch information
argoyle authored May 4, 2022
2 parents 5c3f2c5 + f1519f7 commit fa0adc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 5 additions & 1 deletion custom_components/ferroamp/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1313,6 +1313,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
interval,
precision_energy,
config_id,
state_class=SensorStateClass.TOTAL_INCREASING,
),
ThreePhaseEnergyFerroampSensor(
"Inverter Energy Consumed",
Expand All @@ -1324,6 +1325,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
interval,
precision_energy,
config_id,
state_class=SensorStateClass.TOTAL_INCREASING,
),
ThreePhaseEnergyFerroampSensor(
"Load Energy Produced",
Expand All @@ -1335,6 +1337,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
interval,
precision_energy,
config_id,
state_class=SensorStateClass.TOTAL_INCREASING,
),
ThreePhaseEnergyFerroampSensor(
"Load Energy Consumed",
Expand All @@ -1346,6 +1349,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
interval,
precision_energy,
config_id,
state_class=SensorStateClass.TOTAL_INCREASING,
),
EnergyFerroampSensor(
"Total Solar Energy",
Expand Down Expand Up @@ -1493,7 +1497,7 @@ def ehub_sensors(slug, interval, precision_battery, precision_current, precision
precision_current,
config_id,
),
ThreePhaseMinFerroampSensor(
ThreePhaseMinFerroampSensor(
"Available RMS current for load balancing",
slug,
"iavbl",
Expand Down
8 changes: 4 additions & 4 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'device_class': 'energy',
'friendly_name': 'Inverter Energy Produced',
'icon': 'mdi:power-plug',
'state_class': 'measurement',
'state_class': 'total_increasing',
'unit_of_measurement': 'kWh'
}

Expand All @@ -359,7 +359,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'device_class': 'energy',
'friendly_name': 'Inverter Energy Consumed',
'icon': 'mdi:power-plug',
'state_class': 'measurement',
'state_class': 'total_increasing',
'unit_of_measurement': 'kWh'
}

Expand All @@ -372,7 +372,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'device_class': 'energy',
'friendly_name': 'Load Energy Produced',
'icon': 'mdi:power-plug',
'state_class': 'measurement',
'state_class': 'total_increasing',
'unit_of_measurement': 'kWh'
}

Expand All @@ -385,7 +385,7 @@ async def test_setting_ehub_sensor_values_via_mqtt_message(hass, mqtt_mock):
'device_class': 'energy',
'friendly_name': 'Load Energy Consumed',
'icon': 'mdi:power-plug',
'state_class': 'measurement',
'state_class': 'total_increasing',
'unit_of_measurement': 'kWh'
}

Expand Down

0 comments on commit fa0adc0

Please sign in to comment.