hyxi-cloud-api 1.3.7__tar.gz → 1.3.8__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.
- {hyxi_cloud_api-1.3.7/src/hyxi_cloud_api.egg-info → hyxi_cloud_api-1.3.8}/PKG-INFO +1 -1
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/pyproject.toml +1 -1
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api/__init__.py +1 -1
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api/api.py +36 -20
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8/src/hyxi_cloud_api.egg-info}/PKG-INFO +1 -1
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_compute_battery_metrics.py +21 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/LICENSE +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/README.md +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/setup.cfg +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api.egg-info/SOURCES.txt +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api.egg-info/dependency_links.txt +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api.egg-info/requires.txt +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api.egg-info/top_level.txt +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_additional_coverage.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_alarm_push.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_all_in_one.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_api.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_build_plant_tasks.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_caching.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_compute_derived_metrics.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_compute_grid_metrics.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_compute_load_metrics.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_device_control.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_device_entry.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_devices_errors.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_discovery.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_execute_device_tasks.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_execute_metric_tasks.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_execute_metrics_and_map_alarms.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_extract_battery_info.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_extract_device_info_metadata.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fetch_and_process_alarms.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fetch_device_list_for_plant.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fetch_plants.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fetch_state.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fetch_sub_device_list.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_filter_metrics.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_fuzz_parser.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_get_f.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_handle_back_discovery_alarm.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_info_errors.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_mask_id.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_metrics_errors.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_parse_data_list.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_parse_ems_kv.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_parser.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_process_alarms_and_back_discovery.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_process_devices_for_plant.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_push.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_sanitize_dict.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_sanitize_list.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_security_fix.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_subscriptions.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_token_errors.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_token_handling.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_validate_post_rate_ms.py +0 -0
- {hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_validate_subscription_device_sns.py +0 -0
|
@@ -5,5 +5,5 @@ from .api import HyxiApiClient
|
|
|
5
5
|
# Module-level alias so callers can do: from hyxi_cloud_api import VPP_ACTIVE_MODES
|
|
6
6
|
VPP_ACTIVE_MODES: frozenset[str] = HyxiApiClient.VPP_ACTIVE_MODES
|
|
7
7
|
|
|
8
|
-
__version__ = "1.3.
|
|
8
|
+
__version__ = "1.3.8"
|
|
9
9
|
__all__ = ["VPP_ACTIVE_MODES", "HyxiApiClient"]
|
|
@@ -646,28 +646,44 @@ def _compute_battery_metrics(
|
|
|
646
646
|
return True
|
|
647
647
|
|
|
648
648
|
# Unify cumulative battery charge energy telemetry keys to resolve polling/push mismatch
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
derived["totalEchg"] =
|
|
658
|
-
derived["
|
|
649
|
+
total_echg_val = (
|
|
650
|
+
_get_f("totalEchg", m_raw) if _is_valid_metric("totalEchg") else None
|
|
651
|
+
)
|
|
652
|
+
bat_charge_val = (
|
|
653
|
+
_get_f("batCharge", m_raw) if _is_valid_metric("batCharge") else None
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
if total_echg_val is not None:
|
|
657
|
+
derived["totalEchg"] = total_echg_val
|
|
658
|
+
derived["bat_charge_total"] = total_echg_val
|
|
659
|
+
if bat_charge_val is None:
|
|
660
|
+
derived["batCharge"] = total_echg_val
|
|
661
|
+
|
|
662
|
+
if bat_charge_val is not None:
|
|
663
|
+
derived["batCharge"] = bat_charge_val
|
|
664
|
+
if total_echg_val is None:
|
|
665
|
+
derived["totalEchg"] = bat_charge_val
|
|
666
|
+
derived["bat_charge_total"] = bat_charge_val
|
|
659
667
|
|
|
660
668
|
# Unify cumulative battery discharge energy telemetry keys to resolve polling/push mismatch
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
derived["totalEdchg"] =
|
|
670
|
-
derived["
|
|
669
|
+
total_edchg_val = (
|
|
670
|
+
_get_f("totalEdchg", m_raw) if _is_valid_metric("totalEdchg") else None
|
|
671
|
+
)
|
|
672
|
+
bat_discharge_val = (
|
|
673
|
+
_get_f("batDisCharge", m_raw) if _is_valid_metric("batDisCharge") else None
|
|
674
|
+
)
|
|
675
|
+
|
|
676
|
+
if total_edchg_val is not None:
|
|
677
|
+
derived["totalEdchg"] = total_edchg_val
|
|
678
|
+
derived["bat_discharge_total"] = total_edchg_val
|
|
679
|
+
if bat_discharge_val is None:
|
|
680
|
+
derived["batDisCharge"] = total_edchg_val
|
|
681
|
+
|
|
682
|
+
if bat_discharge_val is not None:
|
|
683
|
+
derived["batDisCharge"] = bat_discharge_val
|
|
684
|
+
if total_edchg_val is None:
|
|
685
|
+
derived["totalEdchg"] = bat_discharge_val
|
|
686
|
+
derived["bat_discharge_total"] = bat_discharge_val
|
|
671
687
|
|
|
672
688
|
|
|
673
689
|
def _compute_pv_metrics(m_raw: dict, derived: dict[str, float]) -> None:
|
|
@@ -107,3 +107,24 @@ def test_compute_battery_metrics_none_device_type():
|
|
|
107
107
|
_compute_battery_metrics(m_raw, derived, None) # type: ignore
|
|
108
108
|
assert derived["bat_charging"] == 100.0
|
|
109
109
|
assert derived["bat_power_dc"] == -100.0
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def test_compute_battery_metrics_both_present():
|
|
113
|
+
"""Test that when both polling and daily keys are present, they are preserved.
|
|
114
|
+
|
|
115
|
+
Cumulative values should take priority for battery totals.
|
|
116
|
+
"""
|
|
117
|
+
derived: dict[str, float] = {}
|
|
118
|
+
m_raw = {
|
|
119
|
+
"totalEchg": 366.3,
|
|
120
|
+
"totalEdchg": 371.3,
|
|
121
|
+
"batCharge": 2.3,
|
|
122
|
+
"batDisCharge": 4.4,
|
|
123
|
+
}
|
|
124
|
+
_compute_battery_metrics(m_raw, derived, "OTHER")
|
|
125
|
+
assert derived["bat_charge_total"] == 366.3
|
|
126
|
+
assert derived["bat_discharge_total"] == 371.3
|
|
127
|
+
assert derived["totalEchg"] == 366.3
|
|
128
|
+
assert derived["totalEdchg"] == 371.3
|
|
129
|
+
assert derived["batCharge"] == 2.3
|
|
130
|
+
assert derived["batDisCharge"] == 4.4
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/src/hyxi_cloud_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_process_alarms_and_back_discovery.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyxi_cloud_api-1.3.7 → hyxi_cloud_api-1.3.8}/tests/test_validate_subscription_device_sns.py
RENAMED
|
File without changes
|