|
44 | 44 | _LOGGER = logging.getLogger(__name__) |
45 | 45 |
|
46 | 46 |
|
47 | | -def device_state_updater(data, devs, d_id, d_dict): |
48 | | - """Helper-function for _update_gw_devices(). |
49 | | - Update the Device_State sensor state. |
50 | | - """ |
51 | | - for idx, item in enumerate(d_dict["sensors"]): |
52 | | - if item[ATTR_ID] == "device_state": |
53 | | - result = update_device_state(data, d_dict) |
54 | | - devs[d_id]["sensors"][idx][ATTR_STATE] = result[0] |
55 | | - devs[d_id]["sensors"][idx][ATTR_ICON] = result[1] |
56 | | - |
57 | | - |
58 | | -def pw_notification_updater(devs, d_id, d_dict, notifs): |
59 | | - """Helper-function for _update_gw_devices(). |
60 | | - Update the PW_Notification binary_sensor state. |
61 | | - """ |
62 | | - for idx, item in enumerate(d_dict["binary_sensors"]): |
63 | | - if item[ATTR_ID] == "plugwise_notification": |
64 | | - devs[d_id]["binary_sensors"][idx][ATTR_STATE] = notifs != {} |
65 | | - |
66 | | - |
67 | 47 | def update_device_state(data, d_dict): |
68 | 48 | """Helper-function for _device_state_updater().""" |
69 | 49 | _cooling_state = False |
@@ -99,17 +79,6 @@ def update_device_state(data, d_dict): |
99 | 79 | return [state, icon] |
100 | 80 |
|
101 | 81 |
|
102 | | -def update_helper(data, devs, d_dict, d_id, e_type, key): |
103 | | - """Helper-function for _update_gw_devices().""" |
104 | | - for dummy in d_dict[e_type]: |
105 | | - if key != dummy[ATTR_ID]: |
106 | | - continue |
107 | | - for idx, item in enumerate(devs[d_id][e_type]): |
108 | | - if key != item[ATTR_ID]: |
109 | | - continue |
110 | | - devs[d_id][e_type][idx][ATTR_STATE] = data[key] |
111 | | - |
112 | | - |
113 | 82 | class Smile(SmileHelper): |
114 | 83 | """The Plugwise Smile main class.""" |
115 | 84 |
|
|
0 commit comments