Skip to content

MuteMe Implementation

MuteMe devices with button input

This module contains the low-level implementation details for MuteMe devices, including enumerations, bit fields, and state management classes.

Available Components

MuteMe implementation details.

Classes

busylight_core.vendors.muteme.implementation.BlinkBit

BlinkBit()

Bases: OneBitField

1-bit blink field for flashing control.

Attributes
busylight_core.vendors.muteme.implementation.BlinkBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.BlinkBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.BlinkBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.BlueBit

BlueBit()

Bases: OneBitField

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

Attributes
busylight_core.vendors.muteme.implementation.BlueBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.BlueBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.BlueBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.DimBit

DimBit()

Bases: OneBitField

1-bit dim field for brightness control.

Attributes
busylight_core.vendors.muteme.implementation.DimBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.DimBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.DimBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.GreenBit

GreenBit()

Bases: OneBitField

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

Attributes
busylight_core.vendors.muteme.implementation.GreenBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.GreenBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.GreenBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.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

Attributes
busylight_core.vendors.muteme.implementation.OneBitField.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.OneBitField.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.OneBitField.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.RedBit

RedBit()

Bases: OneBitField

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

Attributes
busylight_core.vendors.muteme.implementation.RedBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.RedBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.RedBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.SleepBit

SleepBit()

Bases: OneBitField

1-bit sleep field for power management.

Attributes
busylight_core.vendors.muteme.implementation.SleepBit.field instance-attribute
field = slice(offset, offset + width)
busylight_core.vendors.muteme.implementation.SleepBit.offset instance-attribute
offset = offset
busylight_core.vendors.muteme.implementation.SleepBit.width instance-attribute
width = width

busylight_core.vendors.muteme.implementation.State

State(value=0, length=8)

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

Attributes
busylight_core.vendors.muteme.implementation.State.initial_value instance-attribute
initial_value = value
busylight_core.vendors.muteme.implementation.State.length instance-attribute
length = length
busylight_core.vendors.muteme.implementation.State.bits instance-attribute
bits = array('B', [value >> n & 1 for n in range])
busylight_core.vendors.muteme.implementation.State.value property
value

Return the integer value of the word.

busylight_core.vendors.muteme.implementation.State.range property
range

Return the range of bit offsets for this word.

busylight_core.vendors.muteme.implementation.State.hex property
hex

Return a string hexadecimal representation of the word.

busylight_core.vendors.muteme.implementation.State.bin property
bin

Return a string binary representation of the word.

busylight_core.vendors.muteme.implementation.State.red class-attribute instance-attribute
red = RedBit()
busylight_core.vendors.muteme.implementation.State.green class-attribute instance-attribute
green = GreenBit()
busylight_core.vendors.muteme.implementation.State.blue class-attribute instance-attribute
blue = BlueBit()
busylight_core.vendors.muteme.implementation.State.dim class-attribute instance-attribute
dim = DimBit()
blink = BlinkBit()
busylight_core.vendors.muteme.implementation.State.sleep class-attribute instance-attribute
sleep = SleepBit()
busylight_core.vendors.muteme.implementation.State.color property writable
color

Get the current color state as RGB tuple.

Returns 8-bit RGB values (0x00 or 0xFF) based on the current bit field states.

Functions
busylight_core.vendors.muteme.implementation.State.clear
clear()

Clear all bits in the word.