Skip to content

Commit

Permalink
Invert PIR sensitivity to match Reolink app
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed May 13, 2024
1 parent a0aa59e commit 9f67270
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reolink_aio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9f67270

Please sign in to comment.