pyzwave.node module

class pyzwave.node.Node(nodeId: int, adapter: pyzwave.adapter.Adapter, cmdClasses: list)

Bases: pyzwave.util.Listenable, pyzwave.util.MessageWaiter

Base class for a Z-Wave node

property adapter

The adapter

property basicDeviceClass

Return this nodes basic device class

commandClassUpdated(_commandClass: pyzwave.commandclass.CommandClass.CommandClass)

Called by the command classes if their data is updated

property endpoint

Returns the endpoint if this is a subnode. 0 if it is the root node

property flirs

Returns if this node is a FLiRS node or not

property genericDeviceClass

Returns this nodes generic device class

async handleMessage(message: pyzwave.message.Message, flags)
async interview()

(Re)interview this node. It is recommended to apply the storageLock() before calling this function.

property isFailed

Returns is this node is considered failing or not

property isZWavePlus

Returns True if this is a Z-Wave Plus node

property listening

Returns True if this node is listening. False if it is a sleeping node

property nodeId

The node id in the format nodeid:channel

async remove() → bool

Remove this node from the network. This only works if the node is marked as failed in the Z-Wave chip

property rootNodeId

Return the root node id

async send(cmd: pyzwave.message.Message, timeout: int = 3) → bool

Send a message to this node

async sendAndReceive(cmd: pyzwave.message.Message, waitFor: pyzwave.message.Message, timeout: int = 3, **kwargs) → pyzwave.message.Message

Send a message and wait for the response

property specificDeviceClass

Returns this nodes specific device class

storageLock()

Suppresses (temporarily) the signals to store settings persistant.

Some memories do not like to be written to often, such as flash memories found in embedded boards. If the application knows the node will be updated a lock can be added so it will only be written to disc once all operations has been finished. To use this lock use the with-statement:

with node.storageLock():
    # Do operations with the node here.
    # Nothing will be stored to disk.
    node.interview()
# The storage will happen here, only once
property supported

Return a dict of command classes this node supports

supports(commandClass: int) → bool

Returns if this node supports a specific command class or not

class pyzwave.node.NodeEndPoint(parent: pyzwave.node.Node, endpoint: int, adapter: pyzwave.adapter.Adapter, cmdClasses: list)

Bases: pyzwave.node.Node

Base class for a sub node for nodes supporting command class multi channel

property basicDeviceClass

Return this nodes basic device class

property flirs

Returns if this node is a FLiRS node or not

property isFailed

Returns is this node is considered failing or not

property listening

Returns True if this node is listening. False if it is a sleeping node

property parent

Returns the parent node

class pyzwave.node.StorageStatus

Bases: enum.Enum

Storage status flag

CLEAN = 1
LOCKED_CLEAN = 2
LOCKED_DIRTY = 3
pyzwave.node.supervision(func)

Decoratior for handling calls wrapped in supervision messages