Deprecate SUPPORT_*-constants for Tradfri integration (#69368)
* Refactor constants * Remove _LOGGER * Fix sort order * Refactor constats * Run isort * Remove SUPPORTED_ constants from Tradfri integration * Remove constant * Remove line * Use brackets * Add documentation * Address review comments
This commit is contained in:
parent
f194f7809b
commit
af5d29735f
2 changed files with 20 additions and 23 deletions
|
@ -7,11 +7,7 @@ from typing import Any, cast
|
|||
|
||||
from pytradfri.command import Command
|
||||
|
||||
from homeassistant.components.fan import (
|
||||
SUPPORT_PRESET_MODE,
|
||||
SUPPORT_SET_SPEED,
|
||||
FanEntity,
|
||||
)
|
||||
from homeassistant.components.fan import FanEntity, FanEntityFeature
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -58,6 +54,8 @@ async def async_setup_entry(
|
|||
class TradfriAirPurifierFan(TradfriBaseEntity, FanEntity):
|
||||
"""The platform class required by Home Assistant."""
|
||||
|
||||
_attr_supported_features = FanEntityFeature.PRESET_MODE | FanEntityFeature.SET_SPEED
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
device_coordinator: TradfriDeviceDataUpdateCoordinator,
|
||||
|
@ -78,11 +76,6 @@ class TradfriAirPurifierFan(TradfriBaseEntity, FanEntity):
|
|||
"""Refresh the device."""
|
||||
self._device_data = self.coordinator.data.air_purifier_control.air_purifiers[0]
|
||||
|
||||
@property
|
||||
def supported_features(self) -> int:
|
||||
"""Flag supported features."""
|
||||
return SUPPORT_PRESET_MODE + SUPPORT_SET_SPEED
|
||||
|
||||
@property
|
||||
def speed_count(self) -> int:
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue