Add state class to Tankerkoenig fuel price sensors (#68737)

pull/68778/head
Michael 2022-03-28 09:48:25 +02:00 committed by GitHub
parent 66d892237d
commit 23c47c2206
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -3,7 +3,7 @@ from __future__ import annotations
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.components.sensor import STATE_CLASS_MEASUREMENT, SensorEntity
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_LATITUDE,
@ -92,6 +92,8 @@ async def async_setup_platform(
class FuelPriceSensor(CoordinatorEntity, SensorEntity):
"""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):
"""Initialize the sensor."""
super().__init__(coordinator)