1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Bump pynina to 1.0.2 (#161013)

This commit is contained in:
DeerMaximum
2026-01-16 07:24:58 +00:00
committed by GitHub
parent 581b554a66
commit ad47eccf5f
10 changed files with 25 additions and 25 deletions

View File

@@ -141,7 +141,7 @@ class NinaConfigFlow(ConfigFlow, domain=DOMAIN):
try:
self._all_region_codes_sorted = swap_key_value(
await nina.getAllRegionalCodes()
await nina.get_all_regional_codes()
)
except ApiError:
return self.async_abort(reason="no_fetch")
@@ -221,7 +221,7 @@ class OptionsFlowHandler(OptionsFlowWithReload):
try:
self._all_region_codes_sorted = swap_key_value(
await nina.getAllRegionalCodes()
await nina.get_all_regional_codes()
)
except ApiError:
return self.async_abort(reason="no_fetch")

View File

@@ -66,7 +66,7 @@ class NINADataUpdateCoordinator(
regions: dict[str, str] = config_entry.data[CONF_REGIONS]
for region in regions:
self._nina.addRegion(region)
self._nina.add_region(region)
super().__init__(
hass,
@@ -151,7 +151,7 @@ class NINADataUpdateCoordinator(
raw_warn.sent or "",
raw_warn.start or "",
raw_warn.expires or "",
raw_warn.isValid(),
raw_warn.is_valid,
)
warnings_for_regions.append(warning_data)

View File

@@ -8,6 +8,6 @@
"iot_class": "cloud_polling",
"loggers": ["pynina"],
"quality_scale": "bronze",
"requirements": ["pynina==0.3.6"],
"requirements": ["pynina==1.0.2"],
"single_config_entry": true
}

2
requirements_all.txt generated
View File

@@ -2234,7 +2234,7 @@ pynetgear==0.10.10
pynetio==0.1.9.1
# homeassistant.components.nina
pynina==0.3.6
pynina==1.0.2
# homeassistant.components.nintendo_parental_controls
pynintendoauth==1.0.2

View File

@@ -1887,7 +1887,7 @@ pynecil==4.2.1
pynetgear==0.10.10
# homeassistant.components.nina
pynina==0.3.6
pynina==1.0.2
# homeassistant.components.nintendo_parental_controls
pynintendoauth==1.0.2

View File

@@ -17,7 +17,7 @@ from tests.common import (
async def setup_platform(hass: HomeAssistant, config_entry: MockConfigEntry) -> None:
"""Set up the NINA platform."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
await hass.config_entries.async_setup(config_entry.entry_id)

View File

@@ -25,7 +25,7 @@
'id': 'biw.BIWAPP-69634',
'is_valid': False,
'recommended_actions': '',
'sender': '',
'sender': None,
'sent': '1999-08-07T10:59:00+02:00',
'severity': 'Minor',
'start': '',

View File

@@ -49,7 +49,7 @@ def assert_dummy_entry_created(result: dict[str, Any]) -> None:
async def test_step_user_connection_error(hass: HomeAssistant) -> None:
"""Test starting a flow by user but no connection."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
side_effect=ApiError("Could not connect to Api"),
):
result: dict[str, Any] = await hass.config_entries.flow.async_init(
@@ -63,7 +63,7 @@ async def test_step_user_connection_error(hass: HomeAssistant) -> None:
async def test_step_user_unexpected_exception(hass: HomeAssistant) -> None:
"""Test starting a flow by user but with an unexpected exception."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
side_effect=Exception("DUMMY"),
):
result: dict[str, Any] = await hass.config_entries.flow.async_init(
@@ -77,7 +77,7 @@ async def test_step_user_unexpected_exception(hass: HomeAssistant) -> None:
async def test_step_user(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> None:
"""Test starting a flow by user with valid values."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
result: dict[str, Any] = await hass.config_entries.flow.async_init(
@@ -95,7 +95,7 @@ async def test_step_user(hass: HomeAssistant, mock_setup_entry: AsyncMock) -> No
async def test_step_user_no_selection(hass: HomeAssistant) -> None:
"""Test starting a flow by user with no selection."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
result: dict[str, Any] = await hass.config_entries.flow.async_init(
@@ -121,7 +121,7 @@ async def test_step_user_already_configured(
) -> None:
"""Test starting a flow by user, but it was already configured."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
result = await hass.config_entries.flow.async_init(
@@ -141,7 +141,7 @@ async def test_options_flow_init(
with (
patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
),
):
@@ -195,7 +195,7 @@ async def test_options_flow_with_no_selection(
with (
patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
),
):
@@ -263,7 +263,7 @@ async def test_options_flow_connection_error(
await setup_platform(hass, mock_config_entry)
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
side_effect=ApiError("Could not connect to Api"),
):
result = await hass.config_entries.options.async_init(
@@ -283,7 +283,7 @@ async def test_options_flow_unexpected_exception(
with (
patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
side_effect=Exception("DUMMY"),
),
):
@@ -312,7 +312,7 @@ async def test_options_flow_entity_removal(
with (
patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
),
):

View File

@@ -32,7 +32,7 @@ async def test_diagnostics(
"""Test diagnostics."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
config_entry: MockConfigEntry = MockConfigEntry(

View File

@@ -28,7 +28,7 @@ async def init_integration(hass: HomeAssistant) -> MockConfigEntry:
"""Set up the NINA integration in Home Assistant."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
entry: MockConfigEntry = MockConfigEntry(
@@ -54,7 +54,7 @@ async def test_config_migration_from1_1(hass: HomeAssistant) -> None:
)
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
old_conf_entry.add_to_hass(hass)
@@ -82,7 +82,7 @@ async def test_config_migration_from1_2(hass: HomeAssistant) -> None:
)
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
old_conf_entry.add_to_hass(hass)
@@ -104,7 +104,7 @@ async def test_config_migration_downgrade(hass: HomeAssistant) -> None:
)
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
wraps=mocked_request_function,
):
conf_entry.add_to_hass(hass)
@@ -126,7 +126,7 @@ async def test_config_entry_not_ready(hass: HomeAssistant) -> None:
async def test_sensors_connection_error(hass: HomeAssistant) -> None:
"""Test the creation and values of the NINA sensors with no connected."""
with patch(
"pynina.baseApi.BaseAPI._makeRequest",
"pynina.api_client.APIClient.make_request",
side_effect=ApiError("Could not connect to Api"),
):
conf_entry: MockConfigEntry = MockConfigEntry(