hyxi-cloud-api 1.2.3__tar.gz → 1.2.4__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.2.3/src/hyxi_cloud_api.egg-info → hyxi_cloud_api-1.2.4}/PKG-INFO +1 -1
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/pyproject.toml +1 -1
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api/__init__.py +1 -1
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api/api.py +7 -2
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4/src/hyxi_cloud_api.egg-info}/PKG-INFO +1 -1
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fetch_plants.py +25 -1
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/LICENSE +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/README.md +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/setup.cfg +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api.egg-info/SOURCES.txt +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api.egg-info/dependency_links.txt +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api.egg-info/requires.txt +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/src/hyxi_cloud_api.egg-info/top_level.txt +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_all_in_one.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_api.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_build_plant_tasks.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_caching.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_compute_derived_metrics.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_device_control.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_device_entry.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_devices_errors.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_discovery.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_execute_device_tasks.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_execute_metric_tasks.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_execute_metrics_and_map_alarms.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_extract_battery_info.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_extract_device_info_metadata.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fetch_and_process_alarms.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fetch_device_list_for_plant.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fetch_state.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fetch_sub_device_list.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_filter_metrics.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_fuzz_parser.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_get_f.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_handle_back_discovery_alarm.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_info_errors.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_mask_id.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_metrics_errors.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_parse_data_list.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_parse_ems_kv.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_parser.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_process_alarms_and_back_discovery.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_process_devices_for_plant.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_sanitize_dict.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_sanitize_list.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_security_fix.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_token_errors.py +0 -0
- {hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/tests/test_token_handling.py +0 -0
|
@@ -1309,8 +1309,13 @@ class HyxiApiClient: # pylint: disable=too-many-instance-attributes
|
|
|
1309
1309
|
data_p = res_p.get("data", {})
|
|
1310
1310
|
plants = data_p.get("list", []) if isinstance(data_p, dict) else []
|
|
1311
1311
|
|
|
1312
|
-
|
|
1313
|
-
|
|
1312
|
+
if not plants:
|
|
1313
|
+
_LOGGER.warning(
|
|
1314
|
+
"HYXI API: No plants found associated with this account. "
|
|
1315
|
+
"If your developer email differs from your app email, you must share "
|
|
1316
|
+
"your Plant from the app to the developer email first."
|
|
1317
|
+
)
|
|
1318
|
+
elif _LOGGER.isEnabledFor(logging.DEBUG):
|
|
1314
1319
|
_LOGGER.debug(
|
|
1315
1320
|
"HYXI Discovered Plants: [%s]",
|
|
1316
1321
|
", ".join(_mask_id(p.get("plantId", "UNKNOWN")) for p in plants),
|
|
@@ -18,7 +18,7 @@ mock_aiohttp = sys.modules["aiohttp"]
|
|
|
18
18
|
|
|
19
19
|
"""Tests for fetching plants from the API."""
|
|
20
20
|
|
|
21
|
-
from unittest.mock import AsyncMock, MagicMock
|
|
21
|
+
from unittest.mock import AsyncMock, MagicMock, patch
|
|
22
22
|
|
|
23
23
|
import aiohttp
|
|
24
24
|
import pytest
|
|
@@ -87,3 +87,27 @@ async def test_fetch_plants_generic_failure():
|
|
|
87
87
|
assert plants is None
|
|
88
88
|
assert api.token == "Bearer good_token"
|
|
89
89
|
assert api.token_expires_at == 9999999999.0
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
@pytest.mark.asyncio
|
|
93
|
+
async def test_fetch_plants_empty_list_warning():
|
|
94
|
+
"""Verify that _fetch_plants logs a warning when the plant list is empty."""
|
|
95
|
+
api = HyxiApiClient("ak", "sk", "https://api.com", MagicMock())
|
|
96
|
+
api._request = AsyncMock(
|
|
97
|
+
return_value=(
|
|
98
|
+
200,
|
|
99
|
+
{
|
|
100
|
+
"success": True,
|
|
101
|
+
"data": {"list": []},
|
|
102
|
+
},
|
|
103
|
+
)
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
with patch("src.hyxi_cloud_api.api._LOGGER") as mock_logger:
|
|
107
|
+
plants = await api._fetch_plants()
|
|
108
|
+
assert plants == []
|
|
109
|
+
mock_logger.warning.assert_called_once_with(
|
|
110
|
+
"HYXI API: No plants found associated with this account. "
|
|
111
|
+
"If your developer email differs from your app email, you must share "
|
|
112
|
+
"your Plant from the app to the developer email first."
|
|
113
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/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
|
{hyxi_cloud_api-1.2.3 → hyxi_cloud_api-1.2.4}/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
|