Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace DEVICE_CLASS_TIMESTAMP with SensorDeviceClass.TIMESTAMP #23

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions custom_components/hass_stadtreinigung_hamburg/sensor.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorDeviceClass
import homeassistant.helpers.config_validation as cv
from homeassistant.util import Throttle, slugify
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME, DEVICE_CLASS_TIMESTAMP
from homeassistant.const import CONF_NAME
from homeassistant.helpers.entity import Entity
import logging
from datetime import datetime
from datetime import timedelta
from datetime import datetime, timedelta
from homeassistant.core import HomeAssistant
from typing import Optional

Expand Down Expand Up @@ -99,7 +98,7 @@ def unit_of_measurement(self):
@property
def device_class(self) -> Optional[str]:
"""Return the class of this device, from component DEVICE_CLASSES."""
return DEVICE_CLASS_TIMESTAMP
return SensorDeviceClass.TIMESTAMP

@property
def extra_state_attributes(self):
Expand Down
Loading