From 9f6727039e979549b7a402c954a553d75e226191 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Mon, 13 May 2024 09:10:05 +0200 Subject: [PATCH] Invert PIR sensitivity to match Reolink app --- reolink_aio/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reolink_aio/api.py b/reolink_aio/api.py index 0a07305..7cbeaa0 100644 --- a/reolink_aio/api.py +++ b/reolink_aio/api.py @@ -880,7 +880,7 @@ def pir_sensitivity(self, channel: int) -> int: if channel not in self._pir: return 0 - return self._pir[channel]["sensitive"] + return 101 - self._pir[channel]["sensitive"] def md_sensitivity(self, channel: int) -> int: if channel not in self._md_alarm_settings: @@ -3824,7 +3824,7 @@ async def set_pir(self, channel: int, enable: bool | None = None, reduce_alarm: if reduce_alarm is not None: pir["reduseAlarm"] = 1 if reduce_alarm else 0 if sensitivity is not None: - pir["sensitive"] = sensitivity + pir["sensitive"] = int(101 - sensitivity) body: typings.reolink_json = [{"cmd": "SetPirInfo", "action": 0, "param": {"pirInfo": pir}}] await self.send_setting(body)