miio.integrations.lumi.gateway.devices.light module

Xiaomi Zigbee lights.

class miio.integrations.lumi.gateway.devices.light.LightBulb(gw: Gateway, dev_info: SubDeviceInfo, model_info: Dict | None = None)[source]

Bases: SubDevice

Base class for subdevice light bulbs.

get_battery() int | None

Update the battery level, if available.

get_firmware_version() int | None

Returns firmware version.

get_property(property)

Get the value of a property of the subdevice.

get_property_exp(properties)

Get the value of a bunch of properties of the subdevice.

get_voltage() float | None

Update the battery voltage, if available.

off()[source]

Turn bulb off.

on()[source]

Turn bulb on.

push_callback(action: str, params: str)

Push callback received from the push server.

register_callback(id: str, callback: Callable[[str, str], None])

Register a external callback function for updates of this subdevice.

remove_callback(id: str)

Remove a external callback using its id.

send(command)

Send a command/query to the subdevice.

send_arg(command, arguments)

Send a command/query including arguments to the subdevice.

set_brightness(brightness)[source]

Set the brightness of the bulb 1-100.

set_color_temp(ctt)[source]

Set the color temperature of the bulb ctt_min-ctt_max.

set_property(property, value)

Set a device property of the subdevice.

async subscribe_events()

subscribe to all subdevice events using the push server.

unpair()

Unpair this device from the gateway.

async unsubscribe_events()

Unsubscibe from events registered in the gateway memory.

update()

Update all device properties.

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.