mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Bump sunweg to 2.1.1 (#113767)
This commit is contained in:
parent
00f94feec9
commit
089a3ab6d7
@ -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"]
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user