pyzwave.adapter module

class pyzwave.adapter.Ack

Bases: object

Class for holding session informaion

class Status

Bases: enum.Enum

Ack status

PENDING = 1
QUEUED = 2
RECEIVED = 3
queued(expectedDelay: int)

Call this function when the message cannot be delivered right now

received()

Call this function when this ack has been received

async wait(timeout)

Wait until the node ack the message

class pyzwave.adapter.Adapter

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

Abstract class for implementing communication with a Z-Wave chip

ackReceived(zipPkt: pyzwave.commandclass.Zip.ZipPacket)

Call this method when an ack message has been received

abstract async addNode(txOptions: pyzwave.adapter.TxOptions) → bool

Start inclusion mode in the controller

abstract async addNodeDSKSet(accept: bool, inputDSKLength: int, dsk: pyzwave.types.dsk_t) → bool

This command is used to indicate the S2 bootstrapping controller if the DSK is accepted and report the user input when needed.

abstract async addNodeKeysSet(grantCSA: bool, accept: bool, grantedKeys: pyzwave.commandclass.NetworkManagementInclusion.Keys) → bool

This command is used to inform an S2 bootstrapping controller which keys must be granted to the node being bootstrapped.

abstract async addNodeStop() → bool

Stop inclusion mode in the controller

commandReceived(cmd: pyzwave.message.Message)

Call this method when a command has been received

abstract async connect()

Connect the adapter. Must be implemented by subclass

abstract async getFailedNodeList() → list

Return a list of failing nodes

abstract async getMultiChannelCapability(nodeId: int, endpoint: int) → pyzwave.commandclass.NetworkManagementProxy.MultiChannelCapabilityReport

Return the multi channel capabilities for an endpoint in a node

abstract async getMultiChannelEndPoints(nodeId: int) → int

Return the number of multi channel end points implemented by a node

abstract async getNodeInfo(nodeId: int) → pyzwave.commandclass.NetworkManagementProxy.NodeInfoCachedReport

Return the node info from this node. Possibly cached

abstract async getNodeList() → set

Return a list of nodes included in the network

property nodeId

Return the node id of the controller

abstract async removeFailedNode(nodeId: int) → pyzwave.commandclass.NetworkManagementInclusion.FailedNodeRemoveStatus.Status

Remove a non-responding node

abstract async removeNode() → bool

Start exclusion mode in the controller

abstract async removeNodeStop() → bool

Stop exclusion mode in the controller

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

Send message to Z-Wave chip. Must be implemented in subclass.

Warning

This command will block until the message has been ACKed by the node.

When talking to battery operated (sleeping) nodes this command will block until the nodes wakes up or is considered dead. This can be a long time (week or even months). Please make sure the code can handle this.

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

async sendToNode(nodeId: int, cmd: pyzwave.message.Message, **kwargs) → bool

Send message to node. Must be implemented in subclass

abstract async setNodeInfo(generic, specific, cmdClasses)

Set the application NIF (Node Information Frame). This method should not be called directly. Use the corresponding function in Application instead.

async waitForAck(ackId: int, timeout: int = 3)

Async method for waiting for the adapter to receive a specific ack id

class pyzwave.adapter.TxOptions

Bases: enum.IntFlag

TX Options used for adding nodes to network

NULL = 0
TRANSMIT_OPTION_EXPLORE = 32
TRANSMIT_OPTION_LOW_POWER = 2