Skip to content
Snippets Groups Projects
Commit 93e3f25d authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

We can now dumps the devices values ;)

parent d3454c8d
No related branches found
No related tags found
No related merge requests found
...@@ -3,15 +3,22 @@ ...@@ -3,15 +3,22 @@
import asyncio import asyncio
import pdb import pdb
import logging import logging
from pprint import pprint
from zwave_js_server.client import Client as ZwaveClient from zwave_js_server.client import Client as ZwaveClient
from aiohttp.client import ClientSession from aiohttp.client import ClientSession
from xaal.lib import AsyncEngine, Device from xaal.lib import AsyncEngine
from xaal.schemas import devices from xaal.schemas import devices
PACKAGE_NAME = 'xaal.zwavejs' PACKAGE_NAME = 'xaal.zwavejs'
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
# Disable zwave-js-server logs
logging.getLogger("zwave_js_server").setLevel(logging.WARNING)
URL = "ws://10.77.3.143:3000" URL = "ws://10.77.3.143:3000"
...@@ -37,11 +44,17 @@ class GW: ...@@ -37,11 +44,17 @@ class GW:
async def run(self): async def run(self):
await self.ready.wait() await self.ready.wait()
assert self.client.driver
# logger.warning(self.client.controller.nodes) # logger.warning(self.client.controller.nodes)
logger.warning("ZwaveJS ready") logger.warning("ZwaveJS ready")
nodes = self.client.driver.controller.nodes nodes = self.client.driver.controller.nodes
for node in nodes: for node in nodes.values():
logger.warning(node) if node.ready:
logger.warning(f"{node.node_id} {node.device_config.manufacturer}/{node.device_config.label} ")
for k in node.values:
value = node.values.get(k)
print(f"{k} {value.property_name} => {value.value}")
# pprint(node.data)
def setup(eng): def setup(eng):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment