pyialarm
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: pyialarm | ||
| Version: 2.1.5 | ||
| Version: 2.2.0 | ||
| 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: 2.1.5 | ||
| Version: 2.2.0 | ||
| 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 |
+13
-48
| import logging | ||
| import time | ||
@@ -66,3 +65,5 @@ import re | ||
| command['Offset'] = 'S32,0,0|%d' % offset | ||
| response = self._send_request_raw(xpath, command) | ||
| root_dict = self._create_root_dict(xpath, command) | ||
| self._send_dict(root_dict) | ||
| response = self._receive() | ||
@@ -83,19 +84,7 @@ if partial_list is None: | ||
| def _send_request_raw(self, xpath, command) -> dict: | ||
| def _send_request(self, xpath, command) -> dict: | ||
| root_dict = self._create_root_dict(xpath, command) | ||
| try: | ||
| self._send_dict(root_dict) | ||
| response = self._receive() | ||
| except ConnectionError as err: | ||
| log.debug("Failed to send request, retrying with a new connection: %s", err) | ||
| self._close_connection() | ||
| # The alarm can start to drop responses if we send multiple requests back-to-back | ||
| time.sleep(1) | ||
| self._send_dict(root_dict) | ||
| response = self._receive() | ||
| return response | ||
| def _send_request(self, xpath, command) -> dict: | ||
| response = self._send_request_raw(xpath, command) | ||
| self._send_dict(root_dict) | ||
| response = self._receive() | ||
| self._close_connection() | ||
| return self._clean_response_dict(response, xpath) | ||
@@ -126,9 +115,2 @@ | ||
| def get_status(self, include_memory_feature=False) -> int: | ||
| """ | ||
| :param include_memory_feature: | ||
| .. deprecated:: 1.9.5 | ||
| Memory feature is always enabled, this parameter has no effect | ||
| :return: The current alarm status | ||
| :raises ConnectionError: | ||
| """ | ||
| command = OrderedDict() | ||
@@ -146,9 +128,6 @@ command['DevStatus'] = None | ||
| if status != self.ARMED_AWAY and status != self.ARMED_STAY: | ||
| # If the status is not "armed", there is no point in checking for "triggered" | ||
| if not include_memory_feature: | ||
| return status | ||
| # The alarm can start to drop responses if we send multiple different requests back-to-back | ||
| time.sleep(1) | ||
| zone_alarm = False | ||
| command = OrderedDict() | ||
@@ -166,4 +145,7 @@ command['Total'] = None | ||
| if zone & self.ZONE_ALARM: | ||
| status = self.TRIGGERED | ||
| zone_alarm = True | ||
| if (status == self.ARMED_AWAY or status == self.ARMED_STAY) and zone_alarm: | ||
| return self.TRIGGERED | ||
| return status | ||
@@ -286,18 +268,1 @@ | ||
| return buf | ||
| if __name__ == "__main__": | ||
| ialarm = IAlarm("192.168.40.200") | ||
| # ialarm.disarm() | ||
| import time | ||
| for ii in range(30): | ||
| try: | ||
| print(ialarm.get_status()) | ||
| except ConnectionError as e: | ||
| print(e) | ||
| print("no connection") | ||
| print(ialarm.sock) | ||
| time.sleep(15) | ||
| print("-----------") |
+1
-1
| from setuptools import setup | ||
| __version__ = '2.1.5' | ||
| __version__ = '2.2.0' | ||
@@ -5,0 +5,0 @@ setup( |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
22905
-4.76%244
-10.62%