Use new enums in soma (#62377)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-20 14:19:09 +01:00 committed by GitHub
parent c7a3a0da9f
commit d147038cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,8 +4,8 @@ import logging
from requests import RequestException
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.const import PERCENTAGE
from homeassistant.util import Throttle
from . import DEVICES, SomaEntity
@ -29,7 +29,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
class SomaSensor(SomaEntity, SensorEntity):
"""Representation of a Soma cover device."""
_attr_device_class = DEVICE_CLASS_BATTERY
_attr_device_class = SensorDeviceClass.BATTERY
_attr_native_unit_of_measurement = PERCENTAGE
@property