Skip to content

Commit

Permalink
Merge pull request #62 from B1ob/master
Browse files Browse the repository at this point in the history
Add support for long-term statistics
  • Loading branch information
sverrham authored Dec 10, 2021
2 parents aa11f0a + fa2738d commit 52c551a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions custom_components/airthings_wave/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@

import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA

from homeassistant.components.sensor import (
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)

from homeassistant.const import (ATTR_DEVICE_CLASS, ATTR_ICON, CONF_MAC,
CONF_NAME, CONF_SCAN_INTERVAL, CONF_ELEVATION,
CONF_UNIT_SYSTEM, CONF_UNIT_SYSTEM_IMPERIAL,
Expand All @@ -32,7 +38,6 @@
DEVICE_CLASS_TIMESTAMP,
EVENT_HOMEASSISTANT_STOP, ILLUMINANCE,
STATE_UNKNOWN)
from homeassistant.helpers.entity import Entity

_LOGGER = logging.getLogger(__name__)
CONNECT_TIMEOUT = 30
Expand Down Expand Up @@ -208,7 +213,10 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
add_entities(ha_entities, True)


class AirthingsSensor(Entity):
class AirthingsSensor(SensorEntity):

_attr_state_class = STATE_CLASS_MEASUREMENT

"""General Representation of an Airthings sensor."""
def __init__(self, mac, name, device, device_info, sensor_specifics):
"""Initialize a sensor."""
Expand Down

0 comments on commit 52c551a

Please sign in to comment.