Set correct state_class for battery_stored and increase timeout to prevent Imeon integration disconnections (#144925)

This commit is contained in:
Jason Mahdjoub 2025-05-26 21:13:47 +02:00 committed by GitHub
parent 84305563ab
commit 9b9d4d7dab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
from homeassistant.const import Platform from homeassistant.const import Platform
DOMAIN = "imeon_inverter" DOMAIN = "imeon_inverter"
TIMEOUT = 20 TIMEOUT = 30
PLATFORMS = [ PLATFORMS = [
Platform.SENSOR, Platform.SENSOR,
] ]

View File

@ -69,7 +69,7 @@ ENTITY_DESCRIPTIONS = (
translation_key="battery_stored", translation_key="battery_stored",
native_unit_of_measurement=UnitOfEnergy.WATT_HOUR, native_unit_of_measurement=UnitOfEnergy.WATT_HOUR,
device_class=SensorDeviceClass.ENERGY_STORAGE, device_class=SensorDeviceClass.ENERGY_STORAGE,
state_class=SensorStateClass.TOTAL, state_class=SensorStateClass.MEASUREMENT,
), ),
# Grid # Grid
SensorEntityDescription( SensorEntityDescription(

View File

@ -282,7 +282,7 @@
}), }),
'area_id': None, 'area_id': None,
'capabilities': dict({ 'capabilities': dict({
'state_class': <SensorStateClass.TOTAL: 'total'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}), }),
'config_entry_id': <ANY>, 'config_entry_id': <ANY>,
'config_subentry_id': <ANY>, 'config_subentry_id': <ANY>,
@ -321,7 +321,7 @@
'attributes': ReadOnlyDict({ 'attributes': ReadOnlyDict({
'device_class': 'energy_storage', 'device_class': 'energy_storage',
'friendly_name': 'Imeon inverter Battery stored', 'friendly_name': 'Imeon inverter Battery stored',
'state_class': <SensorStateClass.TOTAL: 'total'>, 'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfEnergy.WATT_HOUR: 'Wh'>, 'unit_of_measurement': <UnitOfEnergy.WATT_HOUR: 'Wh'>,
}), }),
'context': <ANY>, 'context': <ANY>,