mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Use new enums in soma (#62377)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
c7a3a0da9f
commit
d147038cc5
@ -4,8 +4,8 @@ import logging
|
|||||||
|
|
||||||
from requests import RequestException
|
from requests import RequestException
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||||
from homeassistant.const import DEVICE_CLASS_BATTERY, PERCENTAGE
|
from homeassistant.const import PERCENTAGE
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
from . import DEVICES, SomaEntity
|
from . import DEVICES, SomaEntity
|
||||||
@ -29,7 +29,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
class SomaSensor(SomaEntity, SensorEntity):
|
class SomaSensor(SomaEntity, SensorEntity):
|
||||||
"""Representation of a Soma cover device."""
|
"""Representation of a Soma cover device."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_BATTERY
|
_attr_device_class = SensorDeviceClass.BATTERY
|
||||||
_attr_native_unit_of_measurement = PERCENTAGE
|
_attr_native_unit_of_measurement = PERCENTAGE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user