Add Reolink post recording time select entity (#149201)

Co-authored-by: Norbert Rittel <norbert@rittel.de>
This commit is contained in:
starkillerOG 2025-07-21 22:48:02 +02:00 committed by GitHub
parent b6014da121
commit ecb6cc50b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 0 deletions

View File

@ -389,6 +389,9 @@
},
"packing_time": {
"default": "mdi:record-rec"
},
"post_rec_time": {
"default": "mdi:record-rec"
}
},
"sensor": {

View File

@ -250,6 +250,17 @@ SELECT_ENTITIES = (
value=lambda api, ch: str(api.bit_rate(ch, "sub")),
method=lambda api, ch, value: api.set_bit_rate(ch, int(value), "sub"),
),
ReolinkSelectEntityDescription(
key="post_rec_time",
cmd_key="GetRec",
translation_key="post_rec_time",
entity_category=EntityCategory.CONFIG,
entity_registry_enabled_default=False,
get_options=lambda api, ch: api.post_recording_time_list(ch),
supported=lambda api, ch: api.supported(ch, "post_rec_time"),
value=lambda api, ch: api.post_recording_time(ch),
method=lambda api, ch, value: api.set_post_recording_time(ch, value),
),
)
HOST_SELECT_ENTITIES = (

View File

@ -857,6 +857,9 @@
},
"packing_time": {
"name": "Recording packing time"
},
"post_rec_time": {
"name": "Post-recording time"
}
},
"sensor": {

View File

@ -125,6 +125,7 @@ def _init_host_mock(host_mock: MagicMock) -> None:
host_mock.wifi_connection = False
host_mock.wifi_signal.return_value = -45
host_mock.whiteled_mode_list.return_value = []
host_mock.post_recording_time_list.return_value = []
host_mock.zoom_range.return_value = {
"zoom": {"pos": {"min": 0, "max": 100}},
"focus": {"pos": {"min": 0, "max": 100}},