Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xAAL
Code
Python
Commits
8de2aabf
Commit
8de2aabf
authored
1 month ago
by
KERDREUX Jerome
Browse files
Options
Downloads
Patches
Plain Diff
Add cmdclass
parent
211aa117
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
devices/protocols/ZwaveJS/xaal/zwavejs/cmdclass.py
+104
-0
104 additions, 0 deletions
devices/protocols/ZwaveJS/xaal/zwavejs/cmdclass.py
devices/protocols/ZwaveJS/xaal/zwavejs/gw.py
+15
-6
15 additions, 6 deletions
devices/protocols/ZwaveJS/xaal/zwavejs/gw.py
with
119 additions
and
6 deletions
devices/protocols/ZwaveJS/xaal/zwavejs/cmdclass.py
0 → 100644
+
104
−
0
View file @
8de2aabf
from
enum
import
Enum
class
COMMAND_CLASS
(
Enum
):
NO_OPERATION
=
0x00
BASIC
=
0x20
CONTROLLER_REPLICATION
=
0x21
APPLICATION_STATUS
=
0x22
ZIP_SERVICES
=
0x23
ZIP_SERVER
=
0x24
SWITCH_BINARY
=
0x25
SWITCH_MULTILEVEL
=
0x26
SWITCH_MULTILEVEL_V2
=
0x26
SWITCH_ALL
=
0x27
SWITCH_TOGGLE_BINARY
=
0x28
SWITCH_TOGGLE_MULTILEVEL
=
0x29
CHIMNEY_FAN
=
0x2A
SCENE_ACTIVATION
=
0x2B
SCENE_ACTUATOR_CONF
=
0x2C
SCENE_CONTROLLER_CONF
=
0x2D
ZIP_CLIENT
=
0x2E
ZIP_ADV_SERVICES
=
0x2F
SENSOR_BINARY
=
0x30
SENSOR_MULTILEVEL
=
0x31
SENSOR_MULTILEVEL_V2
=
0x31
METER
=
0x32
ZIP_ADV_SERVER
=
0x33
ZIP_ADV_CLIENT
=
0x34
METER_PULSE
=
0x35
METER_TBL_CONFIG
=
0x3C
METER_TBL_MONITOR
=
0x3D
METER_TBL_PUSH
=
0x3E
THERMOSTAT_HEATING
=
0x38
THERMOSTAT_MODE
=
0x40
THERMOSTAT_OPERATING_STATE
=
0x42
THERMOSTAT_SETPOINT
=
0x43
THERMOSTAT_FAN_MODE
=
0x44
THERMOSTAT_FAN_STATE
=
0x45
CLIMATE_CONTROL_SCHEDULE
=
0x46
THERMOSTAT_SETBACK
=
0x47
DOOR_LOCK_LOGGING
=
0x4C
SCHEDULE_ENTRY_LOCK
=
0x4E
BASIC_WINDOW_COVERING
=
0x50
MTP_WINDOW_COVERING
=
0x51
ASSOCIATION_GRP_INFO
=
0x59
DEVICE_RESET_LOCALLY
=
0x5A
CENTRAL_SCENE
=
0x5B
IP_ASSOCIATION
=
0x5C
ANTITHEFT
=
0x5D
ZWAVEPLUS_INFO
=
0x5E
MULTI_CHANNEL_V2
=
0x60
MULTI_INSTANCE
=
0x60
DOOR_LOCK
=
0x62
USER_CODE
=
0x63
BARRIER_OPERATOR
=
0x66
CONFIGURATION
=
0x70
CONFIGURATION_V2
=
0x70
ALARM
=
0x71
MANUFACTURER_SPECIFIC
=
0x72
POWERLEVEL
=
0x73
PROTECTION
=
0x75
PROTECTION_V2
=
0x75
LOCK
=
0x76
NODE_NAMING
=
0x77
FIRMWARE_UPDATE_MD
=
0x7A
GROUPING_NAME
=
0x7B
REMOTE_ASSOCIATION_ACTIVATE
=
0x7C
REMOTE_ASSOCIATION
=
0x7D
BATTERY
=
0x80
CLOCK
=
0x81
HAIL
=
0x82
WAKE_UP
=
0x84
WAKE_UP_V2
=
0x84
ASSOCIATION
=
0x85
ASSOCIATION_V2
=
0x85
VERSION
=
0x86
INDICATOR
=
0x87
PROPRIETARY
=
0x88
LANGUAGE
=
0x89
TIME
=
0x8A
TIME_PARAMETERS
=
0x8B
GEOGRAPHIC_LOCATION
=
0x8C
COMPOSITE
=
0x8D
MULTI_CHANNEL_ASSOCIATION_V2
=
0x8E
MULTI_INSTANCE_ASSOCIATION
=
0x8E
MULTI_CMD
=
0x8F
ENERGY_PRODUCTION
=
0x90
MANUFACTURER_PROPRIETARY
=
0x91
SCREEN_MD
=
0x92
SCREEN_MD_V2
=
0x92
SCREEN_ATTRIBUTES
=
0x93
SCREEN_ATTRIBUTES_V2
=
0x93
SIMPLE_AV_CONTROL
=
0x94
AV_CONTENT_DIRECTORY_MD
=
0x95
AV_RENDERER_STATUS
=
0x96
AV_CONTENT_SEARCH_MD
=
0x97
SECURITY
=
0x98
AV_TAGGING_MD
=
0x99
IP_CONFIGURATION
=
0x9A
ASSOCIATION_COMMAND_CONFIGURATION
=
0x9B
SENSOR_ALARM
=
0x9C
SILENCE_ALARM
=
0x9D
SENSOR_CONFIGURATION
=
0x9E
MARK
=
0xEF
NON_INTEROPERABLE
=
0xF0
This diff is collapsed.
Click to expand it.
devices/protocols/ZwaveJS/xaal/zwavejs/gw.py
+
15
−
6
View file @
8de2aabf
# from xaal.lib import tools
import
asyncio
import
pdb
# import pdb
import
logging
from
pprint
import
pprint
# from pprint import pprint
from
zwave_js_server.client
import
Client
as
ZwaveClient
...
...
@@ -12,6 +14,7 @@ from aiohttp.client import ClientSession
from
xaal.lib
import
AsyncEngine
from
xaal.schemas
import
devices
from
.cmdclass
import
COMMAND_CLASS
PACKAGE_NAME
=
'
xaal.zwavejs
'
...
...
@@ -20,7 +23,8 @@ logger = logging.getLogger(__name__)
logging
.
getLogger
(
"
zwave_js_server
"
).
setLevel
(
logging
.
WARNING
)
URL
=
"
ws://10.77.3.143:3000
"
# URL = "ws://10.77.3.143:3000"
URL
=
"
ws://localhost:3000
"
class
GW
:
...
...
@@ -45,7 +49,6 @@ class GW:
async
def
run
(
self
):
await
self
.
ready
.
wait
()
assert
self
.
client
.
driver
# logger.warning(self.client.controller.nodes)
logger
.
warning
(
"
ZwaveJS ready
"
)
nodes
=
self
.
client
.
driver
.
controller
.
nodes
for
node
in
nodes
.
values
():
...
...
@@ -59,10 +62,16 @@ class GW:
# pprint(node.data)
def
on_value_updated
(
self
,
event
):
cmd_class
=
event
[
"
args
"
][
"
commandClass
"
]
cmd_class
=
int
(
event
[
"
args
"
][
"
commandClass
"
]
)
nodeId
=
event
[
"
nodeId
"
]
value
=
event
[
"
value
"
]
logger
.
warning
(
f
"
{
nodeId
}
.
{
value
.
endpoint
}
{
cmd_class
}
=
{
value
.
property_key_name
}
=>
{
event
[
"
args
"
][
"
newValue
"
]
}
"
)
prop
=
event
[
"
args
"
][
"
property
"
]
if
prop
in
[
"
value
"
,
"
currentValue
"
,
"
targetValue
"
]:
prop
=
value
.
property_key_name
logger
.
warning
(
f
"
{
nodeId
}
.
{
value
.
endpoint
}
{
COMMAND_CLASS
(
cmd_class
)
}
=
{
prop
}
=>
{
event
[
"
args
"
][
"
newValue
"
]
}
"
)
# if cmd_class == 49 and nodeId == 4:
# pdb.set_trace()
# print(event)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment