python-homewizard-energy 8.2.0__tar.gz → 8.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/PKG-INFO +1 -1
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/models.py +23 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/pyproject.toml +1 -1
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/LICENSE +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/README.md +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/__init__.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/const.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/errors.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/homewizard_energy.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/py.typed +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/utils.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v1/__init__.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v1/const.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/__init__.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/cacert.py +0 -0
- {python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/const.py +0 -0
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/models.py
RENAMED
|
@@ -85,6 +85,12 @@ class CombinedModels:
|
|
|
85
85
|
self.system = System()
|
|
86
86
|
self.system.wifi_ssid = self.measurement.wifi_ssid
|
|
87
87
|
|
|
88
|
+
## measurement.wifi_strength -> system.wifi_strength_pct
|
|
89
|
+
if self.measurement is not None and self.measurement.wifi_strength is not None:
|
|
90
|
+
if self.system is None:
|
|
91
|
+
self.system = System()
|
|
92
|
+
self.system.wifi_strength_pct = self.measurement.wifi_strength
|
|
93
|
+
|
|
88
94
|
## state.brightness -> system.status_led_brightness_pct
|
|
89
95
|
if self.state is not None and self.state.brightness is not None:
|
|
90
96
|
if self.system is None:
|
|
@@ -540,6 +546,8 @@ class SystemUpdate(UpdateBaseModel):
|
|
|
540
546
|
class System(BaseModel):
|
|
541
547
|
"""Represent System config."""
|
|
542
548
|
|
|
549
|
+
wifi_strength_pct: int | None = None
|
|
550
|
+
|
|
543
551
|
wifi_ssid: str | None = field(default=None)
|
|
544
552
|
wifi_rssi_db: int | None = field(default=None)
|
|
545
553
|
cloud_enabled: bool | None = field(default=None)
|
|
@@ -547,6 +555,21 @@ class System(BaseModel):
|
|
|
547
555
|
status_led_brightness_pct: int | None = field(default=None)
|
|
548
556
|
api_v1_enabled: bool | None = field(default=None)
|
|
549
557
|
|
|
558
|
+
@classmethod
|
|
559
|
+
def __post_deserialize__(cls, obj: System) -> System:
|
|
560
|
+
_ = cls # Unused
|
|
561
|
+
|
|
562
|
+
if obj.wifi_rssi_db is not None:
|
|
563
|
+
obj.wifi_strength_pct = (
|
|
564
|
+
0
|
|
565
|
+
if obj.wifi_rssi_db <= -100 or obj.wifi_rssi_db == 0
|
|
566
|
+
else 100
|
|
567
|
+
if obj.wifi_rssi_db >= -50
|
|
568
|
+
else 2 * (obj.wifi_rssi_db + 100)
|
|
569
|
+
)
|
|
570
|
+
|
|
571
|
+
return obj
|
|
572
|
+
|
|
550
573
|
|
|
551
574
|
@dataclass(kw_only=True)
|
|
552
575
|
class Token(BaseModel):
|
|
File without changes
|
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/__init__.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/const.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/errors.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/py.typed
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/utils.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v1/__init__.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v1/const.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/__init__.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/cacert.py
RENAMED
|
File without changes
|
{python_homewizard_energy-8.2.0 → python_homewizard_energy-8.3.0}/homewizard_energy/v2/const.py
RENAMED
|
File without changes
|