Use UID instead of MAC or channel for unique_ID in Reolink (#119744)

This commit is contained in:
starkillerOG 2024-06-21 20:27:30 +02:00 committed by GitHub
parent d6be733287
commit 8b4a5042bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 213 additions and 28 deletions

View file

@ -164,10 +164,14 @@ class ReolinkVODMediaSource(MediaSource):
continue
device = device_reg.async_get(entity.device_id)
ch = entity.unique_id.split("_")[1]
if ch in channels or device is None:
ch_id = entity.unique_id.split("_")[1]
if ch_id in channels or device is None:
continue
channels.append(ch)
channels.append(ch_id)
ch: int | str = ch_id
if len(ch_id) > 3:
ch = host.api.channel_for_uid(ch_id)
if (
host.api.api_version("recReplay", int(ch)) < 1