pyebus.msgdefs module
Message Defintions.
- class pyebus.msgdefs.Pattern(circuit, name, setprio, fieldname)[source]
Bases:
Pattern
Message Definition and Field Definition Search Pattern.
Create new instance of Pattern(circuit, name, setprio, fieldname)
- class pyebus.msgdefs.MsgDefs[source]
Bases:
object
Message Definitions Container.
>>> from .msgdef import MsgDef, FieldDef >>> from .types import Type >>> msgdefs = MsgDefs() >>> msgdefs.add(MsgDef('mc', 'Status0a', ( ... FieldDef(0, 'temp', Type(), '°C'), ... FieldDef(1, 'mixer', Type(), None), ... FieldDef(2, 'onoff-0', Type(), None), ... FieldDef(3, 'onoff-1', Type(), None), ... FieldDef(4, 'temp0', Type(), '°C'), ... ), read=True)) >>> msgdefs.add(MsgDef('hc', 'Status0', ( ... FieldDef(0, 'temp', Type(), '°C'), ... FieldDef(1, 'temp0', Type(), '°C'), ... ), read=True)) >>> msgdefs.get('mc', 'Status0a') MsgDef('mc', 'Status0a', (FieldDef(0, 'temp', ...'°C'), FieldDef(1, 'mixer', ..., unit='°C')), read=True) >>> list(msgdefs) [MsgDef('mc', 'Status0a', (FieldDef(0, 'temp', ...'°C'), FieldDef(1, 'mixer', ..., unit='°C')), read=True)] >>> msgdefs.summary() '2 messages (2 read, 0 update, 0 write) with 7 fields'
- find(circuit, name='*')[source]
Find all message definitions matching circuit and name, wildcards and placeholder are accepted.
- Returns:
Message Definitions
- Return type: