mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Remove withings use of deprecated classes (#37611)
Adjusting in bed device class to occupancy.
This commit is contained in:
parent
663acfe89f
commit
09ee52c4cb
@ -2,9 +2,9 @@
|
|||||||
from typing import Callable, List
|
from typing import Callable, List
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_PRESENCE,
|
DEVICE_CLASS_OCCUPANCY,
|
||||||
DOMAIN as BINARY_SENSOR_DOMAIN,
|
DOMAIN as BINARY_SENSOR_DOMAIN,
|
||||||
BinarySensorDevice,
|
BinarySensorEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
@ -26,7 +26,7 @@ async def async_setup_entry(
|
|||||||
async_add_entities(entities, True)
|
async_add_entities(entities, True)
|
||||||
|
|
||||||
|
|
||||||
class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorDevice):
|
class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorEntity):
|
||||||
"""Implementation of a Withings sensor."""
|
"""Implementation of a Withings sensor."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -37,4 +37,4 @@ class WithingsHealthBinarySensor(BaseWithingsSensor, BinarySensorDevice):
|
|||||||
@property
|
@property
|
||||||
def device_class(self) -> str:
|
def device_class(self) -> str:
|
||||||
"""Provide the device class."""
|
"""Provide the device class."""
|
||||||
return DEVICE_CLASS_PRESENCE
|
return DEVICE_CLASS_OCCUPANCY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user