mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Add state class to Tankerkoenig fuel price sensors (#68737)
This commit is contained in:
parent
66d892237d
commit
23c47c2206
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ATTRIBUTION,
|
ATTR_ATTRIBUTION,
|
||||||
ATTR_LATITUDE,
|
ATTR_LATITUDE,
|
||||||
@ -92,6 +92,8 @@ async def async_setup_platform(
|
|||||||
class FuelPriceSensor(CoordinatorEntity, SensorEntity):
|
class FuelPriceSensor(CoordinatorEntity, SensorEntity):
|
||||||
"""Contains prices for fuel in a given station."""
|
"""Contains prices for fuel in a given station."""
|
||||||
|
|
||||||
|
_attr_state_class = STATE_CLASS_MEASUREMENT
|
||||||
|
|
||||||
def __init__(self, fuel_type, station, coordinator, name, show_on_map):
|
def __init__(self, fuel_type, station, coordinator, name, show_on_map):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user