diff --git a/homeassistant/components/reolink/entity.py b/homeassistant/components/reolink/entity.py index 467472fef9c..a83dc259e1b 100644 --- a/homeassistant/components/reolink/entity.py +++ b/homeassistant/components/reolink/entity.py @@ -24,7 +24,7 @@ class ReolinkEntityDescription(EntityDescription): """A class that describes entities for Reolink.""" cmd_key: str | None = None - cmd_id: int | None = None + cmd_id: int | list[int] | None = None always_available: bool = False @@ -120,12 +120,15 @@ class ReolinkHostCoordinatorEntity(CoordinatorEntity[DataUpdateCoordinator[None] """Entity created.""" await super().async_added_to_hass() cmd_key = self.entity_description.cmd_key - cmd_id = self.entity_description.cmd_id + cmd_ids = self.entity_description.cmd_id callback_id = f"{self.platform.domain}_{self._attr_unique_id}" if cmd_key is not None: self._host.async_register_update_cmd(cmd_key) - if cmd_id is not None: - self.register_callback(callback_id, cmd_id) + if isinstance(cmd_ids, int): + self.register_callback(callback_id, cmd_ids) + elif isinstance(cmd_ids, list): + for cmd_id in cmd_ids: + self.register_callback(callback_id, cmd_id) # Privacy mode self.register_callback(f"{callback_id}_623", 623) diff --git a/homeassistant/components/reolink/light.py b/homeassistant/components/reolink/light.py index d48790264d1..1e2c6d49528 100644 --- a/homeassistant/components/reolink/light.py +++ b/homeassistant/components/reolink/light.py @@ -57,7 +57,7 @@ LIGHT_ENTITIES = ( ReolinkLightEntityDescription( key="floodlight", cmd_key="GetWhiteLed", - cmd_id=291, + cmd_id=[291, 289, 438], translation_key="floodlight", supported=lambda api, ch: api.supported(ch, "floodLight"), is_on_fn=lambda api, ch: api.whiteled_state(ch), diff --git a/homeassistant/components/reolink/number.py b/homeassistant/components/reolink/number.py index 6de702a0395..2de2468ca3d 100644 --- a/homeassistant/components/reolink/number.py +++ b/homeassistant/components/reolink/number.py @@ -113,6 +113,7 @@ NUMBER_ENTITIES = ( ReolinkNumberEntityDescription( key="floodlight_brightness", cmd_key="GetWhiteLed", + cmd_id=[289, 438], translation_key="floodlight_brightness", entity_category=EntityCategory.CONFIG, native_step=1,