forked from home-assistant/core
Add state class to DTE Energy Bridge (#52110)
This commit is contained in:
@@ -4,7 +4,11 @@ import logging
|
|||||||
import requests
|
import requests
|
||||||
import voluptuous as vol
|
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
|
from homeassistant.const import CONF_NAME, HTTP_OK
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
@@ -41,6 +45,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||||||
class DteEnergyBridgeSensor(SensorEntity):
|
class DteEnergyBridgeSensor(SensorEntity):
|
||||||
"""Implementation of the DTE Energy Bridge sensors."""
|
"""Implementation of the DTE Energy Bridge sensors."""
|
||||||
|
|
||||||
|
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||||
|
|
||||||
def __init__(self, ip_address, name, version):
|
def __init__(self, ip_address, name, version):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self._version = version
|
self._version = version
|
||||||
|
Reference in New Issue
Block a user