Skip to content

Commit 824d300

Browse files
committed
Move another helper-function
1 parent eca016e commit 824d300

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

plugwise/helper.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
ATTR_UNIT_OF_MEASUREMENT,
2626
COOLING_ICON,
2727
DEVICE_MEASUREMENTS,
28+
DEVICE_STATE,
2829
DOMAIN_OBJECTS,
2930
ENERGY_KILO_WATT_HOUR,
3031
ENERGY_WATT_HOUR,
@@ -35,6 +36,7 @@
3536
HOME_MEASUREMENTS,
3637
LOCATIONS,
3738
POWER_WATT,
39+
PW_NOTIFICATION,
3840
SWITCH_GROUP_TYPES,
3941
THERMOSTAT_CLASSES,
4042
)
@@ -1081,3 +1083,13 @@ def pw_notification_updater(self, d_id, d_dict):
10811083
self.gw_devices[d_id]["binary_sensors"][idx][ATTR_STATE] = (
10821084
self.notifications != {}
10831085
)
1086+
1087+
def append_special(self, data, d_id, bs_list, s_list):
1088+
"""Helper for all_device_data()."""
1089+
if d_id == self.gateway_id:
1090+
if self.single_master_thermostat() is not None:
1091+
bs_list.append(PW_NOTIFICATION)
1092+
if not self.active_device_present and "heating_state" in data:
1093+
s_list.append(DEVICE_STATE)
1094+
if d_id == self.heater_id and self.single_master_thermostat() is False:
1095+
s_list.append(DEVICE_STATE)

plugwise/smile.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,16 +234,6 @@ async def update_gw_devices(self):
234234
for key, value in list(data.items()):
235235
self.update_helper(data, dev_dict, dev_id, "switches", key)
236236

237-
def append_special(self, data, dev_id, bs_list, s_list):
238-
"""Helper for all_device_data()."""
239-
if dev_id == self.gateway_id:
240-
if self.single_master_thermostat() is not None:
241-
bs_list.append(PW_NOTIFICATION)
242-
if not self.active_device_present and "heating_state" in data:
243-
s_list.append(DEVICE_STATE)
244-
if dev_id == self.heater_id and self.single_master_thermostat() is False:
245-
s_list.append(DEVICE_STATE)
246-
247237
def all_device_data(self):
248238
"Helper-function: collect data for each device and add to self.gw_devices."
249239
dev_id_list = []

0 commit comments

Comments
 (0)