mirror of
https://github.com/home-assistant/core.git
synced 2025-04-30 20:27:57 +00:00
Reolink only fetch data for enabled entities (#104157)
This commit is contained in:
parent
a3dd2b8ea9
commit
381036e46a
@ -24,6 +24,7 @@ _T = TypeVar("_T")
|
|||||||
class ReolinkChannelEntityDescription(EntityDescription):
|
class ReolinkChannelEntityDescription(EntityDescription):
|
||||||
"""A class that describes entities for a camera channel."""
|
"""A class that describes entities for a camera channel."""
|
||||||
|
|
||||||
|
cmd_key: str | None = None
|
||||||
supported: Callable[[Host, int], bool] = lambda api, ch: True
|
supported: Callable[[Host, int], bool] = lambda api, ch: True
|
||||||
|
|
||||||
|
|
||||||
@ -31,6 +32,7 @@ class ReolinkChannelEntityDescription(EntityDescription):
|
|||||||
class ReolinkHostEntityDescription(EntityDescription):
|
class ReolinkHostEntityDescription(EntityDescription):
|
||||||
"""A class that describes host entities."""
|
"""A class that describes host entities."""
|
||||||
|
|
||||||
|
cmd_key: str | None = None
|
||||||
supported: Callable[[Host], bool] = lambda api: True
|
supported: Callable[[Host], bool] = lambda api: True
|
||||||
|
|
||||||
|
|
||||||
@ -84,6 +86,15 @@ class ReolinkHostCoordinatorEntity(ReolinkBaseCoordinatorEntity[None]):
|
|||||||
|
|
||||||
self._attr_unique_id = f"{self._host.unique_id}_{self.entity_description.key}"
|
self._attr_unique_id = f"{self._host.unique_id}_{self.entity_description.key}"
|
||||||
|
|
||||||
|
async def async_added_to_hass(self) -> None:
|
||||||
|
"""Entity created."""
|
||||||
|
await super().async_added_to_hass()
|
||||||
|
if (
|
||||||
|
self.entity_description.cmd_key is not None
|
||||||
|
and self.entity_description.cmd_key not in self._host.update_cmd_list
|
||||||
|
):
|
||||||
|
self._host.update_cmd_list.append(self.entity_description.cmd_key)
|
||||||
|
|
||||||
|
|
||||||
class ReolinkChannelCoordinatorEntity(ReolinkHostCoordinatorEntity):
|
class ReolinkChannelCoordinatorEntity(ReolinkHostCoordinatorEntity):
|
||||||
"""Parent class for Reolink hardware camera entities connected to a channel of the NVR."""
|
"""Parent class for Reolink hardware camera entities connected to a channel of the NVR."""
|
||||||
|
@ -60,6 +60,8 @@ class ReolinkHost:
|
|||||||
timeout=DEFAULT_TIMEOUT,
|
timeout=DEFAULT_TIMEOUT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.update_cmd_list: list[str] = []
|
||||||
|
|
||||||
self.webhook_id: str | None = None
|
self.webhook_id: str | None = None
|
||||||
self._onvif_push_supported: bool = True
|
self._onvif_push_supported: bool = True
|
||||||
self._onvif_long_poll_supported: bool = True
|
self._onvif_long_poll_supported: bool = True
|
||||||
@ -311,7 +313,7 @@ class ReolinkHost:
|
|||||||
|
|
||||||
async def update_states(self) -> None:
|
async def update_states(self) -> None:
|
||||||
"""Call the API of the camera device to update the internal states."""
|
"""Call the API of the camera device to update the internal states."""
|
||||||
await self._api.get_states()
|
await self._api.get_states(cmd_list=self.update_cmd_list)
|
||||||
|
|
||||||
async def disconnect(self) -> None:
|
async def disconnect(self) -> None:
|
||||||
"""Disconnect from the API, so the connection will be released."""
|
"""Disconnect from the API, so the connection will be released."""
|
||||||
|
@ -41,6 +41,7 @@ class ReolinkLightEntityDescription(
|
|||||||
LIGHT_ENTITIES = (
|
LIGHT_ENTITIES = (
|
||||||
ReolinkLightEntityDescription(
|
ReolinkLightEntityDescription(
|
||||||
key="floodlight",
|
key="floodlight",
|
||||||
|
cmd_key="GetWhiteLed",
|
||||||
translation_key="floodlight",
|
translation_key="floodlight",
|
||||||
icon="mdi:spotlight-beam",
|
icon="mdi:spotlight-beam",
|
||||||
supported=lambda api, ch: api.supported(ch, "floodLight"),
|
supported=lambda api, ch: api.supported(ch, "floodLight"),
|
||||||
@ -51,6 +52,7 @@ LIGHT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkLightEntityDescription(
|
ReolinkLightEntityDescription(
|
||||||
key="ir_lights",
|
key="ir_lights",
|
||||||
|
cmd_key="GetIrLights",
|
||||||
translation_key="ir_lights",
|
translation_key="ir_lights",
|
||||||
icon="mdi:led-off",
|
icon="mdi:led-off",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -60,6 +62,7 @@ LIGHT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkLightEntityDescription(
|
ReolinkLightEntityDescription(
|
||||||
key="status_led",
|
key="status_led",
|
||||||
|
cmd_key="GetPowerLed",
|
||||||
translation_key="status_led",
|
translation_key="status_led",
|
||||||
icon="mdi:lightning-bolt-circle",
|
icon="mdi:lightning-bolt-circle",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
@ -41,6 +41,7 @@ class ReolinkNumberEntityDescription(
|
|||||||
NUMBER_ENTITIES = (
|
NUMBER_ENTITIES = (
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="zoom",
|
key="zoom",
|
||||||
|
cmd_key="GetZoomFocus",
|
||||||
translation_key="zoom",
|
translation_key="zoom",
|
||||||
icon="mdi:magnify",
|
icon="mdi:magnify",
|
||||||
mode=NumberMode.SLIDER,
|
mode=NumberMode.SLIDER,
|
||||||
@ -53,6 +54,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="focus",
|
key="focus",
|
||||||
|
cmd_key="GetZoomFocus",
|
||||||
translation_key="focus",
|
translation_key="focus",
|
||||||
icon="mdi:focus-field",
|
icon="mdi:focus-field",
|
||||||
mode=NumberMode.SLIDER,
|
mode=NumberMode.SLIDER,
|
||||||
@ -68,6 +70,7 @@ NUMBER_ENTITIES = (
|
|||||||
# or when using the "light.floodlight" entity.
|
# or when using the "light.floodlight" entity.
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="floodlight_brightness",
|
key="floodlight_brightness",
|
||||||
|
cmd_key="GetWhiteLed",
|
||||||
translation_key="floodlight_brightness",
|
translation_key="floodlight_brightness",
|
||||||
icon="mdi:spotlight-beam",
|
icon="mdi:spotlight-beam",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -80,6 +83,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="volume",
|
key="volume",
|
||||||
|
cmd_key="GetAudioCfg",
|
||||||
translation_key="volume",
|
translation_key="volume",
|
||||||
icon="mdi:volume-high",
|
icon="mdi:volume-high",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -92,6 +96,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="guard_return_time",
|
key="guard_return_time",
|
||||||
|
cmd_key="GetPtzGuard",
|
||||||
translation_key="guard_return_time",
|
translation_key="guard_return_time",
|
||||||
icon="mdi:crosshairs-gps",
|
icon="mdi:crosshairs-gps",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -105,6 +110,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="motion_sensitivity",
|
key="motion_sensitivity",
|
||||||
|
cmd_key="GetMdAlarm",
|
||||||
translation_key="motion_sensitivity",
|
translation_key="motion_sensitivity",
|
||||||
icon="mdi:motion-sensor",
|
icon="mdi:motion-sensor",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -117,6 +123,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_face_sensititvity",
|
key="ai_face_sensititvity",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_face_sensititvity",
|
translation_key="ai_face_sensititvity",
|
||||||
icon="mdi:face-recognition",
|
icon="mdi:face-recognition",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -131,6 +138,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_person_sensititvity",
|
key="ai_person_sensititvity",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_person_sensititvity",
|
translation_key="ai_person_sensititvity",
|
||||||
icon="mdi:account",
|
icon="mdi:account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -145,6 +153,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_vehicle_sensititvity",
|
key="ai_vehicle_sensititvity",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_vehicle_sensititvity",
|
translation_key="ai_vehicle_sensititvity",
|
||||||
icon="mdi:car",
|
icon="mdi:car",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -159,6 +168,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_pet_sensititvity",
|
key="ai_pet_sensititvity",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_pet_sensititvity",
|
translation_key="ai_pet_sensititvity",
|
||||||
icon="mdi:dog-side",
|
icon="mdi:dog-side",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -175,6 +185,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_pet_sensititvity",
|
key="ai_pet_sensititvity",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_animal_sensititvity",
|
translation_key="ai_animal_sensititvity",
|
||||||
icon="mdi:paw",
|
icon="mdi:paw",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -189,6 +200,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_face_delay",
|
key="ai_face_delay",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_face_delay",
|
translation_key="ai_face_delay",
|
||||||
icon="mdi:face-recognition",
|
icon="mdi:face-recognition",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -205,6 +217,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_person_delay",
|
key="ai_person_delay",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_person_delay",
|
translation_key="ai_person_delay",
|
||||||
icon="mdi:account",
|
icon="mdi:account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -221,6 +234,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_vehicle_delay",
|
key="ai_vehicle_delay",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_vehicle_delay",
|
translation_key="ai_vehicle_delay",
|
||||||
icon="mdi:car",
|
icon="mdi:car",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -237,6 +251,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_pet_delay",
|
key="ai_pet_delay",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_pet_delay",
|
translation_key="ai_pet_delay",
|
||||||
icon="mdi:dog-side",
|
icon="mdi:dog-side",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -255,6 +270,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="ai_pet_delay",
|
key="ai_pet_delay",
|
||||||
|
cmd_key="GetAiAlarm",
|
||||||
translation_key="ai_animal_delay",
|
translation_key="ai_animal_delay",
|
||||||
icon="mdi:paw",
|
icon="mdi:paw",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -271,6 +287,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="auto_quick_reply_time",
|
key="auto_quick_reply_time",
|
||||||
|
cmd_key="GetAutoReply",
|
||||||
translation_key="auto_quick_reply_time",
|
translation_key="auto_quick_reply_time",
|
||||||
icon="mdi:message-reply-text-outline",
|
icon="mdi:message-reply-text-outline",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -284,6 +301,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="auto_track_limit_left",
|
key="auto_track_limit_left",
|
||||||
|
cmd_key="GetPtzTraceSection",
|
||||||
translation_key="auto_track_limit_left",
|
translation_key="auto_track_limit_left",
|
||||||
icon="mdi:angle-acute",
|
icon="mdi:angle-acute",
|
||||||
mode=NumberMode.SLIDER,
|
mode=NumberMode.SLIDER,
|
||||||
@ -297,6 +315,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="auto_track_limit_right",
|
key="auto_track_limit_right",
|
||||||
|
cmd_key="GetPtzTraceSection",
|
||||||
translation_key="auto_track_limit_right",
|
translation_key="auto_track_limit_right",
|
||||||
icon="mdi:angle-acute",
|
icon="mdi:angle-acute",
|
||||||
mode=NumberMode.SLIDER,
|
mode=NumberMode.SLIDER,
|
||||||
@ -310,6 +329,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="auto_track_disappear_time",
|
key="auto_track_disappear_time",
|
||||||
|
cmd_key="GetAiCfg",
|
||||||
translation_key="auto_track_disappear_time",
|
translation_key="auto_track_disappear_time",
|
||||||
icon="mdi:target-account",
|
icon="mdi:target-account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -325,6 +345,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="auto_track_stop_time",
|
key="auto_track_stop_time",
|
||||||
|
cmd_key="GetAiCfg",
|
||||||
translation_key="auto_track_stop_time",
|
translation_key="auto_track_stop_time",
|
||||||
icon="mdi:target-account",
|
icon="mdi:target-account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -338,6 +359,7 @@ NUMBER_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNumberEntityDescription(
|
ReolinkNumberEntityDescription(
|
||||||
key="day_night_switch_threshold",
|
key="day_night_switch_threshold",
|
||||||
|
cmd_key="GetIsp",
|
||||||
translation_key="day_night_switch_threshold",
|
translation_key="day_night_switch_threshold",
|
||||||
icon="mdi:theme-light-dark",
|
icon="mdi:theme-light-dark",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
@ -44,6 +44,7 @@ class ReolinkSelectEntityDescription(
|
|||||||
SELECT_ENTITIES = (
|
SELECT_ENTITIES = (
|
||||||
ReolinkSelectEntityDescription(
|
ReolinkSelectEntityDescription(
|
||||||
key="floodlight_mode",
|
key="floodlight_mode",
|
||||||
|
cmd_key="GetWhiteLed",
|
||||||
translation_key="floodlight_mode",
|
translation_key="floodlight_mode",
|
||||||
icon="mdi:spotlight-beam",
|
icon="mdi:spotlight-beam",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -54,6 +55,7 @@ SELECT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSelectEntityDescription(
|
ReolinkSelectEntityDescription(
|
||||||
key="day_night_mode",
|
key="day_night_mode",
|
||||||
|
cmd_key="GetIsp",
|
||||||
translation_key="day_night_mode",
|
translation_key="day_night_mode",
|
||||||
icon="mdi:theme-light-dark",
|
icon="mdi:theme-light-dark",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -72,6 +74,7 @@ SELECT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSelectEntityDescription(
|
ReolinkSelectEntityDescription(
|
||||||
key="auto_quick_reply_message",
|
key="auto_quick_reply_message",
|
||||||
|
cmd_key="GetAutoReply",
|
||||||
translation_key="auto_quick_reply_message",
|
translation_key="auto_quick_reply_message",
|
||||||
icon="mdi:message-reply-text-outline",
|
icon="mdi:message-reply-text-outline",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -84,6 +87,7 @@ SELECT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSelectEntityDescription(
|
ReolinkSelectEntityDescription(
|
||||||
key="auto_track_method",
|
key="auto_track_method",
|
||||||
|
cmd_key="GetAiCfg",
|
||||||
translation_key="auto_track_method",
|
translation_key="auto_track_method",
|
||||||
icon="mdi:target-account",
|
icon="mdi:target-account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -94,6 +98,7 @@ SELECT_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSelectEntityDescription(
|
ReolinkSelectEntityDescription(
|
||||||
key="status_led",
|
key="status_led",
|
||||||
|
cmd_key="GetPowerLed",
|
||||||
translation_key="status_led",
|
translation_key="status_led",
|
||||||
icon="mdi:lightning-bolt-circle",
|
icon="mdi:lightning-bolt-circle",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
@ -52,6 +52,7 @@ class ReolinkHostSensorEntityDescription(
|
|||||||
SENSORS = (
|
SENSORS = (
|
||||||
ReolinkSensorEntityDescription(
|
ReolinkSensorEntityDescription(
|
||||||
key="ptz_pan_position",
|
key="ptz_pan_position",
|
||||||
|
cmd_key="GetPtzCurPos",
|
||||||
translation_key="ptz_pan_position",
|
translation_key="ptz_pan_position",
|
||||||
icon="mdi:pan",
|
icon="mdi:pan",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
@ -64,6 +65,7 @@ SENSORS = (
|
|||||||
HOST_SENSORS = (
|
HOST_SENSORS = (
|
||||||
ReolinkHostSensorEntityDescription(
|
ReolinkHostSensorEntityDescription(
|
||||||
key="wifi_signal",
|
key="wifi_signal",
|
||||||
|
cmd_key="GetWifiSignal",
|
||||||
translation_key="wifi_signal",
|
translation_key="wifi_signal",
|
||||||
icon="mdi:wifi",
|
icon="mdi:wifi",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
@ -50,6 +50,7 @@ class ReolinkNVRSwitchEntityDescription(
|
|||||||
SWITCH_ENTITIES = (
|
SWITCH_ENTITIES = (
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="record_audio",
|
key="record_audio",
|
||||||
|
cmd_key="GetEnc",
|
||||||
translation_key="record_audio",
|
translation_key="record_audio",
|
||||||
icon="mdi:microphone",
|
icon="mdi:microphone",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -59,6 +60,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="siren_on_event",
|
key="siren_on_event",
|
||||||
|
cmd_key="GetAudioAlarm",
|
||||||
translation_key="siren_on_event",
|
translation_key="siren_on_event",
|
||||||
icon="mdi:alarm-light",
|
icon="mdi:alarm-light",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -68,6 +70,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="auto_tracking",
|
key="auto_tracking",
|
||||||
|
cmd_key="GetAiCfg",
|
||||||
translation_key="auto_tracking",
|
translation_key="auto_tracking",
|
||||||
icon="mdi:target-account",
|
icon="mdi:target-account",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -77,6 +80,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="auto_focus",
|
key="auto_focus",
|
||||||
|
cmd_key="GetAutoFocus",
|
||||||
translation_key="auto_focus",
|
translation_key="auto_focus",
|
||||||
icon="mdi:focus-field",
|
icon="mdi:focus-field",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -86,6 +90,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="gaurd_return",
|
key="gaurd_return",
|
||||||
|
cmd_key="GetPtzGuard",
|
||||||
translation_key="gaurd_return",
|
translation_key="gaurd_return",
|
||||||
icon="mdi:crosshairs-gps",
|
icon="mdi:crosshairs-gps",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -95,6 +100,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="email",
|
key="email",
|
||||||
|
cmd_key="GetEmail",
|
||||||
translation_key="email",
|
translation_key="email",
|
||||||
icon="mdi:email",
|
icon="mdi:email",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -104,6 +110,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="ftp_upload",
|
key="ftp_upload",
|
||||||
|
cmd_key="GetFtp",
|
||||||
translation_key="ftp_upload",
|
translation_key="ftp_upload",
|
||||||
icon="mdi:swap-horizontal",
|
icon="mdi:swap-horizontal",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -113,6 +120,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="push_notifications",
|
key="push_notifications",
|
||||||
|
cmd_key="GetPush",
|
||||||
translation_key="push_notifications",
|
translation_key="push_notifications",
|
||||||
icon="mdi:message-badge",
|
icon="mdi:message-badge",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -122,6 +130,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="record",
|
key="record",
|
||||||
|
cmd_key="GetRec",
|
||||||
translation_key="record",
|
translation_key="record",
|
||||||
icon="mdi:record-rec",
|
icon="mdi:record-rec",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -131,6 +140,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="buzzer",
|
key="buzzer",
|
||||||
|
cmd_key="GetBuzzerAlarmV20",
|
||||||
translation_key="buzzer",
|
translation_key="buzzer",
|
||||||
icon="mdi:room-service",
|
icon="mdi:room-service",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -140,6 +150,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="doorbell_button_sound",
|
key="doorbell_button_sound",
|
||||||
|
cmd_key="GetAudioCfg",
|
||||||
translation_key="doorbell_button_sound",
|
translation_key="doorbell_button_sound",
|
||||||
icon="mdi:volume-high",
|
icon="mdi:volume-high",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -149,6 +160,7 @@ SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkSwitchEntityDescription(
|
ReolinkSwitchEntityDescription(
|
||||||
key="hdr",
|
key="hdr",
|
||||||
|
cmd_key="GetIsp",
|
||||||
translation_key="hdr",
|
translation_key="hdr",
|
||||||
icon="mdi:hdr",
|
icon="mdi:hdr",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -162,6 +174,7 @@ SWITCH_ENTITIES = (
|
|||||||
NVR_SWITCH_ENTITIES = (
|
NVR_SWITCH_ENTITIES = (
|
||||||
ReolinkNVRSwitchEntityDescription(
|
ReolinkNVRSwitchEntityDescription(
|
||||||
key="email",
|
key="email",
|
||||||
|
cmd_key="GetEmail",
|
||||||
translation_key="email",
|
translation_key="email",
|
||||||
icon="mdi:email",
|
icon="mdi:email",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -171,6 +184,7 @@ NVR_SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNVRSwitchEntityDescription(
|
ReolinkNVRSwitchEntityDescription(
|
||||||
key="ftp_upload",
|
key="ftp_upload",
|
||||||
|
cmd_key="GetFtp",
|
||||||
translation_key="ftp_upload",
|
translation_key="ftp_upload",
|
||||||
icon="mdi:swap-horizontal",
|
icon="mdi:swap-horizontal",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -180,6 +194,7 @@ NVR_SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNVRSwitchEntityDescription(
|
ReolinkNVRSwitchEntityDescription(
|
||||||
key="push_notifications",
|
key="push_notifications",
|
||||||
|
cmd_key="GetPush",
|
||||||
translation_key="push_notifications",
|
translation_key="push_notifications",
|
||||||
icon="mdi:message-badge",
|
icon="mdi:message-badge",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -189,6 +204,7 @@ NVR_SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNVRSwitchEntityDescription(
|
ReolinkNVRSwitchEntityDescription(
|
||||||
key="record",
|
key="record",
|
||||||
|
cmd_key="GetRec",
|
||||||
translation_key="record",
|
translation_key="record",
|
||||||
icon="mdi:record-rec",
|
icon="mdi:record-rec",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
@ -198,6 +214,7 @@ NVR_SWITCH_ENTITIES = (
|
|||||||
),
|
),
|
||||||
ReolinkNVRSwitchEntityDescription(
|
ReolinkNVRSwitchEntityDescription(
|
||||||
key="buzzer",
|
key="buzzer",
|
||||||
|
cmd_key="GetBuzzerAlarmV20",
|
||||||
translation_key="buzzer",
|
translation_key="buzzer",
|
||||||
icon="mdi:room-service",
|
icon="mdi:room-service",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user