BaseDevice
- class meross_iot.controller.device.BaseDevice(device_uuid: str, manager, **kwargs)
A BaseDevice is a generic representation of a Meross device. Any BaseDevice is characterized by some generic information, such as user’s defined name, type (i.e. device specific model), firmware/hardware version, a Meross internal identifier, a library assigned internal identifier.
- async async_update(*args, **kwargs) None
Forces a full data update on the device. If your network bandwidth is limited or you are running this program on an embedded device, try to invoke this method only when strictly needed. Most of the parameters of a device are updated automatically upon push-notification received by the meross MQTT cloud. :return: None
- property channels: List[ChannelInfo]
List of channels exposed by this device. Multi-channel devices might expose a master switch at index 0. :return:
- decrypt(encrypted_message_bytes: bytes) bytes
Decrypt the message and returns the war decrypted bytes :param encrypted_message_bytes: :return:
- property default_command_timeout
Represents the default timeout that is applied to command execution against this device. Usually, every method allows to override this timeout via an appropriate timeout argument: that argument takes precedence over this default.
- encrypt(message_data_bytes: bytes) str
Encrypts the message into a base64 string :param message_data_bytes: :return:
- property firmware_version: str
Device firmware version. When unavailable, ‘unknown’ is returned :return:
- property hardware_version: str
Device hardware revision :return:
- property internal_id: str
Internal ID used by this library to identify meross devices. It’s basically composed by the Meross ID plus some prefix/suffix. :return:
- is_encryption_key_set() bool
Returns whether an encryption key has been already set :return:
- lookup_channel(channel_id_or_name: int | str)
Looks up a channel by channel id or channel name :param channel_id_or_name: :return:
- property name: str
User’s defined name of the device :return:
- property online_status: OnlineStatus
Current device online status :return:
- register_push_notification_handler_coroutine(coro: Callable[[Namespace, dict, str], Awaitable]) None
Registers a coroutine so that it gets invoked whenever a push notification is delivered to this device or when the device state is changed. This allows the developer to “react” to notifications state change due to other users operating the device. :param coro: coroutine-function to invoke when the state changes. Its signature must be (namespace: Namespace, data: dict, device_internal_id: str) :return:
- set_encryption_key(*args, **kwargs)
Sets the encryption key to be used for encryption and decryption :param args: :param kwargs: :return:
- support_encryption() bool
Returns true if encryption is supported by this device :return:
- property type: str
Device model type :return:
- unregister_push_notification_handler_coroutine(coro: Callable[[Namespace, dict, str], Awaitable]) None
Unregisters the event handler :param coro: coroutine-function: a function that, when invoked, returns a Coroutine object that can be awaited. This coroutine function should have been previously registered :return:
- property uuid: str
Meross identifier of the device. :return: