Add state class to DTE Energy Bridge (#52110)

This commit is contained in:
Franck Nijhof 2021-06-23 19:44:41 +02:00 committed by GitHub
parent 927b74b4a2
commit 7f7c0febd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,11 @@ import logging
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import CONF_NAME, HTTP_OK
import homeassistant.helpers.config_validation as cv
@ -41,6 +45,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class DteEnergyBridgeSensor(SensorEntity):
"""Implementation of the DTE Energy Bridge sensors."""
_attr_state_class = STATE_CLASS_MEASUREMENT
def __init__(self, ip_address, name, version):
"""Initialize the sensor."""
self._version = version