mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add icon translations to Reolink (#112208)
* Add icon translations to Reolink * Fix * Update homeassistant/components/reolink/icons.json Co-authored-by: starkillerOG <starkiller.og@gmail.com> * Update homeassistant/components/reolink/icons.json --------- Co-authored-by: starkillerOG <starkiller.og@gmail.com>
This commit is contained in:
parent
2599252600
commit
09b1b40833
@ -36,8 +36,6 @@ class ReolinkBinarySensorEntityDescription(
|
||||
):
|
||||
"""A class that describes binary sensor entities."""
|
||||
|
||||
icon_off: str = "mdi:motion-sensor-off"
|
||||
icon: str = "mdi:motion-sensor"
|
||||
value: Callable[[Host, int], bool]
|
||||
|
||||
|
||||
@ -50,7 +48,6 @@ BINARY_SENSORS = (
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=FACE_DETECTION_TYPE,
|
||||
translation_key="face",
|
||||
icon="mdi:face-recognition",
|
||||
value=lambda api, ch: api.ai_detected(ch, FACE_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.ai_supported(ch, FACE_DETECTION_TYPE),
|
||||
),
|
||||
@ -63,16 +60,12 @@ BINARY_SENSORS = (
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=VEHICLE_DETECTION_TYPE,
|
||||
translation_key="vehicle",
|
||||
icon="mdi:car",
|
||||
icon_off="mdi:car-off",
|
||||
value=lambda api, ch: api.ai_detected(ch, VEHICLE_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.ai_supported(ch, VEHICLE_DETECTION_TYPE),
|
||||
),
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=PET_DETECTION_TYPE,
|
||||
translation_key="pet",
|
||||
icon="mdi:dog-side",
|
||||
icon_off="mdi:dog-side-off",
|
||||
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
|
||||
supported=lambda api, ch: (
|
||||
api.ai_supported(ch, PET_DETECTION_TYPE)
|
||||
@ -82,24 +75,18 @@ BINARY_SENSORS = (
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=PET_DETECTION_TYPE,
|
||||
translation_key="animal",
|
||||
icon="mdi:paw",
|
||||
icon_off="mdi:paw-off",
|
||||
value=lambda api, ch: api.ai_detected(ch, PET_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.supported(ch, "ai_animal"),
|
||||
),
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key=PACKAGE_DETECTION_TYPE,
|
||||
translation_key="package",
|
||||
icon="mdi:gift-outline",
|
||||
icon_off="mdi:gift-off-outline",
|
||||
value=lambda api, ch: api.ai_detected(ch, PACKAGE_DETECTION_TYPE),
|
||||
supported=lambda api, ch: api.ai_supported(ch, PACKAGE_DETECTION_TYPE),
|
||||
),
|
||||
ReolinkBinarySensorEntityDescription(
|
||||
key="visitor",
|
||||
translation_key="visitor",
|
||||
icon="mdi:bell-ring-outline",
|
||||
icon_off="mdi:doorbell",
|
||||
value=lambda api, ch: api.visitor_detected(ch),
|
||||
supported=lambda api, ch: api.is_doorbell(ch),
|
||||
),
|
||||
@ -149,13 +136,6 @@ class ReolinkBinarySensorEntity(ReolinkChannelCoordinatorEntity, BinarySensorEnt
|
||||
key = entity_description.key
|
||||
self._attr_translation_key = f"{key}_lens_{self._channel}"
|
||||
|
||||
@property
|
||||
def icon(self) -> str | None:
|
||||
"""Icon of the sensor."""
|
||||
if self.is_on is False:
|
||||
return self.entity_description.icon_off
|
||||
return super().icon
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
"""State of the sensor."""
|
||||
|
@ -64,7 +64,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_stop",
|
||||
translation_key="ptz_stop",
|
||||
icon="mdi:pan",
|
||||
enabled_default=lambda api, ch: api.supported(ch, "pan_tilt"),
|
||||
supported=lambda api, ch: (
|
||||
api.supported(ch, "pan_tilt") or api.supported(ch, "zoom_basic")
|
||||
@ -74,7 +73,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_left",
|
||||
translation_key="ptz_left",
|
||||
icon="mdi:pan",
|
||||
supported=lambda api, ch: api.supported(ch, "pan"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.left.value),
|
||||
ptz_cmd=PtzEnum.left.value,
|
||||
@ -82,7 +80,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_right",
|
||||
translation_key="ptz_right",
|
||||
icon="mdi:pan",
|
||||
supported=lambda api, ch: api.supported(ch, "pan"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.right.value),
|
||||
ptz_cmd=PtzEnum.right.value,
|
||||
@ -90,7 +87,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_up",
|
||||
translation_key="ptz_up",
|
||||
icon="mdi:pan",
|
||||
supported=lambda api, ch: api.supported(ch, "tilt"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.up.value),
|
||||
ptz_cmd=PtzEnum.up.value,
|
||||
@ -98,7 +94,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_down",
|
||||
translation_key="ptz_down",
|
||||
icon="mdi:pan",
|
||||
supported=lambda api, ch: api.supported(ch, "tilt"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.down.value),
|
||||
ptz_cmd=PtzEnum.down.value,
|
||||
@ -106,7 +101,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_zoom_in",
|
||||
translation_key="ptz_zoom_in",
|
||||
icon="mdi:magnify",
|
||||
entity_registry_enabled_default=False,
|
||||
supported=lambda api, ch: api.supported(ch, "zoom_basic"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.zoomin.value),
|
||||
@ -115,7 +109,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_zoom_out",
|
||||
translation_key="ptz_zoom_out",
|
||||
icon="mdi:magnify",
|
||||
entity_registry_enabled_default=False,
|
||||
supported=lambda api, ch: api.supported(ch, "zoom_basic"),
|
||||
method=lambda api, ch: api.set_ptz_command(ch, command=PtzEnum.zoomout.value),
|
||||
@ -124,7 +117,6 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="ptz_calibrate",
|
||||
translation_key="ptz_calibrate",
|
||||
icon="mdi:pan",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_callibrate"),
|
||||
method=lambda api, ch: api.ptz_callibrate(ch),
|
||||
@ -132,14 +124,12 @@ BUTTON_ENTITIES = (
|
||||
ReolinkButtonEntityDescription(
|
||||
key="guard_go_to",
|
||||
translation_key="guard_go_to",
|
||||
icon="mdi:crosshairs-gps",
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_guard"),
|
||||
method=lambda api, ch: api.set_ptz_guard(ch, command=GuardEnum.goto.value),
|
||||
),
|
||||
ReolinkButtonEntityDescription(
|
||||
key="guard_set",
|
||||
translation_key="guard_set",
|
||||
icon="mdi:crosshairs-gps",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_guard"),
|
||||
method=lambda api, ch: api.set_ptz_guard(ch, command=GuardEnum.set.value),
|
||||
|
260
homeassistant/components/reolink/icons.json
Normal file
260
homeassistant/components/reolink/icons.json
Normal file
@ -0,0 +1,260 @@
|
||||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"face": {
|
||||
"default": "mdi:motion-sensor-off",
|
||||
"state": {
|
||||
"on": "mdi:face-recognition"
|
||||
}
|
||||
},
|
||||
"vehicle": {
|
||||
"default": "mdi:car-off",
|
||||
"state": {
|
||||
"on": "mdi:car"
|
||||
}
|
||||
},
|
||||
"pet": {
|
||||
"default": "mdi:dog-side-off",
|
||||
"state": {
|
||||
"on": "mdi:dog-side"
|
||||
}
|
||||
},
|
||||
"animal": {
|
||||
"default": "mdi:paw-off",
|
||||
"state": {
|
||||
"on": "mdi:paw"
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
"default": "mdi:gift-off-outline",
|
||||
"state": {
|
||||
"on": "mdi:gift-outline"
|
||||
}
|
||||
},
|
||||
"visitor": {
|
||||
"default": "mdi:doorbell",
|
||||
"state": {
|
||||
"on": "mdi:bell-ring-outline"
|
||||
}
|
||||
},
|
||||
"person": {
|
||||
"default": "mdi:motion-sensor-off",
|
||||
"state": {
|
||||
"on": "mdi:motion-sensor"
|
||||
}
|
||||
}
|
||||
},
|
||||
"button": {
|
||||
"ptz_stop": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"ptz_left": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"ptz_right": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"ptz_up": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"ptz_down": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"ptz_zoom_in": {
|
||||
"default": "mdi:magnify"
|
||||
},
|
||||
"ptz_zoom_out": {
|
||||
"default": "mdi:magnify"
|
||||
},
|
||||
"ptz_calibrate": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"guard_go_to": {
|
||||
"default": "mdi:crosshairs-gps"
|
||||
},
|
||||
"guard_set": {
|
||||
"default": "mdi:crosshairs-gps"
|
||||
}
|
||||
},
|
||||
"light": {
|
||||
"floodlight": {
|
||||
"default": "mdi:spotlight-beam"
|
||||
},
|
||||
"status_led": {
|
||||
"default": "mdi:lightning-bolt-circle"
|
||||
}
|
||||
},
|
||||
"number": {
|
||||
"zoom": {
|
||||
"default": "mdi:magnify"
|
||||
},
|
||||
"focus": {
|
||||
"default": "mdi:focus-field"
|
||||
},
|
||||
"floodlight_brightness": {
|
||||
"default": "mdi:spotlight-beam"
|
||||
},
|
||||
"volume": {
|
||||
"default": "mdi:volume-high"
|
||||
},
|
||||
"guard_return_time": {
|
||||
"default": "mdi:crosshairs-gps"
|
||||
},
|
||||
"motion_sensitivity": {
|
||||
"default": "mdi:motion-sensor"
|
||||
},
|
||||
"ai_face_sensititvity": {
|
||||
"default": "mdi:face-recognition"
|
||||
},
|
||||
"ai_person_sensititvity": {
|
||||
"default": "mdi:account"
|
||||
},
|
||||
"ai_vehicle_sensititvity": {
|
||||
"default": "mdi:car"
|
||||
},
|
||||
"ai_package_sensititvity": {
|
||||
"default": "mdi:gift-outline"
|
||||
},
|
||||
"ai_pet_sensititvity": {
|
||||
"default": "mdi:dog-side"
|
||||
},
|
||||
"ai_animal_sensititvity": {
|
||||
"default": "mdi:paw"
|
||||
},
|
||||
"ai_face_delay": {
|
||||
"default": "mdi:face-recognition"
|
||||
},
|
||||
"ai_person_delay": {
|
||||
"default": "mdi:account"
|
||||
},
|
||||
"ai_vehicle_delay": {
|
||||
"default": "mdi:car"
|
||||
},
|
||||
"ai_package_delay": {
|
||||
"default": "mdi:gift-outline"
|
||||
},
|
||||
"ai_pet_delay": {
|
||||
"default": "mdi:dog-side"
|
||||
},
|
||||
"ai_animal_delay": {
|
||||
"default": "mdi:paw"
|
||||
},
|
||||
"auto_quick_reply_time": {
|
||||
"default": "mdi:message-reply-text-outline"
|
||||
},
|
||||
"auto_track_limit_left": {
|
||||
"default": "mdi:angle-acute"
|
||||
},
|
||||
"auto_track_limit_right": {
|
||||
"default": "mdi:angle-acute"
|
||||
},
|
||||
"auto_track_disappear_time": {
|
||||
"default": "mdi:target-account"
|
||||
},
|
||||
"auto_track_stop_time": {
|
||||
"default": "mdi:target-account"
|
||||
},
|
||||
"day_night_switch_threshold": {
|
||||
"default": "mdi:theme-light-dark"
|
||||
},
|
||||
"image_brightness": {
|
||||
"default": "mdi:image-edit"
|
||||
},
|
||||
"image_contrast": {
|
||||
"default": "mdi:image-edit"
|
||||
},
|
||||
"image_saturation": {
|
||||
"default": "mdi:image-edit"
|
||||
},
|
||||
"image_sharpness": {
|
||||
"default": "mdi:image-edit"
|
||||
},
|
||||
"image_hue": {
|
||||
"default": "mdi:image-edit"
|
||||
}
|
||||
},
|
||||
"select": {
|
||||
"floodlight_mode": {
|
||||
"default": "mdi:spotlight-beam"
|
||||
},
|
||||
"day_night_mode": {
|
||||
"default": "mdi:theme-light-dark"
|
||||
},
|
||||
"ptz_preset": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"play_quick_reply_message": {
|
||||
"default": "mdi:message-reply-text-outline"
|
||||
},
|
||||
"auto_quick_reply_message": {
|
||||
"default": "mdi:message-reply-text-outline"
|
||||
},
|
||||
"auto_track_method": {
|
||||
"default": "mdi:target-account"
|
||||
},
|
||||
"status_led": {
|
||||
"default": "mdi:lightning-bolt-circle"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"ptz_pan_position": {
|
||||
"default": "mdi:pan"
|
||||
},
|
||||
"wifi_signal": {
|
||||
"default": "mdi:wifi"
|
||||
}
|
||||
},
|
||||
"siren": {
|
||||
"siren": {
|
||||
"default": "mdi:alarm-light"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"ir_lights": {
|
||||
"default": "mdi:led-off"
|
||||
},
|
||||
"record_audio": {
|
||||
"default": "mdi:microphone"
|
||||
},
|
||||
"siren_on_event": {
|
||||
"default": "mdi:alarm-light"
|
||||
},
|
||||
"auto_tracking": {
|
||||
"default": "mdi:target-account"
|
||||
},
|
||||
"auto_focus": {
|
||||
"default": "mdi:focus-field"
|
||||
},
|
||||
"gaurd_return": {
|
||||
"default": "mdi:crosshairs-gps"
|
||||
},
|
||||
"ptz_patrol": {
|
||||
"default": "mdi:map-marker-path"
|
||||
},
|
||||
"email": {
|
||||
"default": "mdi:email"
|
||||
},
|
||||
"ftp_upload": {
|
||||
"default": "mdi:swap-horizontal"
|
||||
},
|
||||
"push_notifications": {
|
||||
"default": "mdi:message-badge"
|
||||
},
|
||||
"record": {
|
||||
"default": "mdi:record-rec"
|
||||
},
|
||||
"buzzer": {
|
||||
"default": "mdi:room-service"
|
||||
},
|
||||
"doorbell_button_sound": {
|
||||
"default": "mdi:volume-high"
|
||||
},
|
||||
"hdr": {
|
||||
"default": "mdi:hdr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"ptz_move": "mdi:pan"
|
||||
}
|
||||
}
|
@ -43,7 +43,6 @@ LIGHT_ENTITIES = (
|
||||
key="floodlight",
|
||||
cmd_key="GetWhiteLed",
|
||||
translation_key="floodlight",
|
||||
icon="mdi:spotlight-beam",
|
||||
supported=lambda api, ch: api.supported(ch, "floodLight"),
|
||||
is_on_fn=lambda api, ch: api.whiteled_state(ch),
|
||||
turn_on_off_fn=lambda api, ch, value: api.set_whiteled(ch, state=value),
|
||||
@ -54,7 +53,6 @@ LIGHT_ENTITIES = (
|
||||
key="status_led",
|
||||
cmd_key="GetPowerLed",
|
||||
translation_key="status_led",
|
||||
icon="mdi:lightning-bolt-circle",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "power_led"),
|
||||
is_on_fn=lambda api, ch: api.status_led_enabled(ch),
|
||||
|
@ -43,7 +43,6 @@ NUMBER_ENTITIES = (
|
||||
key="zoom",
|
||||
cmd_key="GetZoomFocus",
|
||||
translation_key="zoom",
|
||||
icon="mdi:magnify",
|
||||
mode=NumberMode.SLIDER,
|
||||
native_step=1,
|
||||
get_min_value=lambda api, ch: api.zoom_range(ch)["zoom"]["pos"]["min"],
|
||||
@ -56,7 +55,6 @@ NUMBER_ENTITIES = (
|
||||
key="focus",
|
||||
cmd_key="GetZoomFocus",
|
||||
translation_key="focus",
|
||||
icon="mdi:focus-field",
|
||||
mode=NumberMode.SLIDER,
|
||||
native_step=1,
|
||||
get_min_value=lambda api, ch: api.zoom_range(ch)["focus"]["pos"]["min"],
|
||||
@ -72,7 +70,6 @@ NUMBER_ENTITIES = (
|
||||
key="floodlight_brightness",
|
||||
cmd_key="GetWhiteLed",
|
||||
translation_key="floodlight_brightness",
|
||||
icon="mdi:spotlight-beam",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=1,
|
||||
@ -85,7 +82,6 @@ NUMBER_ENTITIES = (
|
||||
key="volume",
|
||||
cmd_key="GetAudioCfg",
|
||||
translation_key="volume",
|
||||
icon="mdi:volume-high",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -98,7 +94,6 @@ NUMBER_ENTITIES = (
|
||||
key="guard_return_time",
|
||||
cmd_key="GetPtzGuard",
|
||||
translation_key="guard_return_time",
|
||||
icon="mdi:crosshairs-gps",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
@ -112,7 +107,6 @@ NUMBER_ENTITIES = (
|
||||
key="motion_sensitivity",
|
||||
cmd_key="GetMdAlarm",
|
||||
translation_key="motion_sensitivity",
|
||||
icon="mdi:motion-sensor",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=1,
|
||||
@ -125,7 +119,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_face_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_face_sensititvity",
|
||||
icon="mdi:face-recognition",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -140,7 +133,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_person_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_person_sensititvity",
|
||||
icon="mdi:account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -155,7 +147,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_vehicle_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_vehicle_sensititvity",
|
||||
icon="mdi:car",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -170,7 +161,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_package_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_package_sensititvity",
|
||||
icon="mdi:gift-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -185,7 +175,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_pet_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_pet_sensititvity",
|
||||
icon="mdi:dog-side",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -202,7 +191,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_pet_sensititvity",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_animal_sensititvity",
|
||||
icon="mdi:paw",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_min_value=0,
|
||||
@ -217,7 +205,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_face_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_face_delay",
|
||||
icon="mdi:face-recognition",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -234,7 +221,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_person_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_person_delay",
|
||||
icon="mdi:account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -251,7 +237,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_vehicle_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_vehicle_delay",
|
||||
icon="mdi:car",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -268,7 +253,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_package_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_package_delay",
|
||||
icon="mdi:gift-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -285,7 +269,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_pet_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_pet_delay",
|
||||
icon="mdi:dog-side",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -304,7 +287,6 @@ NUMBER_ENTITIES = (
|
||||
key="ai_pet_delay",
|
||||
cmd_key="GetAiAlarm",
|
||||
translation_key="ai_animal_delay",
|
||||
icon="mdi:paw",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -321,7 +303,6 @@ NUMBER_ENTITIES = (
|
||||
key="auto_quick_reply_time",
|
||||
cmd_key="GetAutoReply",
|
||||
translation_key="auto_quick_reply_time",
|
||||
icon="mdi:message-reply-text-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
@ -335,7 +316,6 @@ NUMBER_ENTITIES = (
|
||||
key="auto_track_limit_left",
|
||||
cmd_key="GetPtzTraceSection",
|
||||
translation_key="auto_track_limit_left",
|
||||
icon="mdi:angle-acute",
|
||||
mode=NumberMode.SLIDER,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
@ -349,7 +329,6 @@ NUMBER_ENTITIES = (
|
||||
key="auto_track_limit_right",
|
||||
cmd_key="GetPtzTraceSection",
|
||||
translation_key="auto_track_limit_right",
|
||||
icon="mdi:angle-acute",
|
||||
mode=NumberMode.SLIDER,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
@ -363,7 +342,6 @@ NUMBER_ENTITIES = (
|
||||
key="auto_track_disappear_time",
|
||||
cmd_key="GetAiCfg",
|
||||
translation_key="auto_track_disappear_time",
|
||||
icon="mdi:target-account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
@ -379,7 +357,6 @@ NUMBER_ENTITIES = (
|
||||
key="auto_track_stop_time",
|
||||
cmd_key="GetAiCfg",
|
||||
translation_key="auto_track_stop_time",
|
||||
icon="mdi:target-account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
native_step=1,
|
||||
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||
@ -393,7 +370,6 @@ NUMBER_ENTITIES = (
|
||||
key="day_night_switch_threshold",
|
||||
cmd_key="GetIsp",
|
||||
translation_key="day_night_switch_threshold",
|
||||
icon="mdi:theme-light-dark",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -407,7 +383,6 @@ NUMBER_ENTITIES = (
|
||||
key="image_brightness",
|
||||
cmd_key="GetImage",
|
||||
translation_key="image_brightness",
|
||||
icon="mdi:image-edit",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -421,7 +396,6 @@ NUMBER_ENTITIES = (
|
||||
key="image_contrast",
|
||||
cmd_key="GetImage",
|
||||
translation_key="image_contrast",
|
||||
icon="mdi:image-edit",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -435,7 +409,6 @@ NUMBER_ENTITIES = (
|
||||
key="image_saturation",
|
||||
cmd_key="GetImage",
|
||||
translation_key="image_saturation",
|
||||
icon="mdi:image-edit",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -449,7 +422,6 @@ NUMBER_ENTITIES = (
|
||||
key="image_sharpness",
|
||||
cmd_key="GetImage",
|
||||
translation_key="image_sharpness",
|
||||
icon="mdi:image-edit",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
@ -463,7 +435,6 @@ NUMBER_ENTITIES = (
|
||||
key="image_hue",
|
||||
cmd_key="GetImage",
|
||||
translation_key="image_hue",
|
||||
icon="mdi:image-edit",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
native_step=1,
|
||||
|
@ -51,7 +51,6 @@ SELECT_ENTITIES = (
|
||||
key="floodlight_mode",
|
||||
cmd_key="GetWhiteLed",
|
||||
translation_key="floodlight_mode",
|
||||
icon="mdi:spotlight-beam",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=lambda api, ch: api.whiteled_mode_list(ch),
|
||||
supported=lambda api, ch: api.supported(ch, "floodLight"),
|
||||
@ -62,7 +61,6 @@ SELECT_ENTITIES = (
|
||||
key="day_night_mode",
|
||||
cmd_key="GetIsp",
|
||||
translation_key="day_night_mode",
|
||||
icon="mdi:theme-light-dark",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=[mode.name for mode in DayNightEnum],
|
||||
supported=lambda api, ch: api.supported(ch, "dayNight"),
|
||||
@ -72,7 +70,6 @@ SELECT_ENTITIES = (
|
||||
ReolinkSelectEntityDescription(
|
||||
key="ptz_preset",
|
||||
translation_key="ptz_preset",
|
||||
icon="mdi:pan",
|
||||
get_options=lambda api, ch: list(api.ptz_presets(ch)),
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_presets"),
|
||||
method=lambda api, ch, name: api.set_ptz_command(ch, preset=name),
|
||||
@ -80,7 +77,6 @@ SELECT_ENTITIES = (
|
||||
ReolinkSelectEntityDescription(
|
||||
key="play_quick_reply_message",
|
||||
translation_key="play_quick_reply_message",
|
||||
icon="mdi:message-reply-text-outline",
|
||||
get_options=lambda api, ch: list(api.quick_reply_dict(ch).values())[1:],
|
||||
supported=lambda api, ch: api.supported(ch, "play_quick_reply"),
|
||||
method=lambda api, ch, mess: (
|
||||
@ -91,7 +87,6 @@ SELECT_ENTITIES = (
|
||||
key="auto_quick_reply_message",
|
||||
cmd_key="GetAutoReply",
|
||||
translation_key="auto_quick_reply_message",
|
||||
icon="mdi:message-reply-text-outline",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=lambda api, ch: list(api.quick_reply_dict(ch).values()),
|
||||
supported=lambda api, ch: api.supported(ch, "quick_reply"),
|
||||
@ -104,7 +99,6 @@ SELECT_ENTITIES = (
|
||||
key="auto_track_method",
|
||||
cmd_key="GetAiCfg",
|
||||
translation_key="auto_track_method",
|
||||
icon="mdi:target-account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=[method.name for method in TrackMethodEnum],
|
||||
supported=lambda api, ch: api.supported(ch, "auto_track_method"),
|
||||
@ -115,7 +109,6 @@ SELECT_ENTITIES = (
|
||||
key="status_led",
|
||||
cmd_key="GetPowerLed",
|
||||
translation_key="status_led",
|
||||
icon="mdi:lightning-bolt-circle",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
get_options=[state.name for state in StatusLedEnum],
|
||||
supported=lambda api, ch: api.supported(ch, "doorbell_led"),
|
||||
|
@ -54,7 +54,6 @@ SENSORS = (
|
||||
key="ptz_pan_position",
|
||||
cmd_key="GetPtzCurPos",
|
||||
translation_key="ptz_pan_position",
|
||||
icon="mdi:pan",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
value=lambda api, ch: api.ptz_pan_position(ch),
|
||||
@ -67,7 +66,6 @@ HOST_SENSORS = (
|
||||
key="wifi_signal",
|
||||
cmd_key="GetWifiSignal",
|
||||
translation_key="wifi_signal",
|
||||
icon="mdi:wifi",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
entity_registry_enabled_default=False,
|
||||
|
@ -34,7 +34,6 @@ SIREN_ENTITIES = (
|
||||
ReolinkSirenEntityDescription(
|
||||
key="siren",
|
||||
translation_key="siren",
|
||||
icon="mdi:alarm-light",
|
||||
supported=lambda api, ch: api.supported(ch, "siren_play"),
|
||||
),
|
||||
)
|
||||
|
@ -52,7 +52,6 @@ SWITCH_ENTITIES = (
|
||||
key="ir_lights",
|
||||
cmd_key="GetIrLights",
|
||||
translation_key="ir_lights",
|
||||
icon="mdi:led-off",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "ir_lights"),
|
||||
value=lambda api, ch: api.ir_enabled(ch),
|
||||
@ -62,7 +61,6 @@ SWITCH_ENTITIES = (
|
||||
key="record_audio",
|
||||
cmd_key="GetEnc",
|
||||
translation_key="record_audio",
|
||||
icon="mdi:microphone",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "audio"),
|
||||
value=lambda api, ch: api.audio_record(ch),
|
||||
@ -72,7 +70,6 @@ SWITCH_ENTITIES = (
|
||||
key="siren_on_event",
|
||||
cmd_key="GetAudioAlarm",
|
||||
translation_key="siren_on_event",
|
||||
icon="mdi:alarm-light",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "siren"),
|
||||
value=lambda api, ch: api.audio_alarm_enabled(ch),
|
||||
@ -82,7 +79,6 @@ SWITCH_ENTITIES = (
|
||||
key="auto_tracking",
|
||||
cmd_key="GetAiCfg",
|
||||
translation_key="auto_tracking",
|
||||
icon="mdi:target-account",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "auto_track"),
|
||||
value=lambda api, ch: api.auto_track_enabled(ch),
|
||||
@ -92,7 +88,6 @@ SWITCH_ENTITIES = (
|
||||
key="auto_focus",
|
||||
cmd_key="GetAutoFocus",
|
||||
translation_key="auto_focus",
|
||||
icon="mdi:focus-field",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "auto_focus"),
|
||||
value=lambda api, ch: api.autofocus_enabled(ch),
|
||||
@ -102,7 +97,6 @@ SWITCH_ENTITIES = (
|
||||
key="gaurd_return",
|
||||
cmd_key="GetPtzGuard",
|
||||
translation_key="gaurd_return",
|
||||
icon="mdi:crosshairs-gps",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_guard"),
|
||||
value=lambda api, ch: api.ptz_guard_enabled(ch),
|
||||
@ -111,7 +105,6 @@ SWITCH_ENTITIES = (
|
||||
ReolinkSwitchEntityDescription(
|
||||
key="ptz_patrol",
|
||||
translation_key="ptz_patrol",
|
||||
icon="mdi:map-marker-path",
|
||||
supported=lambda api, ch: api.supported(ch, "ptz_patrol"),
|
||||
value=lambda api, ch: None,
|
||||
method=lambda api, ch, value: api.ctrl_ptz_patrol(ch, value),
|
||||
@ -120,7 +113,6 @@ SWITCH_ENTITIES = (
|
||||
key="email",
|
||||
cmd_key="GetEmail",
|
||||
translation_key="email",
|
||||
icon="mdi:email",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "email") and api.is_nvr,
|
||||
value=lambda api, ch: api.email_enabled(ch),
|
||||
@ -130,7 +122,6 @@ SWITCH_ENTITIES = (
|
||||
key="ftp_upload",
|
||||
cmd_key="GetFtp",
|
||||
translation_key="ftp_upload",
|
||||
icon="mdi:swap-horizontal",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "ftp") and api.is_nvr,
|
||||
value=lambda api, ch: api.ftp_enabled(ch),
|
||||
@ -140,7 +131,6 @@ SWITCH_ENTITIES = (
|
||||
key="push_notifications",
|
||||
cmd_key="GetPush",
|
||||
translation_key="push_notifications",
|
||||
icon="mdi:message-badge",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "push") and api.is_nvr,
|
||||
value=lambda api, ch: api.push_enabled(ch),
|
||||
@ -150,7 +140,6 @@ SWITCH_ENTITIES = (
|
||||
key="record",
|
||||
cmd_key="GetRec",
|
||||
translation_key="record",
|
||||
icon="mdi:record-rec",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "recording") and api.is_nvr,
|
||||
value=lambda api, ch: api.recording_enabled(ch),
|
||||
@ -160,7 +149,6 @@ SWITCH_ENTITIES = (
|
||||
key="buzzer",
|
||||
cmd_key="GetBuzzerAlarmV20",
|
||||
translation_key="buzzer",
|
||||
icon="mdi:room-service",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "buzzer") and api.is_nvr,
|
||||
value=lambda api, ch: api.buzzer_enabled(ch),
|
||||
@ -170,7 +158,6 @@ SWITCH_ENTITIES = (
|
||||
key="doorbell_button_sound",
|
||||
cmd_key="GetAudioCfg",
|
||||
translation_key="doorbell_button_sound",
|
||||
icon="mdi:volume-high",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api, ch: api.supported(ch, "doorbell_button_sound"),
|
||||
value=lambda api, ch: api.doorbell_button_sound(ch),
|
||||
@ -180,7 +167,6 @@ SWITCH_ENTITIES = (
|
||||
key="hdr",
|
||||
cmd_key="GetIsp",
|
||||
translation_key="hdr",
|
||||
icon="mdi:hdr",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
entity_registry_enabled_default=False,
|
||||
supported=lambda api, ch: api.supported(ch, "HDR"),
|
||||
@ -194,7 +180,6 @@ NVR_SWITCH_ENTITIES = (
|
||||
key="email",
|
||||
cmd_key="GetEmail",
|
||||
translation_key="email",
|
||||
icon="mdi:email",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api: api.supported(None, "email"),
|
||||
value=lambda api: api.email_enabled(),
|
||||
@ -204,7 +189,6 @@ NVR_SWITCH_ENTITIES = (
|
||||
key="ftp_upload",
|
||||
cmd_key="GetFtp",
|
||||
translation_key="ftp_upload",
|
||||
icon="mdi:swap-horizontal",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api: api.supported(None, "ftp"),
|
||||
value=lambda api: api.ftp_enabled(),
|
||||
@ -214,7 +198,6 @@ NVR_SWITCH_ENTITIES = (
|
||||
key="push_notifications",
|
||||
cmd_key="GetPush",
|
||||
translation_key="push_notifications",
|
||||
icon="mdi:message-badge",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api: api.supported(None, "push"),
|
||||
value=lambda api: api.push_enabled(),
|
||||
@ -224,7 +207,6 @@ NVR_SWITCH_ENTITIES = (
|
||||
key="record",
|
||||
cmd_key="GetRec",
|
||||
translation_key="record",
|
||||
icon="mdi:record-rec",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
supported=lambda api: api.supported(None, "recording"),
|
||||
value=lambda api: api.recording_enabled(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user