toio.cube.api.indicator module¶
- class toio.cube.api.indicator.Color(r: int, g: int, b: int)[source]¶
Bases:
object
Indicator color in RGB
- r: int¶
R value (0 - 255)
- g: int¶
G value (0 - 255)
- b: int¶
B value (0 - 255)
- __init__(r: int, g: int, b: int) None ¶
- class toio.cube.api.indicator.IndicatorParam(duration_ms: int, color: Color)[source]¶
Bases:
object
Indicator color and lighting period
- duration_ms: int¶
- Duration of lighting:Any fraction less than 10ms will be truncated.0 - 9: no time limit10 - 2550: duration [ms]
- class toio.cube.api.indicator.TurningOnAndOff(param: IndicatorParam)[source]¶
Bases:
CubeCommand
Indicator turning on / off command
References
https://toio.github.io/toio-spec/en/docs/ble_light#turning-the-indicator-on-and-off
- __init__(param: IndicatorParam)[source]¶
- class toio.cube.api.indicator.RepeatedTurningOnAndOff(repeat: int, param_list: list[toio.cube.api.indicator.IndicatorParam] | tuple[toio.cube.api.indicator.IndicatorParam, ...])[source]¶
Bases:
CubeCommand
Repeated indicator turning on /off command
References
https://toio.github.io/toio-spec/en/docs/ble_light#repeated-turning-on-and-off-of-indicator
- REPEAT_INFINITE = 0¶
- __init__(repeat: int, param_list: list[toio.cube.api.indicator.IndicatorParam] | tuple[toio.cube.api.indicator.IndicatorParam, ...]) None [source]¶
- class toio.cube.api.indicator.TurnOffAll[source]¶
Bases:
CubeCommand
Indicator all off command
References
https://toio.github.io/toio-spec/en/docs/ble_light#turn-off-all-indicators
- class toio.cube.api.indicator.TurnOff(indicator_id: int)[source]¶
Bases:
CubeCommand
Indicator off command
References
https://toio.github.io/toio-spec/en/docs/ble_light#turn-off-a-specific-indicator
- class toio.cube.api.indicator.Indicator(interface: CubeInterface)[source]¶
Bases:
CubeCharacteristic
Indicator characteristic
References
https://toio.github.io/toio-spec/en/docs/ble_light
- static is_my_data(_payload: bytearray) None [source]¶
If payload is my characteristic response, this function returns CubeResponse object. Otherwise, it returns None.
- Parameters:
payload (GattReadData) – received data from the cube.
- __init__(interface: CubeInterface)[source]¶
- async turn_on(param: IndicatorParam) None [source]¶
Send indicator turn on / off command
- Parameters:
param – Indicator parameter
References
https://toio.github.io/toio-spec/en/docs/ble_light#repeated-turning-on-and-off-of-indicator
- async repeated_turn_on(repeat: int, param_list: list[toio.cube.api.indicator.IndicatorParam] | tuple[toio.cube.api.indicator.IndicatorParam, ...]) None [source]¶
Send repeated indicator turning on / off command
- Parameters:
repeat (int) – Number of repetitions
param_list (Union[list[IndicatorParam], tuple[IndicatorParam]]) – List of indicator parameters
References
https://toio.github.io/toio-spec/en/docs/ble_light#repeated-turning-on-and-off-of-indicator
- async turn_off_all() None [source]¶
Send all off command
References
https://toio.github.io/toio-spec/en/docs/ble_light#turn-off-all-indicators
- async turn_off(indicator_id: int) None [source]¶
Send off command
- Parameters:
indicator_id (int) – Indicator ID
References
https://toio.github.io/toio-spec/en/docs/ble_light#turn-off-a-specific-indicator