miio.gateway.devices.sensor module

Xiaomi Zigbee sensors.

class miio.gateway.devices.sensor.Vibration(gw: Gateway, dev_info: miio.gateway.devices.subdevice.SubDeviceInfo, model_info: Optional[Dict] = None)[source]

Bases: miio.gateway.devices.subdevice.SubDevice

Base class for subdevice vibration sensor.

get_battery(*args, **kwargs)
get_firmware_version(*args, **kwargs)
get_property(*args, **kwargs)
get_property_exp(*args, **kwargs)
get_voltage(*args, **kwargs)
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(*args, **kwargs)
send_arg(*args, **kwargs)
set_property(*args, **kwargs)
set_vibration_sensitivity(*args, **kwargs)
subscribe_events()

subscribe to all subdevice events using the push server.

unpair(*args, **kwargs)
unsubscribe_events()

Unsubscibe from events registered in the gateway memory.

update(*args, **kwargs)
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.