miio.cloud module

exception miio.cloud.CloudException[source]

Bases: Exception

Exception raised for cloud connectivity issues.


Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

class miio.cloud.CloudDeviceInfo(did: str, token: str, name: str, model: str, ip: str, description: str, parent_id: str, ssid: str, mac: str, locale: List[str], raw_data: str)[source]

Bases: object

Container for device data from the cloud.

Note that only some selected information is directly exposed, but you can access the raw data using raw_data.

classmethod from_micloud(response, locale)[source]
description: str
did: str
ip: str
locale: List[str]
mac: str
model: str
name: str
parent_id: str
raw_data: str
ssid: str
token: str
class miio.cloud.CloudInterface(username, password)[source]

Bases: object

Cloud interface using micloud library.

Currently used only for obtaining the list of registered devices.


ci = CloudInterface(username="foo", password=...)
devs = ci.get_devices()
for did, dev in devs.items():
get_devices(locale: Optional[str] = None) Dict[str, CloudDeviceInfo][source]

Return a list of available devices keyed with a device id.

If no locale is given, all known locales are browsed. If a device id is already seen in another locale, it is excluded from the results.