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