miio.extract_tokens module

class miio.extract_tokens.BackupDatabaseReader(dump_raw=False)[source]

Bases: object

Main class for reading backup files.

Example::
r = BackupDatabaseReader()
devices = r.read_tokens("/tmp/database.sqlite")
for dev in devices:
    print("Got %s with token %s" % (dev.ip, dev.token)
static decrypt_ztoken(ztoken)[source]

Decrypt the given ztoken, used by apple.

static dump_raw(dev)[source]

Dump whole database.

read_android() Iterator[DeviceConfig][source]

Read Android-specific database file.

read_apple() Iterator[DeviceConfig][source]

Read Apple-specific database file.

read_tokens(db) Iterator[DeviceConfig][source]

Read device information out from a given database file.

Parameters

db (str) – Database file

class miio.extract_tokens.DeviceConfig(name, mac, ip, token, model, everything=None)[source]

Bases: object

A presentation of a device including its name, model, ip etc.

miio.extract_tokens.read_android_yeelight(db) Iterator[DeviceConfig][source]

Read tokens from Yeelight’s android backup.