mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Use enums in withings (#61987)
This commit is contained in:
parent
98c2c8c2d1
commit
f691b0a1da
@ -2,8 +2,8 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_OCCUPANCY,
|
|
||||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||||
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
@ -29,7 +29,7 @@ async def async_setup_entry(
|
|||||||
class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorEntity):
|
class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorEntity):
|
||||||
"""Implementation of a Withings sensor."""
|
"""Implementation of a Withings sensor."""
|
||||||
|
|
||||||
_attr_device_class = DEVICE_CLASS_OCCUPANCY
|
_attr_device_class = BinarySensorDeviceClass.OCCUPANCY
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user