Skip to content

Commit a7c0748

Browse files
author
Tom Scholten
committed
Fixes from additional review on parent
1 parent 03a274c commit a7c0748

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

homeassistant/components/plugwise/climate.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
4646
"zone_thermostat",
4747
"thermostatic_radiator_valve",
4848
]
49-
all_entities = api.get_all_devices()
49+
all_devices = api.get_all_devices()
5050

51-
for dev_id, device in all_entities.items():
51+
for dev_id, device in all_devices.items():
5252

5353
if device["class"] not in thermostat_classes:
5454
continue
@@ -260,15 +260,12 @@ def _process_data(self):
260260
if "active_preset" in climate_data:
261261
self._preset_mode = climate_data["active_preset"]
262262

263-
if "heating_state" in heater_central_data:
264-
if heater_central_data["heating_state"] is not None:
265-
self._heating_state = heater_central_data["heating_state"]
266-
if "cooling_state" in heater_central_data:
267-
if heater_central_data["cooling_state"] is not None:
268-
self._cooling_state = heater_central_data["cooling_state"]
269-
if "compressor_state" in heater_central_data:
270-
if heater_central_data["compressor_state"] is not None:
271-
self._compressor_state = heater_central_data["compressor_state"]
263+
if heater_central_data.get("heating_state") is not None:
264+
self._heating_state = heater_central_data["heating_state"]
265+
if heater_central_data.get("cooling_state") is not None:
266+
self._cooling_state = heater_central_data["cooling_state"]
267+
if heater_central_data.get("compressor_state") is not None:
268+
self._compressor_state = heater_central_data["compressor_state"]
272269

273270
if self._schema_status:
274271
self._hvac_mode = HVAC_MODE_AUTO

homeassistant/components/plugwise/config_flow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
4747
async def async_step_user(self, user_input=None):
4848
"""Handle the initial step."""
4949
errors = {}
50-
api = None
50+
5151
if user_input is not None:
5252

5353
try:

homeassistant/components/plugwise/manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"name": "Plugwise",
44
"documentation": "https://www.home-assistant.io/integrations/plugwise",
55
"requirements": ["Plugwise_Smile==0.2.10"],
6-
"dependencies": [],
76
"codeowners": ["@CoMPaTech", "@bouwew"],
87
"config_flow": true
98
}

homeassistant/components/plugwise/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
163163
coordinator = hass.data[DOMAIN][config_entry.entry_id]["coordinator"]
164164

165165
entities = []
166-
all_entities = api.get_all_devices()
166+
all_devices = api.get_all_devices()
167167
single_thermostat = api.single_master_thermostat()
168-
for dev_id, entity in all_entities.items():
168+
for dev_id, entity in all_devices.items():
169169
data = api.get_device_data(dev_id)
170170
for sensor, sensor_type in SENSOR_MAP.items():
171171
if sensor in data:

0 commit comments

Comments
 (0)