Skip to content

Commit

Permalink
Merge pull request #592 from MTrab:Enable-long-term-statistics
Browse files Browse the repository at this point in the history
Enable long term statistics
  • Loading branch information
MTrab authored Sep 12, 2024
2 parents a02df62 + 2076aea commit 4e003f5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions custom_components/energidataservice/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_EMAIL, CONF_NAME
Expand Down Expand Up @@ -138,17 +139,19 @@ def _setup(hass, config: ConfigEntry, add_devices):
device_class=SensorDeviceClass.MONETARY,
icon="mdi:flash",
name=config.data.get(CONF_NAME),
state_class=None,
state_class=SensorStateClass.TOTAL,
last_reset=None,
)
sens = EnergidataserviceSensor(config, hass, region, this_sensor)
add_devices([sens])

co2_sensor = SensorEntityDescription(
key="EnergiDataService_co2",
device_class=None,
device_class=SensorDeviceClass.CO2,
icon="mdi:molecule-co2",
name=config.data.get(CONF_NAME) + " CO2",
state_class=None,
state_class=SensorStateClass.TOTAL,
last_reset=None,
)
sens = EnergidataserviceCO2Sensor(config, hass, region, co2_sensor)
add_devices([sens])
Expand Down

0 comments on commit 4e003f5

Please sign in to comment.