edilkamin package

Submodules

edilkamin module

class edilkamin.Power(*values)

Bases: Enum

OFF = 0
ON = 1
edilkamin.bluetooth_mac_to_wifi_mac(mac: str) str

Convert Bluetooth MAC address to WiFi MAC address.

Edilkamin devices have BLE MAC addresses that are offset by +2 from their WiFi MAC.

>>> bluetooth_mac_to_wifi_mac("A8:03:2A:FE:D5:0B")
'a8:03:2a:fe:d5:09'
edilkamin.device_info_get_airkare(info: dict) bool

Get airkare status from cached info.

edilkamin.device_info_get_alarm_reset(info: dict) bool

Get alarm reset value from cached info.

edilkamin.device_info_get_autonomy_time(info: dict) int

Get autonomy time from cached info.

edilkamin.device_info_get_chrono_mode(info: dict) bool

Get chrono mode status from cached info.

edilkamin.device_info_get_easy_timer(info: dict) int

Get easy timer value from cached info.

edilkamin.device_info_get_environment_temperature(info: dict) int

Get environment temperature value from cached info.

edilkamin.device_info_get_fan_speed(info: dict, fan_id: int) int

Get fan id speed value from cached info.

edilkamin.device_info_get_manual_power_level(info: dict) int

Get manual power level value from cached info.

edilkamin.device_info_get_pellet_reserve(info: dict) bool

Get pellet reserve status from cached info.

edilkamin.device_info_get_perform_cochlea_loading(info: dict) bool

Get perform cochlea loading state from cached info.

edilkamin.device_info_get_power(info: dict) Power

Get device current power value from cached info.

edilkamin.device_info_get_relax_mode(info: dict) bool

Get relax mode status from cached info.

edilkamin.device_info_get_serial_number(info: dict) str

Get device serial number from cached info.

Note: Serial numbers may contain binary/control characters from device firmware. Use serial_number_hex() or serial_number_display() for safe string representations.

edilkamin.device_info_get_standby_mode(info: dict) bool

Get standby mode status from cached info.

edilkamin.device_info_get_target_temperature(info: dict) int

Get target temperature value from cached info.

edilkamin.discover_devices(convert: bool = True) tuple[str, ...]

Discover Edilkamin devices using Bluetooth.

Scans for nearby Edilkamin devices and returns their MAC addresses. By default, returns WiFi MAC addresses (used for API calls). Set convert=False to get raw Bluetooth MAC addresses.

Requires the ‘ble’ extra: pip install edilkamin[ble]

Returns:

Tuple of MAC address strings in format ‘aa:bb:cc:dd:ee:ff’

edilkamin.discover_devices_helper(devices: tuple[dict, ...], convert: bool = True) tuple[str, ...]

Filter discovered Bluetooth devices for Edilkamin devices.

Given a list of bluetooth addresses/names return the ones matching for Edilkamin.

>>> devices = (
...     {"name": "EDILKAMIN_EP", "address": "01:23:45:67:89:AB"},
...     {"name": "another_device", "address": "AA:BB:CC:DD:EE:FF"},
... )
>>> discover_devices_helper(devices)
('01:23:45:67:89:a9',)
edilkamin.serial_number_display(serial: str) str

Get a display-safe version of the serial number.

Removes non-printable characters and strips whitespace, returning only the human-readable portion of the serial number.

Args:

serial: Raw serial number string (may contain binary data)

Returns:

Printable characters only, stripped of leading/trailing whitespace

Example:
>>> raw = "C]7JSS   L
ÿ” # Contains control chars
>>> display = serial_number_display(raw)
>>> print(display)
C]7JSS L
edilkamin.serial_number_from_hex(hex_serial: str) str

Convert hex-encoded serial number back to raw string.

Args:

hex_serial: Hex-encoded serial string

Returns:

Raw serial number string

Example:
>>> raw = serial_number_from_hex("1a435d374a53532020204c191a0cc3bf")
edilkamin.serial_number_hex(serial: str) str

Convert serial number to hex string for safe storage/display.

Serial numbers from Edilkamin devices may contain binary control characters. This function converts the serial to a hex string that is safe to store, display, and transmit.

Args:

serial: Raw serial number string (may contain binary data)

Returns:

Hex-encoded string (e.g., “1a435d374a5353…”)

Example:
>>> raw = "C]7JSS   L
ÿ” # Example with control chars
>>> hex_serial = serial_number_hex(raw)
>>> print(hex_serial)
1a435d374a53532020204c191a0cc3bf
edilkamin.sign_in(username: str, password: str, use_legacy_api: bool = False) str

Sign in and return token.

Args:

username: Edilkamin account username password: Edilkamin account password use_legacy_api: If True, use old AWS API and access_token.

If False (default), use new API and id_token.

Returns:

JWT token for API authentication