mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Correct fjaraskupan post merge review comments (#58796)
This commit is contained in:
parent
f561533d2c
commit
7047205fb8
@ -23,7 +23,7 @@ from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
|||||||
|
|
||||||
from .const import DISPATCH_DETECTION, DOMAIN
|
from .const import DISPATCH_DETECTION, DOMAIN
|
||||||
|
|
||||||
PLATFORMS = ["binary_sensor", "fan", "light", "sensor", "number"]
|
PLATFORMS = ["binary_sensor", "fan", "light", "number", "sensor"]
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ from homeassistant.components.fan import (
|
|||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import (
|
||||||
@ -50,7 +51,7 @@ PRESET_TO_COMMAND = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class UnsupportedPreset(Exception):
|
class UnsupportedPreset(HomeAssistantError):
|
||||||
"""The preset is unsupported."""
|
"""The preset is unsupported."""
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ async def async_setup_entry(
|
|||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: AddEntitiesCallback,
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up sensors dynamically through discovery."""
|
"""Set up number entities dynamically through discovery."""
|
||||||
|
|
||||||
def _constructor(device_state: DeviceState) -> list[Entity]:
|
def _constructor(device_state: DeviceState) -> list[Entity]:
|
||||||
return [
|
return [
|
||||||
@ -40,7 +40,6 @@ class PeriodicVentingTime(CoordinatorEntity[State], NumberEntity):
|
|||||||
_attr_max_value: float = 59
|
_attr_max_value: float = 59
|
||||||
_attr_min_value: float = 0
|
_attr_min_value: float = 0
|
||||||
_attr_step: float = 1
|
_attr_step: float = 1
|
||||||
_attr_entity_registry_enabled_default = True
|
|
||||||
_attr_entity_category = ENTITY_CATEGORY_CONFIG
|
_attr_entity_category = ENTITY_CATEGORY_CONFIG
|
||||||
_attr_unit_of_measurement = TIME_MINUTES
|
_attr_unit_of_measurement = TIME_MINUTES
|
||||||
|
|
||||||
@ -50,7 +49,7 @@ class PeriodicVentingTime(CoordinatorEntity[State], NumberEntity):
|
|||||||
device: Device,
|
device: Device,
|
||||||
device_info: DeviceInfo,
|
device_info: DeviceInfo,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Init sensor."""
|
"""Init number entities."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self._device = device
|
self._device = device
|
||||||
self._attr_unique_id = f"{device.address}-periodic-venting"
|
self._attr_unique_id = f"{device.address}-periodic-venting"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user