Skip to content

State

busylight_core.vendors.epos.implementation.state

EPOS Busylight device state management.

This module defines the State class that manages command construction for EPOS Busylight devices, including dual-LED control and device configuration.

Classes

busylight_core.vendors.epos.implementation.state.State

State()

Bases: Word

Complete device state for EPOS Busylight commands.

The State class manages command construction for EPOS devices. It supports dual-LED control with independent color settings for each LED, allowing for more complex status indication patterns.

Source code in src/busylight_core/vendors/epos/implementation/state.py
def __init__(self) -> None:
    super().__init__(0, 80)
Attributes
busylight_core.vendors.epos.implementation.state.State.report class-attribute instance-attribute
report = ReportField(72, 8)
busylight_core.vendors.epos.implementation.state.State.action class-attribute instance-attribute
action = ActionField(56, 16)
busylight_core.vendors.epos.implementation.state.State.red0 class-attribute instance-attribute
red0 = ColorField(48, 8)
busylight_core.vendors.epos.implementation.state.State.green0 class-attribute instance-attribute
green0 = ColorField(40, 8)
busylight_core.vendors.epos.implementation.state.State.blue0 class-attribute instance-attribute
blue0 = ColorField(32, 8)
busylight_core.vendors.epos.implementation.state.State.red1 class-attribute instance-attribute
red1 = ColorField(24, 8)
busylight_core.vendors.epos.implementation.state.State.green1 class-attribute instance-attribute
green1 = ColorField(16, 8)
busylight_core.vendors.epos.implementation.state.State.blue1 class-attribute instance-attribute
blue1 = ColorField(8, 8)
busylight_core.vendors.epos.implementation.state.State.on class-attribute instance-attribute
on = OnField(0, 8)
busylight_core.vendors.epos.implementation.state.State.color0 property writable
color0

Get the first LED color as a tuple of RGB values.

busylight_core.vendors.epos.implementation.state.State.color1 property writable
color1

Get the second LED color as a tuple of RGB values.

busylight_core.vendors.epos.implementation.state.State.color property writable
color

Get the first non-black LED color as a tuple of RGB values.

Returns the color of the first LED that has a non-zero color value, or black (0,0,0) if both LEDs are off.

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

Return the integer value of the word.

busylight_core.vendors.epos.implementation.state.State.range property
range

Return the range of bit offsets for this word.

busylight_core.vendors.epos.implementation.state.State.hex property
hex

Return a string hexadecimal representation of the word.

busylight_core.vendors.epos.implementation.state.State.bin property
bin

Return a string binary representation of the word.

Functions
busylight_core.vendors.epos.implementation.state.State.clear
clear()

Clear all bits in the word.

Source code in src/busylight_core/word.py
def clear(self) -> None:
    """Clear all bits in the word."""
    self.bits = array.array("B", [0] * self.length)