|
@@ -98,11 +98,6 @@ class all_functions(object):
|
98
|
98
|
rv.append(obj)
|
99
|
99
|
return rv
|
100
|
100
|
|
101
|
|
- def common_off(self, device=None, key=None, data=None):
|
102
|
|
- logger.info("Switching \"common\" off.")
|
103
|
|
- for common in self.getmembers('common'):
|
104
|
|
- common.all_off()
|
105
|
|
-
|
106
|
101
|
def gfw_off(self, device=None, key=None, data=None):
|
107
|
102
|
logger.info("Switching \"ground floor west\" off.")
|
108
|
103
|
for gfw in self.getmembers('gfw'):
|
|
@@ -124,20 +119,7 @@ class all_functions(object):
|
124
|
119
|
stw.all_off()
|
125
|
120
|
|
126
|
121
|
def all_off(self, device=None, key=None, data=None):
|
127
|
|
- self.common_off(device, key, data)
|
128
|
|
- self.gfw_off(device, key, data)
|
129
|
|
- self.ffw_off(device, key, data)
|
130
|
|
- self.ffe_off(device, key, data)
|
131
|
|
- self.stw_off(device, key, data)
|
132
|
|
-
|
133
|
|
- def devicelist(self):
|
134
|
|
- if self.__devices__ is None:
|
135
|
|
- self.__devices__ = []
|
136
|
|
- for name, obj in inspect.getmembers(self):
|
137
|
|
- if obj.__class__.__module__ == "devices":
|
138
|
|
- self.__devices__.append(obj)
|
139
|
|
- elif obj.__class__.__module__.split('.')[0] == 'function':
|
140
|
|
- for devicename, device in inspect.getmembers(obj):
|
141
|
|
- if device.__class__.__module__ == "devices":
|
142
|
|
- self.__devices__.append(device)
|
143
|
|
- return self.__devices__
|
|
122
|
+ for name, obj in inspect.getmembers(self):
|
|
123
|
+ parent_name = obj.__class__.__base__.__name__
|
|
124
|
+ if parent_name == "room":
|
|
125
|
+ obj.all_off()
|