State
busylight_core.vendors.muteme.implementation.state
¶
MuteMe device state management.
This module defines the State class that manages command construction for MuteMe devices, including simple on/off color control and device behavior settings.
Classes¶
busylight_core.vendors.muteme.implementation.state.State
¶
Bases: Word
Complete device state for MuteMe commands.
MuteMe devices have a simple control scheme using 1-bit fields for each color component and behavior setting. Unlike other vendors, MuteMe uses pure on/off color control rather than full 8-bit RGB values.
Create a Word instance for binary data manipulation.
Initializes a binary word with the specified bit length and initial value. The length must be a multiple of 8 to align with byte boundaries. Use this to create state objects for devices that use binary communication protocols.
:param value: Initial integer value to store in the word :param length: Total bit length, must be multiple of 8 :raises ValueError: If length is not a positive multiple of 8
Source code in src/busylight_core/word.py
Attributes¶
busylight_core.vendors.muteme.implementation.state.State.red
class-attribute
instance-attribute
¶
red = RedBit()
busylight_core.vendors.muteme.implementation.state.State.green
class-attribute
instance-attribute
¶
green = GreenBit()
busylight_core.vendors.muteme.implementation.state.State.blue
class-attribute
instance-attribute
¶
blue = BlueBit()
busylight_core.vendors.muteme.implementation.state.State.dim
class-attribute
instance-attribute
¶
dim = DimBit()
busylight_core.vendors.muteme.implementation.state.State.blink
class-attribute
instance-attribute
¶
blink = BlinkBit()
busylight_core.vendors.muteme.implementation.state.State.sleep
class-attribute
instance-attribute
¶
sleep = SleepBit()
busylight_core.vendors.muteme.implementation.state.State.color
property
writable
¶
Get the current color state as RGB tuple.
Returns 8-bit RGB values (0x00 or 0xFF) based on the current bit field states.
busylight_core.vendors.muteme.implementation.state.State.initial_value
instance-attribute
¶
busylight_core.vendors.muteme.implementation.state.State.length
instance-attribute
¶
busylight_core.vendors.muteme.implementation.state.State.bits
instance-attribute
¶
busylight_core.vendors.muteme.implementation.state.State.value
property
¶
Return the integer value of the word.
busylight_core.vendors.muteme.implementation.state.State.range
property
¶
Return the range of bit offsets for this word.
busylight_core.vendors.muteme.implementation.state.State.hex
property
¶
Return a string hexadecimal representation of the word.
busylight_core.vendors.muteme.implementation.state.State.bin
property
¶
Return a string binary representation of the word.