From 43244e2a14b24a00f32100703de44998e51a9ce3 Mon Sep 17 00:00:00 2001 From: Nathanael Marchand Date: Tue, 10 Oct 2023 11:27:14 +0200 Subject: [PATCH 1/2] feat: add missing mixins --- src/pyatmo/modules/legrand.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pyatmo/modules/legrand.py b/src/pyatmo/modules/legrand.py index 1b85137e..613976c2 100644 --- a/src/pyatmo/modules/legrand.py +++ b/src/pyatmo/modules/legrand.py @@ -4,6 +4,7 @@ import logging from pyatmo.modules.module import ( + BatteryMixin, ContactorMixin, Dimmer, EnergyMixin, @@ -24,15 +25,15 @@ # pylint: disable=R0901 -class NLG(FirmwareMixin, Module): +class NLG(FirmwareMixin, OffloadMixin, WifiMixin, Module): """Legrand gateway.""" -class NLT(FirmwareMixin, Module): +class NLT(FirmwareMixin, BatteryMixin, Module): """Legrand global remote control.""" -class NLP(Switch): +class NLP(Switch, HistoryMixin, PowerMixin, OffloadMixin, Module): """Legrand plug.""" @@ -104,7 +105,7 @@ class NLPS(FirmwareMixin, PowerMixin, EnergyMixin, Module): """Legrand / BTicino smart load shedder.""" -class NLC(FirmwareMixin, SwitchMixin, Module): +class NLC(FirmwareMixin, SwitchMixin, HistoryMixin, PowerMixin, OffloadMixin, Module): """Legrand / BTicino cable outlet.""" From 49dad0defa258ee36e43b77fcb235b3cc55237b5 Mon Sep 17 00:00:00 2001 From: Nathanael Marchand Date: Tue, 10 Oct 2023 11:27:51 +0200 Subject: [PATCH 2/2] fix: fix query parameters serialization --- src/pyatmo/modules/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pyatmo/modules/module.py b/src/pyatmo/modules/module.py index acfa4caf..6747c4d8 100644 --- a/src/pyatmo/modules/module.py +++ b/src/pyatmo/modules/module.py @@ -467,11 +467,11 @@ async def async_update_measures( if start_time is None: start_time = end_time - days * 24 * 60 * 60 - data_point = MeasureType.SUM_ENERGY_ELEC_BASIC.name + data_point = MeasureType.SUM_ENERGY_ELEC_BASIC.value params = { "device_id": self.bridge, "module_id": self.entity_id, - "scale": interval.name, + "scale": interval.value, "type": data_point, "date_begin": start_time, "date_end": end_time,