Bump plugwise to v0.37.1 (#113245)
This commit is contained in:
parent
3643b324c0
commit
ace21c876c
31 changed files with 68 additions and 200 deletions
|
@ -6,7 +6,7 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/plugwise",
|
||||
"integration_type": "hub",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["crcmod", "plugwise"],
|
||||
"requirements": ["plugwise==0.36.3"],
|
||||
"loggers": ["plugwise"],
|
||||
"requirements": ["plugwise==0.37.1"],
|
||||
"zeroconf": ["_plugwise._tcp.local."]
|
||||
}
|
||||
|
|
|
@ -1541,7 +1541,7 @@ plexauth==0.0.6
|
|||
plexwebsocket==0.0.14
|
||||
|
||||
# homeassistant.components.plugwise
|
||||
plugwise==0.36.3
|
||||
plugwise==0.37.1
|
||||
|
||||
# homeassistant.components.plum_lightpad
|
||||
plumlightpad==0.0.11
|
||||
|
|
|
@ -1212,7 +1212,7 @@ plexauth==0.0.6
|
|||
plexwebsocket==0.0.14
|
||||
|
||||
# homeassistant.components.plugwise
|
||||
plugwise==0.36.3
|
||||
plugwise==0.37.1
|
||||
|
||||
# homeassistant.components.plum_lightpad
|
||||
plumlightpad==0.0.11
|
||||
|
|
|
@ -87,10 +87,7 @@ def mock_smile_adam() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Adam"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -116,10 +113,7 @@ def mock_smile_adam_2() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Adam"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -145,10 +139,7 @@ def mock_smile_adam_3() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Adam"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -174,10 +165,7 @@ def mock_smile_adam_4() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Adam"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -202,10 +190,7 @@ def mock_smile_anna() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Smile Anna"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -230,10 +215,7 @@ def mock_smile_anna_2() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Smile Anna"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -258,10 +240,7 @@ def mock_smile_anna_3() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Smile Anna"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -273,23 +252,20 @@ def mock_smile_anna_3() -> Generator[None, MagicMock, None]:
|
|||
@pytest.fixture
|
||||
def mock_smile_p1() -> Generator[None, MagicMock, None]:
|
||||
"""Create a Mock P1 DSMR environment for testing exceptions."""
|
||||
chosen_env = "p1v3_full_option"
|
||||
chosen_env = "p1v4_442_single"
|
||||
with patch(
|
||||
"homeassistant.components.plugwise.coordinator.Smile", autospec=True
|
||||
) as smile_mock:
|
||||
smile = smile_mock.return_value
|
||||
|
||||
smile.gateway_id = "e950c7d5e1ee407a858e2a8b5016c8b3"
|
||||
smile.gateway_id = "a455b61e52394b2db5081ce025a430f3"
|
||||
smile.heater_id = None
|
||||
smile.smile_version = "3.3.9"
|
||||
smile.smile_version = "4.4.2"
|
||||
smile.smile_type = "power"
|
||||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Smile P1"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -314,10 +290,7 @@ def mock_smile_p1_2() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "smile98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Smile P1"
|
||||
|
||||
smile.connect.return_value = True
|
||||
|
||||
smile.notifications = _read_json(chosen_env, "notifications")
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
all_data["gateway"], all_data["devices"]
|
||||
|
@ -342,7 +315,6 @@ def mock_stretch() -> Generator[None, MagicMock, None]:
|
|||
smile.smile_hostname = "stretch98765"
|
||||
smile.smile_model = "Gateway"
|
||||
smile.smile_name = "Stretch"
|
||||
|
||||
smile.connect.return_value = True
|
||||
all_data = _read_json(chosen_env, "all_data")
|
||||
smile.async_update.return_value = PlugwiseData(
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"model": "Plug",
|
||||
"name": "Playstation Smart Plug",
|
||||
"sensors": {
|
||||
"electricity_consumed": 82.6,
|
||||
"electricity_consumed": 84.1,
|
||||
"electricity_consumed_interval": 8.6,
|
||||
"electricity_produced": 0.0,
|
||||
"electricity_produced_interval": 0.0
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
[
|
||||
"fe799307f1624099878210aa0b9f1475",
|
||||
"90986d591dcd426cae3ec3e8111ff730",
|
||||
"df4a4a8169904cdb9c03d61a21f42140",
|
||||
"b310b72a0e354bfab43089919b9a88bf",
|
||||
"a2c3583e0a6349358998b760cea82d2a",
|
||||
"b59bcebaf94b499ea7d46e4a66fb62d8",
|
||||
"d3da73bde12a47d5a6b8f9dad971f2ec",
|
||||
"21f2b542c49845e6bb416884c55778d6",
|
||||
"78d1126fc4c743db81b61c20e88342a7",
|
||||
"cd0ddb54ef694e11ac18ed1cbce5dbbd",
|
||||
"4a810418d5394b3f82727340b91ba740",
|
||||
"02cf28bfec924855854c544690a609ef",
|
||||
"a28f588dc4a049a483fd03a30361ad3a",
|
||||
"6a3bf693d05e48e0b460c815a4fdd09d",
|
||||
"680423ff840043738f42cc7f1ff97a36",
|
||||
"f1fee6043d3642a9b0a65297455f008e",
|
||||
"675416a629f343c495449970e2ca37b5",
|
||||
"e7693eb9582644e5b865dba8d4447cf1"
|
||||
]
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"af82e4ccf9c548528166d38e560662a4": {
|
||||
"warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device."
|
||||
}
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
[
|
||||
"015ae9ea3f964e668e490fa39da3870b",
|
||||
"1cbf783bb11e4a7c8a6843dee3a86927",
|
||||
"3cb70739631c4d17a86b8b12e8a5161b"
|
||||
]
|
|
@ -1,8 +0,0 @@
|
|||
[
|
||||
"da224107914542988a88561b4452b0f6",
|
||||
"056ee145a816487eaa69243c3280f8bf",
|
||||
"e2f4322d57924fa090fbbc48b3a140dc",
|
||||
"ad4838d7d35c4d6ea796ee12ae5aedf8",
|
||||
"1772a4ea304041adb83f357b751341ff",
|
||||
"e8ef2a01ed3b4139a53bf749204fe6b4"
|
||||
]
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,8 +0,0 @@
|
|||
[
|
||||
"da224107914542988a88561b4452b0f6",
|
||||
"056ee145a816487eaa69243c3280f8bf",
|
||||
"e2f4322d57924fa090fbbc48b3a140dc",
|
||||
"ad4838d7d35c4d6ea796ee12ae5aedf8",
|
||||
"1772a4ea304041adb83f357b751341ff",
|
||||
"e8ef2a01ed3b4139a53bf749204fe6b4"
|
||||
]
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -67,7 +67,7 @@
|
|||
"name": "Tom Slaapkamer",
|
||||
"sensors": {
|
||||
"setpoint": 13.0,
|
||||
"temperature": 24.3,
|
||||
"temperature": 24.2,
|
||||
"temperature_difference": 1.7,
|
||||
"valve_position": 0.0
|
||||
},
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
[
|
||||
"b5c2386c6f6342669e50fe49dd05b188",
|
||||
"e4684553153b44afbef2200885f379dc",
|
||||
"a6abc6a129ee499c88a4d420cc413b47",
|
||||
"1346fbd8498d4dbcab7e18d51b771f3d",
|
||||
"833de10f269c4deab58fb9df69901b4e",
|
||||
"6f3e9d7084214c21b9dfa46f6eeb8700",
|
||||
"f61f1a2535f54f52ad006a3d18e459ca",
|
||||
"d4496250d0e942cfa7aea3476e9070d5",
|
||||
"356b65335e274d769c338223e7af9c33",
|
||||
"1da4d325838e4ad8aac12177214505c9",
|
||||
"457ce8414de24596a2d5e7dbc9c7682f"
|
||||
]
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -1,5 +0,0 @@
|
|||
[
|
||||
"015ae9ea3f964e668e490fa39da3870b",
|
||||
"1cbf783bb11e4a7c8a6843dee3a86927",
|
||||
"3cb70739631c4d17a86b8b12e8a5161b"
|
||||
]
|
|
@ -1,5 +0,0 @@
|
|||
[
|
||||
"015ae9ea3f964e668e490fa39da3870b",
|
||||
"1cbf783bb11e4a7c8a6843dee3a86927",
|
||||
"3cb70739631c4d17a86b8b12e8a5161b"
|
||||
]
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"devices": {
|
||||
"cd3e822288064775a7c4afcdd70bdda2": {
|
||||
"binary_sensors": {
|
||||
"plugwise_notification": false
|
||||
},
|
||||
"dev_class": "gateway",
|
||||
"firmware": "3.3.9",
|
||||
"hardware": "AME Smile 2.0 board",
|
||||
"location": "cd3e822288064775a7c4afcdd70bdda2",
|
||||
"mac_address": "012345670001",
|
||||
"model": "Gateway",
|
||||
"name": "Smile P1",
|
||||
"vendor": "Plugwise"
|
||||
},
|
||||
"e950c7d5e1ee407a858e2a8b5016c8b3": {
|
||||
"available": true,
|
||||
"dev_class": "smartmeter",
|
||||
"location": "cd3e822288064775a7c4afcdd70bdda2",
|
||||
"model": "2M550E-1012",
|
||||
"name": "P1",
|
||||
"sensors": {
|
||||
"electricity_consumed_off_peak_cumulative": 551.09,
|
||||
"electricity_consumed_off_peak_interval": 0,
|
||||
"electricity_consumed_off_peak_point": 0,
|
||||
"electricity_consumed_peak_cumulative": 442.932,
|
||||
"electricity_consumed_peak_interval": 0,
|
||||
"electricity_consumed_peak_point": 0,
|
||||
"electricity_produced_off_peak_cumulative": 154.491,
|
||||
"electricity_produced_off_peak_interval": 0,
|
||||
"electricity_produced_off_peak_point": 0,
|
||||
"electricity_produced_peak_cumulative": 396.559,
|
||||
"electricity_produced_peak_interval": 0,
|
||||
"electricity_produced_peak_point": 2816,
|
||||
"gas_consumed_cumulative": 584.85,
|
||||
"gas_consumed_interval": 0.0,
|
||||
"net_electricity_cumulative": 442.972,
|
||||
"net_electricity_point": -2816
|
||||
},
|
||||
"vendor": "ISKRAEMECO"
|
||||
}
|
||||
},
|
||||
"gateway": {
|
||||
"gateway_id": "cd3e822288064775a7c4afcdd70bdda2",
|
||||
"item_count": 31,
|
||||
"notifications": {},
|
||||
"smile_name": "Smile P1"
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
["cd3e822288064775a7c4afcdd70bdda2", "e950c7d5e1ee407a858e2a8b5016c8b3"]
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"devices": {
|
||||
"a455b61e52394b2db5081ce025a430f3": {
|
||||
"binary_sensors": {
|
||||
"plugwise_notification": false
|
||||
},
|
||||
"dev_class": "gateway",
|
||||
"firmware": "4.4.2",
|
||||
"hardware": "AME Smile 2.0 board",
|
||||
"location": "a455b61e52394b2db5081ce025a430f3",
|
||||
"mac_address": "012345670001",
|
||||
"model": "Gateway",
|
||||
"name": "Smile P1",
|
||||
"vendor": "Plugwise"
|
||||
},
|
||||
"ba4de7613517478da82dd9b6abea36af": {
|
||||
"available": true,
|
||||
"dev_class": "smartmeter",
|
||||
"location": "a455b61e52394b2db5081ce025a430f3",
|
||||
"model": "KFM5KAIFA-METER",
|
||||
"name": "P1",
|
||||
"sensors": {
|
||||
"electricity_consumed_off_peak_cumulative": 17643.423,
|
||||
"electricity_consumed_off_peak_interval": 15,
|
||||
"electricity_consumed_off_peak_point": 486,
|
||||
"electricity_consumed_peak_cumulative": 13966.608,
|
||||
"electricity_consumed_peak_interval": 0,
|
||||
"electricity_consumed_peak_point": 0,
|
||||
"electricity_phase_one_consumed": 486,
|
||||
"electricity_phase_one_produced": 0,
|
||||
"electricity_produced_off_peak_cumulative": 0.0,
|
||||
"electricity_produced_off_peak_interval": 0,
|
||||
"electricity_produced_off_peak_point": 0,
|
||||
"electricity_produced_peak_cumulative": 0.0,
|
||||
"electricity_produced_peak_interval": 0,
|
||||
"electricity_produced_peak_point": 0,
|
||||
"net_electricity_cumulative": 31610.031,
|
||||
"net_electricity_point": 486
|
||||
},
|
||||
"vendor": "SHENZHEN KAIFA TECHNOLOGY \uff08CHENGDU\uff09 CO., LTD."
|
||||
}
|
||||
},
|
||||
"gateway": {
|
||||
"gateway_id": "a455b61e52394b2db5081ce025a430f3",
|
||||
"item_count": 31,
|
||||
"notifications": {},
|
||||
"smile_name": "Smile P1"
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
["03e65b16e4b247a29ae0d75a78cb492e", "b82b6b3322484f2ea4e25e0bd5f3d61f"]
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"97a04c0c263049b29350a660b4cdd01e": {
|
||||
"warning": "The Smile P1 is not connected to a smart meter."
|
||||
}
|
||||
}
|
|
@ -23,7 +23,7 @@
|
|||
"electricity_produced": 0.0
|
||||
},
|
||||
"switches": {
|
||||
"lock": false,
|
||||
"lock": true,
|
||||
"relay": true
|
||||
},
|
||||
"vendor": "Plugwise",
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
[
|
||||
"0000aaaa0000aaaa0000aaaa0000aa00",
|
||||
"5871317346d045bc9f6b987ef25ee638",
|
||||
"e1c884e7dede431dadee09506ec4f859",
|
||||
"aac7b735042c4832ac9ff33aae4f453b",
|
||||
"cfe95cf3de1948c0b8955125bf754614",
|
||||
"059e4d03c7a34d278add5c7a4a781d19",
|
||||
"d950b314e9d8499f968e6db8d82ef78c",
|
||||
"d03738edfcc947f7b8f4573571d90d2d"
|
||||
]
|
|
@ -1 +0,0 @@
|
|||
{}
|
|
@ -30,7 +30,7 @@
|
|||
'model': 'Plug',
|
||||
'name': 'Playstation Smart Plug',
|
||||
'sensors': dict({
|
||||
'electricity_consumed': 82.6,
|
||||
'electricity_consumed': 84.1,
|
||||
'electricity_consumed_interval': 8.6,
|
||||
'electricity_produced': 0.0,
|
||||
'electricity_produced_interval': 0.0,
|
||||
|
|
|
@ -111,38 +111,28 @@ async def test_anna_as_smt_climate_sensor_entities(
|
|||
assert float(state.state) == 86.0
|
||||
|
||||
|
||||
async def test_anna_climate_sensor_entities(
|
||||
hass: HomeAssistant, mock_smile_anna: MagicMock, init_integration: MockConfigEntry
|
||||
) -> None:
|
||||
"""Test creation of climate related sensor entities."""
|
||||
state = hass.states.get("sensor.opentherm_outdoor_air_temperature")
|
||||
assert state
|
||||
assert float(state.state) == 3.0
|
||||
|
||||
|
||||
async def test_p1_dsmr_sensor_entities(
|
||||
hass: HomeAssistant, mock_smile_p1: MagicMock, init_integration: MockConfigEntry
|
||||
) -> None:
|
||||
"""Test creation of power related sensor entities."""
|
||||
state = hass.states.get("sensor.p1_net_electricity_point")
|
||||
assert state
|
||||
assert float(state.state) == -2816.0
|
||||
assert int(state.state) == 486
|
||||
|
||||
state = hass.states.get("sensor.p1_electricity_consumed_off_peak_cumulative")
|
||||
assert state
|
||||
assert float(state.state) == 551.09
|
||||
assert float(state.state) == 17643.423
|
||||
|
||||
state = hass.states.get("sensor.p1_electricity_produced_peak_point")
|
||||
assert state
|
||||
assert float(state.state) == 2816.0
|
||||
assert int(state.state) == 0
|
||||
|
||||
state = hass.states.get("sensor.p1_electricity_consumed_peak_cumulative")
|
||||
assert state
|
||||
assert float(state.state) == 442.932
|
||||
assert float(state.state) == 13966.608
|
||||
|
||||
state = hass.states.get("sensor.p1_gas_consumed_cumulative")
|
||||
assert state
|
||||
assert float(state.state) == 584.85
|
||||
assert not state
|
||||
|
||||
|
||||
async def test_p1_3ph_dsmr_sensor_entities(
|
||||
|
@ -151,15 +141,15 @@ async def test_p1_3ph_dsmr_sensor_entities(
|
|||
"""Test creation of power related sensor entities."""
|
||||
state = hass.states.get("sensor.p1_electricity_phase_one_consumed")
|
||||
assert state
|
||||
assert float(state.state) == 1763.0
|
||||
assert int(state.state) == 1763
|
||||
|
||||
state = hass.states.get("sensor.p1_electricity_phase_two_consumed")
|
||||
assert state
|
||||
assert float(state.state) == 1703.0
|
||||
assert int(state.state) == 1703
|
||||
|
||||
state = hass.states.get("sensor.p1_electricity_phase_three_consumed")
|
||||
assert state
|
||||
assert float(state.state) == 2080.0
|
||||
assert int(state.state) == 2080
|
||||
|
||||
entity_id = "sensor.p1_voltage_phase_one"
|
||||
state = hass.states.get(entity_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue