miio.integrations.lumi.gateway.devices.subdevice module
Xiaomi Gateway subdevice base class.
- class miio.integrations.lumi.gateway.devices.subdevice.SubDevice(gw: Gateway, dev_info: SubDeviceInfo, model_info: Dict | None = None)[source]
Bases:
object
Base class for all subdevices of the gateway these devices are connected through zigbee.
- register_callback(id: str, callback: Callable[[str, str], None])[source]
Register a external callback function for updates of this subdevice.
- property battery
Return the battery level in %.
- property device_type
Return the device type name.
- property firmware_version
Return the firmware version.
- property model
Return the device model.
- property name
Return the name of the device.
- property status
Return sub-device status as a dict containing all properties.
- property voltage
Return the battery voltage in V.
- property zigbee_model
Return the zigbee device model.