diff --git a/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py b/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py index 3bc80a7dd460088425f8daecfac5d245b8cceb29..829265e67aa6578054f48228c7612e04448c45f3 100644 --- a/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py +++ b/devices/protocols/ZwaveJS/xaal/zwavejs/gw.py @@ -1,15 +1,29 @@ # from xaal.lib import tools +import pdb import logging +from zwave_js_server.client import Client as ZwaveClient +from aiohttp.client import ClientSession + PACKAGE_NAME = 'xaal.zwavejs' logger = logging.getLogger(__name__) +URL = "ws://10.77.3.143:3000" + class GW: def __init__(self, engine): self.engine = engine logger.debug("ZwaveJS gateway initialized") + engine.on_start(self.start) + + async def start(self): + sess = ClientSession() + self.client = ZwaveClient(URL, sess) + await self.client.connect() + await self.client.initialize() + await self.client.receive_until_closed() def setup(eng):