Skip to content

Fields

busylight_core.vendors.muteme.implementation.fields

MuteMe bit field definitions.

This module defines BitField classes used to construct device commands. MuteMe devices use 1-bit fields that are converted to full 8-bit values for device communication.

Classes

busylight_core.vendors.muteme.implementation.fields.OneBitField

OneBitField(offset, width=1)

Bases: BitField

Base class for 1-bit fields that expand to full 8-bit values.

MuteMe devices expect 0xFF for "on" state and 0x00 for "off" state, but internally we work with boolean-like values for simplicity.

Create a read-only bit field descriptor.

Defines a named field that maps to specific bit positions within a Word. The field will be accessible as a regular attribute on Word instances but will raise AttributeError on assignment attempts.

:param offset: Starting bit position within the word (0-based from LSB) :param width: Number of consecutive bits to include in the field

Source code in src/busylight_core/word.py
def __init__(self, offset: int, width: int = 1) -> None:
    """Create a read-only bit field descriptor.

    Defines a named field that maps to specific bit positions within a Word.
    The field will be accessible as a regular attribute on Word instances
    but will raise AttributeError on assignment attempts.


    :param offset: Starting bit position within the word (0-based from LSB)
    :param width: Number of consecutive bits to include in the field
    """
    self.field = slice(offset, offset + width)
    self.offset = offset  # Store for introspection
    self.width = width  # Store for introspection
Attributes
busylight_core.vendors.muteme.implementation.fields.OneBitField.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.OneBitField.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.OneBitField.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.RedBit

RedBit()

Bases: OneBitField

1-bit red color field that expands to 0xFF when set.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(0, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.RedBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.RedBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.RedBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.GreenBit

GreenBit()

Bases: OneBitField

1-bit green color field that expands to 0xFF when set.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(1, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.GreenBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.GreenBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.GreenBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.BlueBit

BlueBit()

Bases: OneBitField

1-bit blue color field that expands to 0xFF when set.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(2, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.BlueBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.BlueBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.BlueBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.DimBit

DimBit()

Bases: OneBitField

1-bit dim field for brightness control.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(4, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.DimBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.DimBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.DimBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.BlinkBit

BlinkBit()

Bases: OneBitField

1-bit blink field for flashing control.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(5, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.BlinkBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.BlinkBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.BlinkBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.fields.SleepBit

SleepBit()

Bases: OneBitField

1-bit sleep field for power management.

Source code in src/busylight_core/vendors/muteme/implementation/fields.py
def __init__(self) -> None:
    super().__init__(6, 1)
Attributes
busylight_core.vendors.muteme.implementation.fields.SleepBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.fields.SleepBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.fields.SleepBit.width instance-attribute
width = width