Correct fjaraskupan post merge review comments (#58796)

This commit is contained in:
Joakim Plate 2021-10-31 11:47:25 +01:00 committed by GitHub
parent f561533d2c
commit 7047205fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -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__)

View File

@ -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."""

View File

@ -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"