class documentation
Represents a digital output command.
| Class Method | unpack |
Unpacks a bytes sequence into a tagIODO object. |
| Method | pack |
Packs the tagIODO object into a bytes sequence. |
| Class Variable | address |
Undocumented |
| Class Variable | level |
Undocumented |
Unpacks a bytes sequence into a tagIODO object.
| Parameters | |
data:bytes | The bytes to unpack, expected to be 2 bytes (2 uint8s). |
| Returns | |
tagIODO | A tagIODO object. |
| Raises | |
struct.error | If the input bytes are not the expected size (2 bytes). |
ValueError | If the unpacked byte value for level does not correspond to a valid Level enum member. |
Packs the tagIODO object into a bytes sequence.
Packs the address (uint8) and level (Level value as uint8) into a byte string. Uses little-endian byte order.
| Returns | |
bytes | A bytes object representing the packed data (1 + 1 = 2 bytes). |