Skip to content

Embrava Implementation

Blynclight series with audio capabilities

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

Available Components

Embrava Blynclight implementation details.

Classes

busylight_core.vendors.embrava.implementation.FlashSpeed

Bases: IntEnum

Flash speed enumeration for Embrava Blynclight devices.

Defines the available flash speeds for the LED indicator. These values control how quickly the device cycles when in flash mode.

Attributes
busylight_core.vendors.embrava.implementation.FlashSpeed.slow class-attribute instance-attribute
slow = 1
busylight_core.vendors.embrava.implementation.FlashSpeed.medium class-attribute instance-attribute
medium = 2
busylight_core.vendors.embrava.implementation.FlashSpeed.fast class-attribute instance-attribute
fast = 4

busylight_core.vendors.embrava.implementation.BlueField

BlueField()

Bases: BitField

8-bit blue color component.

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

busylight_core.vendors.embrava.implementation.DimBit

DimBit()

Bases: BitField

1-bit field to dim light, clear to brighten light.

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

busylight_core.vendors.embrava.implementation.FlashBit

FlashBit()

Bases: BitField

1-bit field to flash light, clear to stop flashing.

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

busylight_core.vendors.embrava.implementation.GreenField

GreenField()

Bases: BitField

8-bit green color component.

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

busylight_core.vendors.embrava.implementation.MusicField

MusicField()

Bases: BitField

4-bit field to select music to play, ranges from 0 to 15.

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

busylight_core.vendors.embrava.implementation.MuteBit

MuteBit()

Bases: BitField

1-bit field to mute sound, clear to enable sound.

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

busylight_core.vendors.embrava.implementation.OffBit

OffBit()

Bases: BitField

1-bit field to turn light off, clear to turn light on.

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

busylight_core.vendors.embrava.implementation.PlayBit

PlayBit()

Bases: BitField

1-bit field to play sound, clear to stop sound.

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

busylight_core.vendors.embrava.implementation.RedField

RedField()

Bases: BitField

8-bit red color component.

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

busylight_core.vendors.embrava.implementation.RepeatBit

RepeatBit()

Bases: BitField

1-bit field to repeat sound, clear to play sound once.

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

busylight_core.vendors.embrava.implementation.SpeedField

SpeedField()

Bases: BitField

3-bit field to set flash speed: 1=slow, 2=medium, 4=fast.

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

busylight_core.vendors.embrava.implementation.VolumeField

VolumeField()

Bases: BitField

4-bit field to set volume level, ranges from 0 to 15.

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

busylight_core.vendors.embrava.implementation.State

State()

Bases: Word

Complete device state for Embrava Blynclight commands.

The State class manages the full command structure sent to Embrava devices. It controls both LED behavior (color, brightness, flashing) and audio functionality (ringtones, volume, playback control). The state is serialized to bytes for transmission to the hardware.

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

Return the integer value of the word.

busylight_core.vendors.embrava.implementation.State.range property
range

Return the range of bit offsets for this word.

busylight_core.vendors.embrava.implementation.State.hex property
hex

Return a string hexadecimal representation of the word.

busylight_core.vendors.embrava.implementation.State.bin property
bin

Return a string binary representation of the word.

busylight_core.vendors.embrava.implementation.State.red class-attribute instance-attribute
red = RedField()
busylight_core.vendors.embrava.implementation.State.blue class-attribute instance-attribute
blue = BlueField()
busylight_core.vendors.embrava.implementation.State.green class-attribute instance-attribute
green = GreenField()
busylight_core.vendors.embrava.implementation.State.off class-attribute instance-attribute
off = OffBit()
busylight_core.vendors.embrava.implementation.State.dim class-attribute instance-attribute
dim = DimBit()
busylight_core.vendors.embrava.implementation.State.flash class-attribute instance-attribute
flash = FlashBit()
busylight_core.vendors.embrava.implementation.State.speed class-attribute instance-attribute
speed = SpeedField()
busylight_core.vendors.embrava.implementation.State.repeat class-attribute instance-attribute
repeat = RepeatBit()
busylight_core.vendors.embrava.implementation.State.play class-attribute instance-attribute
play = PlayBit()
busylight_core.vendors.embrava.implementation.State.music class-attribute instance-attribute
music = MusicField()
busylight_core.vendors.embrava.implementation.State.volume class-attribute instance-attribute
volume = VolumeField()
busylight_core.vendors.embrava.implementation.State.mute class-attribute instance-attribute
mute = MuteBit()
Functions
busylight_core.vendors.embrava.implementation.State.clear
clear()

Clear all bits in the word.

busylight_core.vendors.embrava.implementation.State.reset
reset()

Reset the state to default values.

Sets the device to off state with no audio playback and default flash speed settings.