Skip to content

Commit

Permalink
Bump plugwise to v0.25.0 and adapt relevant plugwise code (home-assis…
Browse files Browse the repository at this point in the history
  • Loading branch information
bouwew authored Oct 12, 2022
1 parent ec55a7b commit 6abf677
Show file tree
Hide file tree
Showing 15 changed files with 175 additions and 90 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/plugwise/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
Platform.SWITCH,
]
ZEROCONF_MAP: Final[dict[str, str]] = {
"smile": "P1",
"smile_thermo": "Anna",
"smile": "Smile P1",
"smile_thermo": "Smile Anna",
"smile_open_therm": "Adam",
"stretch": "Stretch",
}
Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/plugwise/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ async def async_setup_entry_gw(hass: HomeAssistant, entry: ConfigEntry) -> bool:
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, str(api.gateway_id))},
manufacturer="Plugwise",
name=entry.title,
model=f"Smile {api.smile_name}",
model=api.smile_model,
name=api.smile_name,
sw_version=api.smile_version[0],
)

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "plugwise",
"name": "Plugwise",
"documentation": "https://www.home-assistant.io/integrations/plugwise",
"requirements": ["plugwise==0.21.4"],
"requirements": ["plugwise==0.25.0"],
"codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"],
"zeroconf": ["_plugwise._tcp.local."],
"config_flow": true,
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13

# homeassistant.components.plugwise
plugwise==0.21.4
plugwise==0.25.0

# 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 @@ -939,7 +939,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13

# homeassistant.components.plugwise
plugwise==0.21.4
plugwise==0.25.0

# homeassistant.components.plum_lightpad
plumlightpad==0.0.11
Expand Down
15 changes: 12 additions & 3 deletions tests/components/plugwise/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def mock_smile_config_flow() -> Generator[None, MagicMock, None]:
) as smile_mock:
smile = smile_mock.return_value
smile.smile_hostname = "smile12345"
smile.smile_model = "Test Model"
smile.smile_name = "Test Smile Name"
smile.connect.return_value = True
yield smile
Expand All @@ -83,6 +84,7 @@ def mock_smile_adam() -> Generator[None, MagicMock, None]:
smile.smile_version = "3.0.15"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_model = "Gateway"
smile.smile_name = "Adam"

smile.connect.return_value = True
Expand All @@ -108,6 +110,7 @@ def mock_smile_adam_2() -> Generator[None, MagicMock, None]:
smile.smile_version = "3.6.4"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_model = "Gateway"
smile.smile_name = "Adam"

smile.connect.return_value = True
Expand All @@ -133,6 +136,7 @@ def mock_smile_adam_3() -> Generator[None, MagicMock, None]:
smile.smile_version = "3.6.4"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_model = "Gateway"
smile.smile_name = "Adam"

smile.connect.return_value = True
Expand All @@ -157,7 +161,8 @@ def mock_smile_anna() -> Generator[None, MagicMock, None]:
smile.smile_version = "4.0.15"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_name = "Anna"
smile.smile_model = "Gateway"
smile.smile_name = "Smile Anna"

smile.connect.return_value = True

Expand All @@ -181,7 +186,8 @@ def mock_smile_anna_2() -> Generator[None, MagicMock, None]:
smile.smile_version = "4.0.15"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_name = "Anna"
smile.smile_model = "Gateway"
smile.smile_name = "Smile Anna"

smile.connect.return_value = True

Expand All @@ -205,7 +211,8 @@ def mock_smile_anna_3() -> Generator[None, MagicMock, None]:
smile.smile_version = "4.0.15"
smile.smile_type = "thermostat"
smile.smile_hostname = "smile98765"
smile.smile_name = "Anna"
smile.smile_model = "Gateway"
smile.smile_name = "Smile Anna"

smile.connect.return_value = True

Expand All @@ -229,6 +236,7 @@ def mock_smile_p1() -> Generator[None, MagicMock, None]:
smile.smile_version = "3.3.9"
smile.smile_type = "power"
smile.smile_hostname = "smile98765"
smile.smile_model = "Gateway"
smile.smile_name = "Smile P1"

smile.connect.return_value = True
Expand All @@ -253,6 +261,7 @@ def mock_stretch() -> Generator[None, MagicMock, None]:
smile.smile_version = "3.1.11"
smile.smile_type = "stretch"
smile.smile_hostname = "stretch98765"
smile.smile_model = "Gateway"
smile.smile_name = "Stretch"

