pyzwave.util module¶
-
class
pyzwave.util.
AttributesMixin
¶ Bases:
object
Inheritable class to implement defined attributes
-
attributeUpdated
(name, newValue, oldValue)¶ Called if an attribute value was updated
-
attributes
= ()¶
-
debugString
(indent=0)¶ Convert all attributes in this object to a human readable string used for debug output.
-
parseAttributes
(stream: pyzwave.types.BitStreamReader)¶ Populate the attributes from a raw bitstream.
-
-
class
pyzwave.util.
Listenable
¶ Bases:
object
Inheritable class to implement listaner interface between classes
-
addListener
(listener)¶ Add class as listener for messages
-
async
ask
(message, *args) → list¶ Send message to listeners and wait for the listeners to respond. This a shorthand for awaiting thre result from speak()
-
speak
(message, *args) → list¶ Send message to listeners. Returns a list of futures if the listeners are async. This can be used to allow waiting for all listeners to finish before continue.
-
-
class
pyzwave.util.
MessageWaiter
¶ Bases:
object
Inheritable class to implement listening for specific messages
-
addWaitingSession
(msgType)¶ Setup the session to wait for _before_ doing the wait. Do this to avoid a race condition where the message is received before we wait for it
-
messageReceived
(message) → bool¶ Called when a message is received directed to this node
-
async
waitForMessage
(msgType, timeout: int = 3, session=None)¶ Async method for waiting for a specific message to arrive from the node.
-