mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add state class to DTE Energy Bridge (#52110)
This commit is contained in:
parent
927b74b4a2
commit
7f7c0febd8
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user