konashi.Builtin package

Submodules

konashi.Builtin.AccelGyro module

class konashi.Builtin.AccelGyro._AccelGyro(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set_callback(notify_callback: Callable[[Tuple[float, float, float], Tuple[float, float, float]], None]) None

Set the callback for the accelerometer and gyroscope data.

Parameters

notify_callback (Callable[[Tuple[float,float,float],Tuple[float,float,float]], None]) – The callback. The function take 2 parameters and returns nothing: Tuple[float,float,float]: The acceleration in g (9.8 m/s^2). Tuple[float,float,float]: The angular speed in degree/s.

konashi.Builtin.Humidity module

class konashi.Builtin.Humidity._Humidity(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set_callback(notify_callback: Callable[[float], None]) None

Set a callback for the humidity data.

Parameters

notify_callback (Callable[[float], None]) – The callback. The function takes 1 parameter and return nothing: float: The humidity in %.

konashi.Builtin.Presence module

class konashi.Builtin.Presence._Presence(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set_callback(notify_callback: Callable[[bool], None]) None

Set a callback for the presence sensor data.

Parameters

notify_callback (Callable[[bool], None]) – The callback. The function takes 1 parameter and returns nothing: bool: True if presence is detected, False otherwise.

konashi.Builtin.Pressure module

class konashi.Builtin.Pressure._Pressure(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set_callback(notify_callback: Callable[[float], None]) None

Set a callback for the pressure sensor data.

Parameters

notify_callback (Callable[[float], None]) – The callback. The function takes 1 parameter and returns nothing: float: The pressure in hectopascal.

konashi.Builtin.RGBLed module

class konashi.Builtin.RGBLed._RGBLed(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set(r: int, g: int, b: int, a: int, duration: int, callback: Optional[Callable[[Tuple[int, int, int, int]], None]] = None) None

Set the color of the LED, transitioning during the specified duration. If a callback is provided, it will be called when the color transition has finished.

Parameters
  • r (int) – The Red color component (valid range is [0,255], the value is truncated if out of range).

  • g (int) – The Green color component (valid range is [0,255], the value is truncated if out of range).

  • b (int) – The Blue color component (valid range is [0,255], the value is truncated if out of range).

  • a (int) – The Alpha component (valid range is [0,255], the value is truncated if out of range).

  • duration (int) – The time to transition to the new color in milliseconds (valid range is [0,65535], the value is truncated if out of range).

  • callback (Callable[[Tuple[int,int,int,int]], None], optional) – The callback. Defaults to None. The function takes 1 parameter and returns nothing: Tuple[int,int,int,int]: The current LED color in the form (red,green,blue,alpha).

konashi.Builtin.Temperature module

class konashi.Builtin.Temperature._Temperature(konashi)

Bases: _KonashiElementBase

_ntf_cb(sender, data)
async _on_connect() None
async set_callback(notify_callback: Callable[[float], None]) None

Set a callback for the temperature sensor data.

Parameters

notify_callback (Callable[[float], None]) – The callback. The function takes 1 parameter and returns nothing: float: The temperature in degrees Celsius.

Module contents

class konashi.Builtin._Builtin(konashi)

Bases: _KonashiElementBase

_ntf_cb_version(sender, data)
async _on_connect()
property accelgyro: _AccelGyro

This Konashi devices Accel and Gyro sensor interface.

property humidity: _Humidity

This Konashi devices humidity sendor interface.

property presence: _Presence

This Konashi devices presence sensor interface.

property pressure: _Pressure

This Konashi devices pressure sensor interface.

property rgbled: _RGBLed

This Konashi devices RGB LED interface.

property temperature: _Temperature

This Konashi devices temperature sensor interface.