ThingM Implementation¶
Blink(1) devices with fade effects
This module contains the low-level implementation details for ThingM devices, including enumerations, bit fields, and state management classes.
Available Components¶
ThingM Blink(1) implementation details.
Classes¶
busylight_core.vendors.thingm.implementation.LEDS
¶
Bases: IntEnum
LED selection enumeration for multi-LED Blink(1) devices.
Specifies which LED(s) to control on devices that have multiple LEDs, such as the Blink(1) mk2 which has both top and bottom LEDs.
busylight_core.vendors.thingm.implementation.Action
¶
Bases: IntEnum
Action enumeration for ThingM Blink(1) device commands.
Defines the available actions that can be performed on Blink(1) devices. Each action corresponds to a specific ASCII character that the device firmware recognizes.
Attributes¶
busylight_core.vendors.thingm.implementation.Action.FadeColor
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.SetColor
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ReadColor
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ServerTickle
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.PlayLoop
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.PlayStateRead
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.SetColorPattern
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.SaveColorPatterns
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ReadColorPattern
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.SetLEDn
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ReadEEPROM
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.WriteEEPROM
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.GetVersion
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.TestCommand
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.WriteNote
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ReadNote
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.Bootloader
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.LockBootLoader
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.SetStartupParams
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.GetStartupParams
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.ServerModeTickle
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Action.GetChipID
class-attribute
instance-attribute
¶
busylight_core.vendors.thingm.implementation.Report
¶
Bases: IntEnum
Report type enumeration for HID communication.
Defines the HID report numbers used for different types of communication with Blink(1) devices.
busylight_core.vendors.thingm.implementation.ActionField
¶
busylight_core.vendors.thingm.implementation.BlueField
¶
busylight_core.vendors.thingm.implementation.CountField
¶
busylight_core.vendors.thingm.implementation.FadeField
¶
busylight_core.vendors.thingm.implementation.GreenField
¶
busylight_core.vendors.thingm.implementation.LedsField
¶
busylight_core.vendors.thingm.implementation.LinesField
¶
busylight_core.vendors.thingm.implementation.PlayField
¶
busylight_core.vendors.thingm.implementation.RedField
¶
busylight_core.vendors.thingm.implementation.ReportField
¶
busylight_core.vendors.thingm.implementation.StartField
¶
busylight_core.vendors.thingm.implementation.StopField
¶
busylight_core.vendors.thingm.implementation.State
¶
Bases: Word
Complete device state for ThingM Blink(1) commands.
The State class manages command construction for Blink(1) devices. It provides high-level methods for color control, pattern management, and device configuration while handling the low-level bit manipulation required for device communication.
Attributes¶
busylight_core.vendors.thingm.implementation.State.initial_value
instance-attribute
¶
busylight_core.vendors.thingm.implementation.State.bits
instance-attribute
¶
busylight_core.vendors.thingm.implementation.State.value
property
¶
Return the integer value of the word.
busylight_core.vendors.thingm.implementation.State.range
property
¶
Return the range of bit offsets for this word.
busylight_core.vendors.thingm.implementation.State.hex
property
¶
Return a string hexadecimal representation of the word.
busylight_core.vendors.thingm.implementation.State.bin
property
¶
Return a string binary representation of the word.
busylight_core.vendors.thingm.implementation.State.report
class-attribute
instance-attribute
¶
report = ReportField()
busylight_core.vendors.thingm.implementation.State.action
class-attribute
instance-attribute
¶
action = ActionField()
busylight_core.vendors.thingm.implementation.State.red
class-attribute
instance-attribute
¶
red = RedField()
busylight_core.vendors.thingm.implementation.State.green
class-attribute
instance-attribute
¶
green = GreenField()
busylight_core.vendors.thingm.implementation.State.blue
class-attribute
instance-attribute
¶
blue = BlueField()
busylight_core.vendors.thingm.implementation.State.play
class-attribute
instance-attribute
¶
play = PlayField()
busylight_core.vendors.thingm.implementation.State.start
class-attribute
instance-attribute
¶
start = StartField()
busylight_core.vendors.thingm.implementation.State.stop
class-attribute
instance-attribute
¶
stop = StopField()
busylight_core.vendors.thingm.implementation.State.count
class-attribute
instance-attribute
¶
count = CountField()
busylight_core.vendors.thingm.implementation.State.fade
class-attribute
instance-attribute
¶
fade = FadeField()
busylight_core.vendors.thingm.implementation.State.leds
class-attribute
instance-attribute
¶
leds = LedsField()
busylight_core.vendors.thingm.implementation.State.line
class-attribute
instance-attribute
¶
line = LinesField()
busylight_core.vendors.thingm.implementation.State.color
property
writable
¶
Get the current RGB color as a tuple.
Functions¶
busylight_core.vendors.thingm.implementation.State.fade_to_color
¶
fade_to_color(color, fade_ms=10, leds=All)
Configure device to fade to specified color.
:param color: RGB color tuple (red, green, blue) with values 0-255 :param fade_ms: Fade duration in milliseconds :param leds: Which LEDs to control (All, Top, or Bottom)
busylight_core.vendors.thingm.implementation.State.write_pattern_line
¶
Write a single line to the device's pattern memory.
:param color: RGB color tuple for this pattern line :param fade_ms: Fade duration for this pattern step :param index: Pattern line index (0-15)
busylight_core.vendors.thingm.implementation.State.save_patterns
¶
Save current pattern memory to device flash storage.
busylight_core.vendors.thingm.implementation.State.play_loop
¶
Start pattern playback loop.
:param play: Play mode (0=stop, 1=play) :param start: Starting pattern line index :param stop: Ending pattern line index :param count: Number of loops (0=infinite)
busylight_core.vendors.thingm.implementation.State.clear_patterns
¶
Clear pattern memory by writing black to specified range.
:param start: Starting pattern line index :param count: Number of pattern lines to clear