Bump sunweg to 2.1.1 (#113767)

This commit is contained in:
Lucas Mindêllo de Andrade 2024-03-19 04:50:11 -03:00 committed by GitHub
parent 00f94feec9
commit 089a3ab6d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 39 additions and 3 deletions

View File

@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/sunweg/",
"iot_class": "cloud_polling",
"loggers": ["sunweg"],
"requirements": ["sunweg==2.1.0"]
"requirements": ["sunweg==2.1.1"]
}

View File

@ -2631,7 +2631,7 @@ subarulink==0.7.9
sunwatcher==0.2.1
# homeassistant.components.sunweg
sunweg==2.1.0
sunweg==2.1.1
# homeassistant.components.surepetcare
surepy==0.9.0

View File

@ -2032,7 +2032,7 @@ subarulink==0.7.9
sunwatcher==0.2.1
# homeassistant.components.sunweg
sunweg==2.1.0
sunweg==2.1.1
# homeassistant.components.surepetcare
surepy==0.9.0

View File

@ -68,3 +68,23 @@ def plant_fixture(inverter_fixture) -> Plant:
)
plant.inverters.append(inverter_fixture)
return plant
@pytest.fixture
def plant_fixture_alternative(inverter_fixture) -> Plant:
"""Define Plant fixture."""
plant = Plant(
123456,
"Plant #123",
29.5,
0.5,
0,
12.786912,
24.0,
"kWh",
332.2,
0.012296,
None,
)
plant.inverters.append(inverter_fixture)
return plant

View File

@ -76,6 +76,22 @@ async def test_sunwegdata_update_success(plant_fixture) -> None:
assert len(data.data.inverters) == 1
async def test_sunwegdata_update_success_alternative(plant_fixture_alternative) -> None:
"""Test SunWEGData success on update."""
api = MagicMock()
api.plant = MagicMock(return_value=plant_fixture_alternative)
api.complete_inverter = MagicMock()
data = SunWEGData(api, 0)
data.update()
assert data.data.id == plant_fixture_alternative.id
assert data.data.name == plant_fixture_alternative.name
assert data.data.kwh_per_kwp == plant_fixture_alternative.kwh_per_kwp
assert data.data.last_update == plant_fixture_alternative.last_update
assert data.data.performance_rate == plant_fixture_alternative.performance_rate
assert data.data.saving == plant_fixture_alternative.saving
assert len(data.data.inverters) == 1
async def test_sunwegdata_get_api_value_none(plant_fixture) -> None:
"""Test SunWEGData none return on get_api_value."""
api = MagicMock()