diff --git a/motionblinds/__init__.py b/motionblinds/__init__.py index aa8c00f..a0c1628 100644 --- a/motionblinds/__init__.py +++ b/motionblinds/__init__.py @@ -11,7 +11,7 @@ logging.getLogger(__name__) __title__ = "motion-blinds" -__version__ = "0.4.5" +__version__ = "0.4.6" # Import motion_blinds module from .motion_blinds import MotionGateway diff --git a/motionblinds/motion_blinds.py b/motionblinds/motion_blinds.py index 14bb6cd..8bd1a9d 100644 --- a/motionblinds/motion_blinds.py +++ b/motionblinds/motion_blinds.py @@ -465,7 +465,12 @@ def GetDeviceList(self): """Get the device list from the Motion Gateway.""" msg = {"msgType":"GetDeviceList", "msgID":self._get_timestamp()} - response = self._send(msg) + try: + response = self._send(msg) + except socket.timeout: + for blind in self.device_list.values(): + blind._available = False + raise # check msgType msgType = response.get("msgType") @@ -489,7 +494,12 @@ def Update(self): msg = {"msgType":"ReadDevice", "mac": self.mac, "deviceType": self.device_type, "msgID":self._get_timestamp()} - response = self._send(msg) + try: + response = self._send(msg) + except socket.timeout: + for blind in self.device_list.values(): + blind._available = False + raise # check msgType msgType = response.get("msgType") diff --git a/setup.py b/setup.py index 5eccbb2..563de10 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ README = (HERE / "README.md").read_text() setup(name='motionblinds', - version='0.4.5', + version='0.4.6', description='Python library for interfacing with Motion Blinds', long_description=README, long_description_content_type="text/markdown",