Set device_class on temperature sensors L-Q (#52919)

This commit is contained in:
Erik Montnemery 2021-07-12 20:41:45 +02:00 committed by GitHub
parent 0a3aab935a
commit d1f3c20079
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 143 additions and 64 deletions

View file

@ -1,7 +1,7 @@
"""Support for Notion sensors."""
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import TEMP_CELSIUS
from homeassistant.const import DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -9,7 +9,9 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from . import NotionEntity
from .const import DATA_COORDINATOR, DOMAIN, LOGGER, SENSOR_TEMPERATURE
SENSOR_TYPES = {SENSOR_TEMPERATURE: ("Temperature", "temperature", TEMP_CELSIUS)}
SENSOR_TYPES = {
SENSOR_TEMPERATURE: ("Temperature", DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS)
}
async def async_setup_entry(