From 01941d4d164608efba64482f59af10e23643b13b Mon Sep 17 00:00:00 2001 From: Colin de Vries Date: Mon, 23 Sep 2024 17:18:25 +0200 Subject: [PATCH 1/3] Update outlet.py for Inspelning support --- src/dirigera/devices/outlet.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/dirigera/devices/outlet.py b/src/dirigera/devices/outlet.py index 65277fa..d9ab44c 100644 --- a/src/dirigera/devices/outlet.py +++ b/src/dirigera/devices/outlet.py @@ -10,8 +10,29 @@ class OutletAttributes(Attributes): + custom_name: Optional[str] = None + firmware_version: Optional[str] = None + hardware_version: Optional[str] = None + manufacturer: Optional[str] = None + model: Optional[str] = None + product_code: Optional[str] = None + serial_number: Optional[str] = None is_on: bool startup_on_off: Optional[StartupEnum] = None + energy_consumed_at_last_reset: Optional[float] = None + current_active_power: Optional[float] = None + current_amps: Optional[float] = None + current_voltage: Optional[float] = None + total_energy_consumed: Optional[float] = None + total_energy_consumed_last_updated: Optional[datetime.datetime] = None + status_light: Optional[bool] = None + identify_period: Optional[int] = None + permitting_join: Optional[bool] = None + ota_policy: Optional[str] = None + ota_progress: Optional[int] = None + ota_state: Optional[str] = None + ota_status: Optional[str] = None + time_of_last_energy_reset: Optional[datetime.datetime] = None class Outlet(Device): From e9fbcd6b6d33592c99197ece7d1c4381bc0b9971 Mon Sep 17 00:00:00 2001 From: Colin de Vries Date: Mon, 23 Sep 2024 17:19:35 +0200 Subject: [PATCH 2/3] Forgot the import --- src/dirigera/devices/outlet.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dirigera/devices/outlet.py b/src/dirigera/devices/outlet.py index d9ab44c..d407a09 100644 --- a/src/dirigera/devices/outlet.py +++ b/src/dirigera/devices/outlet.py @@ -1,4 +1,5 @@ from __future__ import annotations +import datetime from typing import Any, Optional, Dict from .device import Attributes, Device, StartupEnum from ..hub.abstract_smart_home_hub import AbstractSmartHomeHub From 251d5b37c8ca8ebd089efcbb99bc2b133ae086f3 Mon Sep 17 00:00:00 2001 From: Colin de Vries Date: Tue, 24 Sep 2024 08:00:32 +0200 Subject: [PATCH 3/3] Make the pipeline happy --- src/dirigera/devices/outlet.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/dirigera/devices/outlet.py b/src/dirigera/devices/outlet.py index d407a09..d5739d6 100644 --- a/src/dirigera/devices/outlet.py +++ b/src/dirigera/devices/outlet.py @@ -11,28 +11,18 @@ class OutletAttributes(Attributes): - custom_name: Optional[str] = None - firmware_version: Optional[str] = None - hardware_version: Optional[str] = None - manufacturer: Optional[str] = None - model: Optional[str] = None - product_code: Optional[str] = None - serial_number: Optional[str] = None + # pylint: disable=too-many-positional-arguments is_on: bool startup_on_off: Optional[StartupEnum] = None + status_light: Optional[bool] = None + identify_period: Optional[int] = None + permitting_join: Optional[bool] = None energy_consumed_at_last_reset: Optional[float] = None current_active_power: Optional[float] = None current_amps: Optional[float] = None current_voltage: Optional[float] = None total_energy_consumed: Optional[float] = None total_energy_consumed_last_updated: Optional[datetime.datetime] = None - status_light: Optional[bool] = None - identify_period: Optional[int] = None - permitting_join: Optional[bool] = None - ota_policy: Optional[str] = None - ota_progress: Optional[int] = None - ota_state: Optional[str] = None - ota_status: Optional[str] = None time_of_last_energy_reset: Optional[datetime.datetime] = None