ElectricityMixin
- class meross_iot.controller.mixins.electricity.ElectricityMixin(device_uuid: str, manager, **kwargs)
- async async_get_instant_metrics(channel=0, timeout: float | None = None, *args, **kwargs) PowerInfo
Polls the device to gather the instant power consumption for this device. Please note that current/voltage combination may not be accurate as power is. So, refer to power attribute rather than calculate it as Voltage * Current. Avoid flooding the device by calling this methods so often. Instead. you should rely on the cached value offered by get_last_sample(): if it’s None or if the sample_timestamp of the offered value is not recent enough, then you should call this method to refresh it.
- Parameters:
channel – channel where to read metrics from. Defaults to 0
- Returns:
a PowerInfo object describing the current measure data
- get_last_sample(channel=0, *args, **kwargs) PowerInfo | None
Returns the previously cached value for the sensed power information (if any).
- Parameters:
channel – The channel to gather info from
- Returns: