Skip to content

Commit

Permalink
Add Baichuan DingDong cmds
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Nov 18, 2024
1 parent b361995 commit 8927fa4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions reolink_aio/baichuan/baichuan.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,22 @@ async def get_ptz_position(self, channel: int) -> None:
mess = await self.send(cmd_id=433, channel=channel)
self._ptz_position[channel] = self._get_keys_from_xml(mess, ["pPos", "tPos"])

async def get_DingDongList(self, channel: int) -> None:
"""Get the DingDongList info"""
rec_body = await self.send(cmd_id=484, channel=channel)
self._parse_xml(484, rec_body)

async def get_DingDongOpt(self, channel: int, chime_id: int) -> None:
"""Get the DingDongOpt info"""
xml = xmls.DingDongOpt_XML.format(id=chime_id)
rec_body = await self.send(cmd_id=485, channel=channel, body=xml)
self._parse_xml(485, rec_body)

async def get_GetDingDongCfg(self, channel: int) -> None:
"""Get the GetDingDongCfg info"""
rec_body = await self.send(cmd_id=486, channel=channel)
self._parse_xml(486, rec_body)

@property
def events_active(self) -> bool:
return self._events_active
Expand Down
10 changes: 10 additions & 0 deletions reolink_aio/baichuan/xmls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@
<channelId>{channel}</channelId>
</Extension>
"""

DingDongOpt_XML = """
<?xml version="1.0" encoding="UTF-8" ?>
<body>
<dingdongDeviceOpt version="1.1">
<id>{id}</id>
<opt>getParam</opt>
</dingdongDeviceOpt>
</body>
"""

0 comments on commit 8927fa4

Please sign in to comment.