Skip to content

Commit

Permalink
Bump plugwise to v0.37.1 (#113245)
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew authored Mar 25, 2024
1 parent 3643b32 commit ace21c8
Show file tree
Hide file tree
Showing 31 changed files with 68 additions and 200 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 3 additions & 31 deletions tests/components/plugwise/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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"]
Expand All @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down
13 changes: 0 additions & 13 deletions tests/components/plugwise/fixtures/m_adam_jip/device_list.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions tests/components/plugwise/fixtures/p1v3_full_option/all_data.json

This file was deleted.

This file was deleted.

This file was deleted.

49 changes: 49 additions & 0 deletions tests/components/plugwise/fixtures/p1v4_442_single/all_data.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"electricity_produced": 0.0
},
"switches": {
"lock": false,
"lock": true,
"relay": true
},
"vendor": "Plugwise",
Expand Down
10 changes: 0 additions & 10 deletions tests/components/plugwise/fixtures/stretch_v31/device_list.json

This file was deleted.

This file was deleted.

Loading

0 comments on commit ace21c8

Please sign in to comment.