Add UniFi Protect chime button/camera switch (#73195)
This commit is contained in:
parent
4435c641de
commit
4c45cb5c52
5 changed files with 81 additions and 7 deletions
|
@ -140,9 +140,9 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
|
|||
def _async_update_device_from_protect(self) -> None:
|
||||
super()._async_update_device_from_protect()
|
||||
self.channel = self.device.channels[self.channel.id]
|
||||
motion_enabled = self.device.recording_settings.enable_motion_detection
|
||||
self._attr_motion_detection_enabled = (
|
||||
self.device.state == StateType.CONNECTED
|
||||
and self.device.feature_flags.has_motion_zones
|
||||
motion_enabled if motion_enabled is not None else True
|
||||
)
|
||||
self._attr_is_recording = (
|
||||
self.device.state == StateType.CONNECTED and self.device.is_recording
|
||||
|
@ -171,3 +171,11 @@ class ProtectCamera(ProtectDeviceEntity, Camera):
|
|||
async def stream_source(self) -> str | None:
|
||||
"""Return the Stream Source."""
|
||||
return self._stream_source
|
||||
|
||||
async def async_enable_motion_detection(self) -> None:
|
||||
"""Call the job and enable motion detection."""
|
||||
await self.device.set_motion_detection(True)
|
||||
|
||||
async def async_disable_motion_detection(self) -> None:
|
||||
"""Call the job and disable motion detection."""
|
||||
await self.device.set_motion_detection(False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue