Migrate binary sensor device classes to StrEnum (#60651)

This commit is contained in:
Franck Nijhof 2021-12-01 08:12:09 +01:00 committed by GitHub
parent 12ff5dee74
commit 2b8f245e27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 135 additions and 102 deletions

View file

@ -2,7 +2,11 @@
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA,
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_USERNAME
from homeassistant.core import HomeAssistant
@ -29,3 +33,5 @@ async def async_setup_entry(
class UpCloudBinarySensor(UpCloudServerEntity, BinarySensorEntity):
"""Representation of an UpCloud server sensor."""
_attr_device_class = BinarySensorDeviceClass.POWER