Skip to content
Snippets Groups Projects
Commit af254efe authored by jkerdreu's avatar jkerdreu
Browse files

Add error handling on socket



git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@2939 b32b6428-25c9-4566-ad07-03861ab6144f
parent 4a48814d
Branches
No related tags found
No related merge requests found
......@@ -18,8 +18,8 @@ def run():
if len(sys.argv) > 0:
color = int(sys.argv[1])
while 1:
eng.send_request(dev,lamps,'set_hsv',{'hsv':(color,1,1),'smooth':50 })
color = color + 2
eng.send_request(dev,lamps,'set_hsv',{'hsv':(color,1,1),'smooth':400 })
color = color + 3
if color > 360:color = 0
await asyncio.sleep(2)
......
import aiohttp
from xaal.lib import tools
from meross_iot.http_api import MerossHttpClient
from meross_iot.manager import MerossManager
......@@ -52,7 +53,11 @@ class GW(object):
async def discover(self):
# discovery
await self.manager.async_device_discovery()
try:
await self.manager.async_device_discovery()
except aiohttp.client_exceptions.ClientConnectorError as e:
logger.error(e)
meross_devices = self.manager.find_devices()
# config
devices_config = self.cfg.get('devices',{})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment