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
No related branches found
No related tags found
No related merge requests found
...@@ -18,8 +18,8 @@ def run(): ...@@ -18,8 +18,8 @@ def run():
if len(sys.argv) > 0: if len(sys.argv) > 0:
color = int(sys.argv[1]) color = int(sys.argv[1])
while 1: while 1:
eng.send_request(dev,lamps,'set_hsv',{'hsv':(color,1,1),'smooth':50 }) eng.send_request(dev,lamps,'set_hsv',{'hsv':(color,1,1),'smooth':400 })
color = color + 2 color = color + 3
if color > 360:color = 0 if color > 360:color = 0
await asyncio.sleep(2) await asyncio.sleep(2)
......
import aiohttp
from xaal.lib import tools from xaal.lib import tools
from meross_iot.http_api import MerossHttpClient from meross_iot.http_api import MerossHttpClient
from meross_iot.manager import MerossManager from meross_iot.manager import MerossManager
...@@ -52,7 +53,11 @@ class GW(object): ...@@ -52,7 +53,11 @@ class GW(object):
async def discover(self): async def discover(self):
# discovery # 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() meross_devices = self.manager.find_devices()
# config # config
devices_config = self.cfg.get('devices',{}) 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