mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Reolink fix privacy mode availability for NVR IPC cams (#144569)
* Correct "available" for IPC cams * Check privacy mode when updating
This commit is contained in:
parent
356775c19b
commit
e892744328
@ -198,7 +198,14 @@ class ReolinkChannelCoordinatorEntity(ReolinkHostCoordinatorEntity):
|
||||
@property
|
||||
def available(self) -> bool:
|
||||
"""Return True if entity is available."""
|
||||
return super().available and self._host.api.camera_online(self._channel)
|
||||
if self.entity_description.always_available:
|
||||
return True
|
||||
|
||||
return (
|
||||
super().available
|
||||
and self._host.api.camera_online(self._channel)
|
||||
and not self._host.api.baichuan.privacy_mode(self._channel)
|
||||
)
|
||||
|
||||
def register_callback(self, callback_id: str, cmd_id: int) -> None:
|
||||
"""Register callback for TCP push events."""
|
||||
|
@ -465,10 +465,11 @@ class ReolinkHost:
|
||||
wake = True
|
||||
self.last_wake = time()
|
||||
|
||||
for channel in self._api.channels:
|
||||
if self._api.baichuan.privacy_mode(channel):
|
||||
await self._api.baichuan.get_privacy_mode(channel)
|
||||
if self._api.baichuan.privacy_mode():
|
||||
await self._api.baichuan.get_privacy_mode()
|
||||
if self._api.baichuan.privacy_mode():
|
||||
return # API is shutdown, no need to check states
|
||||
return # API is shutdown, no need to check states
|
||||
|
||||
await self._api.get_states(cmd_list=self.update_cmd, wake=wake)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user