pyialarm
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: pyialarm | ||
| Version: 1.7 | ||
| Version: 1.8 | ||
| Summary: A simple library to interface with iAlarm systems, built for use with Home-Assistant | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/RyuzakiKK/pyialarm |
| Metadata-Version: 2.1 | ||
| Name: pyialarm | ||
| Version: 1.7 | ||
| Version: 1.8 | ||
| Summary: A simple library to interface with iAlarm systems, built for use with Home-Assistant | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/RyuzakiKK/pyialarm |
+25
-2
@@ -41,2 +41,3 @@ import logging | ||
| self.port = port | ||
| self.seq = 0 | ||
| self.sock = None | ||
@@ -81,3 +82,2 @@ | ||
| self._close_connection() | ||
| return partial_list | ||
@@ -134,2 +134,3 @@ | ||
| zone_status = self._send_request_list('/Root/Host/GetByWay', command) | ||
| self._close_connection() | ||
| if zone_status is None: | ||
@@ -176,3 +177,5 @@ raise ConnectionError('An error occurred trying to connect to the alarm ' | ||
| msg = b'@ieM%04d00010000%s0001' % (len(xml), self._xor(xml)) | ||
| self.seq += 1 | ||
| msg = b'@ieM%04d%04d0000%s%04d' % (len(xml), self.seq, self._xor(xml), | ||
| self.seq) | ||
| self.sock.send(msg) | ||
@@ -186,2 +189,6 @@ | ||
| raise ConnectionError("Connection error") from err | ||
| if not data: | ||
| raise ConnectionError("Connection error, received no reply") | ||
| # It might happen to receive the err tag before the root, we just | ||
@@ -191,2 +198,6 @@ # remove it because it's not necessary | ||
| "") | ||
| if not decoded: | ||
| raise ConnectionError("Connection error, received an unexpected reply") | ||
| return xmltodict.parse(decoded, xml_attribs=False, | ||
@@ -253,1 +264,13 @@ dict_constructor=dict, | ||
| return buf | ||
| if __name__ == "__main__": | ||
| ialarm = IAlarm("alarm") | ||
| import time | ||
| for i in range(20): | ||
| try: | ||
| print(ialarm.get_status()) | ||
| except ConnectionError: | ||
| print("no connection") | ||
| time.sleep(20) | ||
| print("-----------") |
+1
-1
| from setuptools import setup | ||
| __version__ = '1.7' | ||
| __version__ = '1.8' | ||
@@ -5,0 +5,0 @@ setup( |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
23063
2.58%249
6.87%