simo 2.6.5__py3-none-any.whl → 2.6.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of simo might be problematic. Click here for more details.
- simo/automation/__pycache__/controllers.cpython-38.pyc +0 -0
- simo/automation/controllers.py +17 -9
- simo/notifications/__pycache__/api.cpython-38.pyc +0 -0
- simo/notifications/api.py +1 -1
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/METADATA +1 -1
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/RECORD +10 -10
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/LICENSE.md +0 -0
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/WHEEL +0 -0
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/entry_points.txt +0 -0
- {simo-2.6.5.dist-info → simo-2.6.6.dist-info}/top_level.txt +0 -0
|
Binary file
|
simo/automation/controllers.py
CHANGED
|
@@ -161,20 +161,20 @@ class PresenceLighting(Script):
|
|
|
161
161
|
self.condition_comps[comp.id] = comp
|
|
162
162
|
|
|
163
163
|
while True:
|
|
164
|
-
self._regulate(
|
|
164
|
+
self._regulate()
|
|
165
165
|
time.sleep(random.randint(5, 15))
|
|
166
166
|
|
|
167
167
|
def _on_sensor(self, sensor=None):
|
|
168
168
|
if sensor:
|
|
169
169
|
self.sensors[sensor.id] = sensor
|
|
170
|
-
self._regulate()
|
|
170
|
+
self._regulate(on_sensor=True)
|
|
171
171
|
|
|
172
172
|
def _on_condition(self, condition_comp=None):
|
|
173
173
|
if condition_comp:
|
|
174
174
|
for condition in self.conditions:
|
|
175
175
|
if condition['component'].id == condition_comp.id:
|
|
176
176
|
condition['component'] = condition_comp
|
|
177
|
-
self._regulate()
|
|
177
|
+
self._regulate(on_condition_change=True)
|
|
178
178
|
|
|
179
179
|
def _on_light_change(self, light):
|
|
180
180
|
# change original value if it has been changed to something different
|
|
@@ -183,14 +183,14 @@ class PresenceLighting(Script):
|
|
|
183
183
|
self.light_send_values[light.id] = light.value
|
|
184
184
|
self.light_org_values[light.id] = light.value
|
|
185
185
|
|
|
186
|
-
def _regulate(self,
|
|
186
|
+
def _regulate(self, on_sensor=False, on_condition_change=False):
|
|
187
187
|
presence_values = [s.value for id, s in self.sensors.items()]
|
|
188
188
|
if self.component.config.get('act_on', 0) == 0:
|
|
189
189
|
must_on = any(presence_values)
|
|
190
190
|
else:
|
|
191
191
|
must_on = all(presence_values)
|
|
192
192
|
|
|
193
|
-
if must_on and
|
|
193
|
+
if must_on and on_sensor:
|
|
194
194
|
print("Presence detected!")
|
|
195
195
|
|
|
196
196
|
additional_conditions_met = True
|
|
@@ -204,7 +204,7 @@ class PresenceLighting(Script):
|
|
|
204
204
|
|
|
205
205
|
if condition['op'] == 'in':
|
|
206
206
|
if comp.value not in self._string_to_vals(condition['value']):
|
|
207
|
-
if must_on and
|
|
207
|
+
if must_on and on_sensor:
|
|
208
208
|
print(
|
|
209
209
|
f"Condition not met: [{comp} value:{comp.value} "
|
|
210
210
|
f"{condition['op']} {condition['value']}]"
|
|
@@ -213,7 +213,7 @@ class PresenceLighting(Script):
|
|
|
213
213
|
break
|
|
214
214
|
|
|
215
215
|
if not op(comp.value, condition['value']):
|
|
216
|
-
if must_on and
|
|
216
|
+
if must_on and on_sensor:
|
|
217
217
|
print(
|
|
218
218
|
f"Condition not met: [{comp} value:{comp.value} "
|
|
219
219
|
f"{condition['op']} {condition['value']}]"
|
|
@@ -221,7 +221,15 @@ class PresenceLighting(Script):
|
|
|
221
221
|
additional_conditions_met = False
|
|
222
222
|
break
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
|
|
225
|
+
if not self.is_on:
|
|
226
|
+
if not must_on:
|
|
227
|
+
return
|
|
228
|
+
if not additional_conditions_met:
|
|
229
|
+
return
|
|
230
|
+
if on_condition_change:
|
|
231
|
+
return
|
|
232
|
+
|
|
225
233
|
print("Turn the lights ON!")
|
|
226
234
|
self.is_on = True
|
|
227
235
|
self.light_org_values = {}
|
|
@@ -240,7 +248,7 @@ class PresenceLighting(Script):
|
|
|
240
248
|
comp.controller.send(on_val)
|
|
241
249
|
return
|
|
242
250
|
|
|
243
|
-
|
|
251
|
+
else:
|
|
244
252
|
if not additional_conditions_met:
|
|
245
253
|
return self._turn_it_off()
|
|
246
254
|
if not any(presence_values):
|
|
Binary file
|
simo/notifications/api.py
CHANGED
|
@@ -34,7 +34,7 @@ class NotificationsViewSet(
|
|
|
34
34
|
archived = bool(int(self.request.query_params['archived']))
|
|
35
35
|
except:
|
|
36
36
|
archived = False
|
|
37
|
-
qs = qs.
|
|
37
|
+
qs = qs.filter(
|
|
38
38
|
user_notifications__archived__isnull=not archived,
|
|
39
39
|
user_notifications__user=self.request.user
|
|
40
40
|
)
|
|
@@ -13,7 +13,7 @@ simo/__pycache__/urls.cpython-38.pyc,sha256=u0x6EqT8S1YfDOSPgbI8Kf-RDlveY9OV-EDX
|
|
|
13
13
|
simo/__pycache__/wsgi.cpython-38.pyc,sha256=TpRxO7VM_ql31hbKphVdanydC5RI1nHB4l0QA2pdWxo,322
|
|
14
14
|
simo/automation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
simo/automation/app_widgets.py,sha256=gaqImMZjuMHm7nIb9a4D-Y3qipz_WhSPAHXcwGx4Uzs,199
|
|
16
|
-
simo/automation/controllers.py,sha256=
|
|
16
|
+
simo/automation/controllers.py,sha256=Py62mo8boFsreiGVAnalJt_1SJePxD67aCGma6zGjWg,10206
|
|
17
17
|
simo/automation/forms.py,sha256=wJMaXE5ngO_o60jqxnf4Om09q48yXpWwRna0FkQCZYs,10081
|
|
18
18
|
simo/automation/gateways.py,sha256=7r33NOAiRd_RGMMm44i0KYzuAuweQnEF4HxLo-Rpexs,9408
|
|
19
19
|
simo/automation/helpers.py,sha256=iP-fxxB8HsFQy3k2CjFubu86aMqvWgmh-p24DiyOrek,4330
|
|
@@ -22,7 +22,7 @@ simo/automation/serializers.py,sha256=PjyFrjdPK1mBsgbNhyqMi9SWzcymqTa742ipy0LhAN
|
|
|
22
22
|
simo/automation/state.py,sha256=aZZvNBae7unnux_zGHCIWCV2z47hVJc-DIL72Hqfkeo,600
|
|
23
23
|
simo/automation/__pycache__/__init__.cpython-38.pyc,sha256=YmP0xAD-mxpQHgdTZeC64sXChA8TriMZD1jckNYi3xg,164
|
|
24
24
|
simo/automation/__pycache__/app_widgets.cpython-38.pyc,sha256=7DfUA9V_1MiwrOe_ta-ts8dYY8xXb9UMg2_9A3XoRcs,523
|
|
25
|
-
simo/automation/__pycache__/controllers.cpython-38.pyc,sha256=
|
|
25
|
+
simo/automation/__pycache__/controllers.cpython-38.pyc,sha256=s9YqMUTCzjIxNVrk36SrIvGrXWYLc9DR80Sa3orpg1o,7936
|
|
26
26
|
simo/automation/__pycache__/forms.cpython-38.pyc,sha256=qxQZeTafJOT_lrXOKY6134XjIrx5OzABAZdncNnRV4E,7720
|
|
27
27
|
simo/automation/__pycache__/gateways.cpython-38.pyc,sha256=W6OrugOLOGaYbibEWSs-zBZc8jQpNlO_NmJU-rmd6fU,7558
|
|
28
28
|
simo/automation/__pycache__/helpers.cpython-38.pyc,sha256=4VSSarOFnUk_KExWwvDlx5dEhv8aHUCHMZDtGG--pUY,3627
|
|
@@ -10449,13 +10449,13 @@ simo/multimedia/migrations/__pycache__/0004_auto_20231023_1055.cpython-38.pyc,sh
|
|
|
10449
10449
|
simo/multimedia/migrations/__pycache__/__init__.cpython-38.pyc,sha256=mCgSiQBphL85imdWyTi9-4zBDYF6HfXbhB0ycSPVVuA,175
|
|
10450
10450
|
simo/notifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10451
10451
|
simo/notifications/admin.py,sha256=WQbN_bd2KRxVjbOajeworNrV9QlDNSadQT58La0Nn2M,1174
|
|
10452
|
-
simo/notifications/api.py,sha256=
|
|
10452
|
+
simo/notifications/api.py,sha256=QrfFn5kBU0vlqi8X368w1-0iTmDGu_hmMxLW2R0OTTg,1765
|
|
10453
10453
|
simo/notifications/models.py,sha256=QGDLGAi5gk8OTcvd7ho5WNdctDymWGmGF1ZqN4-G_ZA,2443
|
|
10454
10454
|
simo/notifications/serializers.py,sha256=altDEAPWwOhxRcEzE9-34jL8EFpyf3vPoEdAPoVLfGc,523
|
|
10455
10455
|
simo/notifications/utils.py,sha256=uBl-Y7WGu00iaGM5rrdogcq0OMRVtyVfJF39-mdB3_k,1853
|
|
10456
10456
|
simo/notifications/__pycache__/__init__.cpython-38.pyc,sha256=YvucUfu98XFvEEg1LYFMlOZJpo_jSGxTVrM-ylAFLOg,167
|
|
10457
10457
|
simo/notifications/__pycache__/admin.cpython-38.pyc,sha256=MScNrtVM1wavefsPfxy0A7LVyXKcbvEkLH9GJkgNOl8,1945
|
|
10458
|
-
simo/notifications/__pycache__/api.cpython-38.pyc,sha256=
|
|
10458
|
+
simo/notifications/__pycache__/api.cpython-38.pyc,sha256=eQmCHwTnr4zQ3ZY_SKZVCryiSEnzmyIjHQM13pZ5LT0,2071
|
|
10459
10459
|
simo/notifications/__pycache__/models.cpython-38.pyc,sha256=PoqLuOnlaAWQQ-20AtqhvAlLSkakPmdn7J7wGvHNW3g,2449
|
|
10460
10460
|
simo/notifications/__pycache__/serializers.cpython-38.pyc,sha256=7-eRGKYuQ4g1SpKOMpz17SIiu1HmaMoYv-cJbaO9QGA,1028
|
|
10461
10461
|
simo/notifications/__pycache__/utils.cpython-38.pyc,sha256=6Tq7VkW-pZLzWzcxPtBU9MDFZLO7iLY8-ygyefoJ5OQ,1529
|
|
@@ -10599,9 +10599,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10599
10599
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10600
10600
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10601
10601
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10602
|
-
simo-2.6.
|
|
10603
|
-
simo-2.6.
|
|
10604
|
-
simo-2.6.
|
|
10605
|
-
simo-2.6.
|
|
10606
|
-
simo-2.6.
|
|
10607
|
-
simo-2.6.
|
|
10602
|
+
simo-2.6.6.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10603
|
+
simo-2.6.6.dist-info/METADATA,sha256=U_rJSOAn0Y32OcYjYKHpnflh2C1SLDSmOxb5f6rWXXM,1952
|
|
10604
|
+
simo-2.6.6.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
10605
|
+
simo-2.6.6.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
|
|
10606
|
+
simo-2.6.6.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10607
|
+
simo-2.6.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|