smile.connect.return_value = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"upper_bound": 99.9,
"resolution": 0.01
},
"preset_modes": ["home", "asleep", "away", "no_frost"],
"available": true,
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"active_preset": "away",
"available_schedules": [
"CV Roan",
Expand All @@ -53,6 +54,7 @@
"name": "Floor kraan",
"zigbee_mac_address": "ABCD012345670A02",
"vendor": "Plugwise",
"available": true,
"sensors": {
"temperature": 26.0,
"setpoint": 21.5,
Expand All @@ -69,6 +71,7 @@
"name": "Bios Cv Thermostatic Radiator ",
"zigbee_mac_address": "ABCD012345670A09",
"vendor": "Plugwise",
"available": true,
"sensors": {
"temperature": 17.2,
"setpoint": 13.0,
Expand All @@ -92,7 +95,8 @@
"upper_bound": 99.9,
"resolution": 0.01
},
"preset_modes": ["home", "asleep", "away", "no_frost"],
"available": true,
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"active_preset": "home",
"available_schedules": [
"CV Roan",
Expand All @@ -116,12 +120,11 @@
"hardware": "AME Smile 2.0 board",
"location": "1f9dcf83fd4e4b66b72ff787957bfe5d",
"mac_address": "012345670001",
"model": "Adam",
"model": "Gateway",
"name": "Adam",
"zigbee_mac_address": "ABCD012345670101",
"vendor": "Plugwise B.V.",
"vendor": "Plugwise",
"regulation_mode": "heating",
"regulation_modes": [],
"binary_sensors": {
"plugwise_notification": true
},
Expand All @@ -138,6 +141,7 @@
"name": "Thermostatic Radiator Jessie",
"zigbee_mac_address": "ABCD012345670A10",
"vendor": "Plugwise",
"available": true,
"sensors": {
"temperature": 17.1,
"setpoint": 15.0,
Expand All @@ -154,6 +158,7 @@
"name": "Playstation Smart Plug",
"zigbee_mac_address": "ABCD012345670A12",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 82.6,
"electricity_consumed_interval": 8.6,
Expand All @@ -173,6 +178,7 @@
"name": "CV Pomp",
"zigbee_mac_address": "ABCD012345670A05",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 35.6,
"electricity_consumed_interval": 7.37,
Expand Down Expand Up @@ -205,6 +211,7 @@
"name": "NAS",
"zigbee_mac_address": "ABCD012345670A14",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 16.5,
"electricity_consumed_interval": 0.5,
Expand All @@ -224,6 +231,7 @@
"name": "USG Smart Plug",
"zigbee_mac_address": "ABCD012345670A16",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 8.5,
"electricity_consumed_interval": 0.0,
Expand All @@ -243,6 +251,7 @@
"name": "NVR",
"zigbee_mac_address": "ABCD012345670A15",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 34.0,
"electricity_consumed_interval": 9.15,
Expand All @@ -262,6 +271,7 @@
"name": "Fibaro HC2",
"zigbee_mac_address": "ABCD012345670A13",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 12.5,
"electricity_consumed_interval": 3.8,
Expand All @@ -288,7 +298,8 @@
"upper_bound": 99.9,
"resolution": 0.01
},
"preset_modes": ["home", "asleep", "away", "no_frost"],
"available": true,
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"active_preset": "asleep",
"available_schedules": [
"CV Roan",
Expand All @@ -315,6 +326,7 @@
"name": "Thermostatic Radiator Badkamer",
"zigbee_mac_address": "ABCD012345670A17",
"vendor": "Plugwise",
"available": true,
"sensors": {
"temperature": 19.1,
"setpoint": 14.0,
Expand All @@ -338,7 +350,8 @@
"upper_bound": 99.9,
"resolution": 0.01
},
"preset_modes": ["home", "asleep", "away", "no_frost"],
"available": true,
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"active_preset": "away",
"available_schedules": [
"CV Roan",
Expand All @@ -364,6 +377,7 @@
"name": "Ziggo Modem",
"zigbee_mac_address": "ABCD012345670A01",
"vendor": "Plugwise",
"available": true,
"sensors": {
"electricity_consumed": 12.2,
"electricity_consumed_interval": 2.97,
Expand All @@ -390,7 +404,8 @@
"upper_bound": 100.0,
"resolution": 0.01
},
"preset_modes": ["home", "asleep", "away", "no_frost"],
"available": true,
"preset_modes": ["home", "asleep", "away", "vacation", "no_frost"],
"active_preset": "no_frost",
"available_schedules": [
"CV Roan",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[
{
"smile_name": "Smile",
"smile_name": "Smile Anna",
"gateway_id": "015ae9ea3f964e668e490fa39da3870b",
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
"cooling_present": true,
Expand All @@ -19,7 +19,7 @@
"upper_bound": 100.0,
"resolution": 1.0
},
"elga_cooling_enabled": true,
"available": true,
"binary_sensors": {
"dhw_state": false,
"heating_state": true,
Expand All @@ -30,6 +30,7 @@
},
"sensors": {
"water_temperature": 29.1,
"dhw_temperature": 46.3,
"intended_boiler_temperature": 0.0,
"modulation_level": 52,
"return_temperature": 25.1,
Expand All @@ -46,9 +47,9 @@
"hardware": "AME Smile 2.0 board",
"location": "a57efe5f145f498c9be62a9b63626fbf",
"mac_address": "012345670001",
"model": "Smile",
"name": "Smile",
"vendor": "Plugwise B.V.",
"model": "Gateway",
"name": "Smile Anna",
"vendor": "Plugwise",
"binary_sensors": {
"plugwise_notification": false
},
Expand All @@ -61,15 +62,18 @@
"firmware": "2018-02-08T11:15:53+01:00",
"hardware": "6539-1301-5002",
"location": "c784ee9fdab44e1395b8dee7d7a497d5",
"model": "Anna",
"model": "ThermoTouch",
"name": "Anna",
"vendor": "Plugwise",
"thermostat": {
"setpoint_low": 20.5,
"setpoint_high": 24.0,
"setpoint": 20.5,
"lower_bound": 4.0,
"upper_bound": 30.0,
"resolution": 0.1
},
"available": true,
"preset_modes": ["no_frost", "home", "away", "asleep", "vacation"],
"active_preset": "home",
"available_schedules": ["standaard"],
Expand All @@ -78,10 +82,11 @@
"mode": "auto",
"sensors": {
"temperature": 19.3,
"setpoint": 20.5,
"illuminance": 86.0,
"cooling_activation_outdoor_temperature": 21.0,
"cooling_deactivation_threshold": 4.0
"cooling_deactivation_threshold": 4.0,
"setpoint_low": 20.5,
"setpoint_high": 24.0
}
}
}
Expand Down
Loading

0 comments on commit 6abf677

Please sign in to comment.