simo 2.0.29__py3-none-any.whl → 2.0.31__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/core/__pycache__/forms.cpython-38.pyc +0 -0
- simo/fleet/__pycache__/forms.cpython-38.pyc +0 -0
- simo/fleet/forms.py +1 -0
- simo/generic/__pycache__/forms.cpython-38.pyc +0 -0
- simo/generic/__pycache__/gateways.cpython-38.pyc +0 -0
- simo/generic/forms.py +2 -2
- simo/generic/gateways.py +17 -9
- {simo-2.0.29.dist-info → simo-2.0.31.dist-info}/METADATA +1 -1
- {simo-2.0.29.dist-info → simo-2.0.31.dist-info}/RECORD +12 -12
- {simo-2.0.29.dist-info → simo-2.0.31.dist-info}/LICENSE.md +0 -0
- {simo-2.0.29.dist-info → simo-2.0.31.dist-info}/WHEEL +0 -0
- {simo-2.0.29.dist-info → simo-2.0.31.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
simo/fleet/forms.py
CHANGED
|
@@ -1009,6 +1009,7 @@ class TTLockConfigForm(ColonelComponentForm):
|
|
|
1009
1009
|
return self.cleaned_data
|
|
1010
1010
|
|
|
1011
1011
|
def save(self, commit=True):
|
|
1012
|
+
# TODO: after inclusion it was not assigned to proper colonel!
|
|
1012
1013
|
obj = super(ColonelComponentForm, self).save(commit)
|
|
1013
1014
|
if commit and 'door_sensor' in self.cleaned_data:
|
|
1014
1015
|
GatewayObjectCommand(
|
|
Binary file
|
|
Binary file
|
simo/generic/forms.py
CHANGED
|
@@ -33,7 +33,7 @@ class ScriptConfigForm(BaseComponentForm):
|
|
|
33
33
|
)
|
|
34
34
|
keep_alive = forms.BooleanField(
|
|
35
35
|
initial=True, required=False,
|
|
36
|
-
help_text="
|
|
36
|
+
help_text="Restart the script if it fails. "
|
|
37
37
|
)
|
|
38
38
|
code = forms.CharField(widget=PythonCode)
|
|
39
39
|
log = forms.CharField(
|
|
@@ -58,7 +58,7 @@ class ScriptConfigForm(BaseComponentForm):
|
|
|
58
58
|
def get_admin_fieldsets(cls, request, obj=None):
|
|
59
59
|
base_fields = (
|
|
60
60
|
'id', 'gateway', 'base_type', 'name', 'icon', 'zone', 'category',
|
|
61
|
-
'show_in_app', 'autostart',
|
|
61
|
+
'show_in_app', 'autostart', 'keep_alive',
|
|
62
62
|
'code', 'control', 'log'
|
|
63
63
|
)
|
|
64
64
|
|
simo/generic/gateways.py
CHANGED
|
@@ -216,7 +216,7 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
216
216
|
for script in Component.objects.filter(
|
|
217
217
|
controller_uid=Script.uid,
|
|
218
218
|
config__keep_alive=True
|
|
219
|
-
).exclude(
|
|
219
|
+
).exclude(value__in=('running', 'stopped', 'finished')):
|
|
220
220
|
self.start_script(script)
|
|
221
221
|
|
|
222
222
|
def watch_watering(self):
|
|
@@ -252,12 +252,18 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
252
252
|
for component in Component.objects.filter(
|
|
253
253
|
controller_uid=Script.uid, value='running'
|
|
254
254
|
):
|
|
255
|
-
component.value = '
|
|
255
|
+
component.value = 'error'
|
|
256
256
|
component.save()
|
|
257
257
|
|
|
258
|
+
# Start scripts that are designed to be autostarted
|
|
259
|
+
# as well as those who are designed to be kept alive, but
|
|
260
|
+
# got terminated unexpectedly
|
|
258
261
|
for script in Component.objects.filter(
|
|
259
|
-
controller_uid=Script.uid,
|
|
260
|
-
)
|
|
262
|
+
controller_uid=Script.uid,
|
|
263
|
+
).filter(
|
|
264
|
+
Q(config__autostart=True) |
|
|
265
|
+
Q(value='error', config__keep_alive=True)
|
|
266
|
+
).disticnt():
|
|
261
267
|
self.start_script(script)
|
|
262
268
|
|
|
263
269
|
for cam in Component.objects.filter(
|
|
@@ -276,7 +282,9 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
276
282
|
|
|
277
283
|
script_ids = [id for id in self.running_scripts.keys()]
|
|
278
284
|
for id in script_ids:
|
|
279
|
-
self.stop_script(
|
|
285
|
+
self.stop_script(
|
|
286
|
+
Component.objects.get(id=id), 'error'
|
|
287
|
+
)
|
|
280
288
|
|
|
281
289
|
while len(script_ids):
|
|
282
290
|
time.sleep(0.1)
|
|
@@ -310,17 +318,17 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
310
318
|
if component.id in self.running_scripts:
|
|
311
319
|
if self.running_scripts[component.id].is_alive():
|
|
312
320
|
self.running_scripts[component.id].kill()
|
|
313
|
-
component.value = '
|
|
321
|
+
component.value = 'error'
|
|
314
322
|
component.save(update_fields=['value'])
|
|
315
323
|
self.running_scripts[component.id] = ScriptRunHandler(
|
|
316
324
|
component.id, daemon=True
|
|
317
325
|
)
|
|
318
326
|
self.running_scripts[component.id].start()
|
|
319
327
|
|
|
320
|
-
def stop_script(self, component):
|
|
328
|
+
def stop_script(self, component, stop_status='stopped'):
|
|
321
329
|
if component.id not in self.running_scripts:
|
|
322
330
|
if component.value == 'running':
|
|
323
|
-
component.value =
|
|
331
|
+
component.value = stop_status
|
|
324
332
|
component.save(update_fields=['value'])
|
|
325
333
|
return
|
|
326
334
|
if self.running_scripts[component.id].is_alive():
|
|
@@ -342,7 +350,7 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
342
350
|
)
|
|
343
351
|
self.running_scripts[component.id].kill()
|
|
344
352
|
|
|
345
|
-
component.value =
|
|
353
|
+
component.value = stop_status
|
|
346
354
|
component.save(update_fields=['value'])
|
|
347
355
|
self.running_scripts.pop(component.id)
|
|
348
356
|
logger.handlers = []
|
|
@@ -69,7 +69,7 @@ simo/core/__pycache__/controllers.cpython-38.pyc,sha256=40wJ3mu0CnzexxDzXyDIlSxa
|
|
|
69
69
|
simo/core/__pycache__/dynamic_settings.cpython-38.pyc,sha256=ELu06Hub4DOidja71ybvD3ZM4HdXiyZjNJrZfnXZXNA,2476
|
|
70
70
|
simo/core/__pycache__/events.cpython-38.pyc,sha256=A1Axx-qftd1r7st7wkO3DkvTdt9-RkcJe5KJhpzJVk8,5109
|
|
71
71
|
simo/core/__pycache__/filters.cpython-38.pyc,sha256=VIMADCBiYhziIyRmxAyUDJluZvuZmiC4bNYWTRsGSao,721
|
|
72
|
-
simo/core/__pycache__/forms.cpython-38.pyc,sha256=
|
|
72
|
+
simo/core/__pycache__/forms.cpython-38.pyc,sha256=5MelLX2B-cQ0r9BUdLCUIUqnjvSccQ_BgWWiZ7sdGa0,19956
|
|
73
73
|
simo/core/__pycache__/gateways.cpython-38.pyc,sha256=XBiwMfBkjoQ2re6jvADJOwK0_0Aav-crzie9qtfqT9U,4599
|
|
74
74
|
simo/core/__pycache__/loggers.cpython-38.pyc,sha256=Z-cdQnC6XlIonPV4Sl4E52tP4NMEdPAiHK0cFaIL7I8,1623
|
|
75
75
|
simo/core/__pycache__/managers.cpython-38.pyc,sha256=5vstOMfm997CZBBkaSiaS7EojhLTWZlbeA_EQ8u-yfg,2554
|
|
@@ -10175,7 +10175,7 @@ simo/fleet/auto_urls.py,sha256=X04oKJWA48wFW5iXg3PPROY2KDdHn_a99orQSE28QC4,518
|
|
|
10175
10175
|
simo/fleet/base_types.py,sha256=wL9RVkHr0gA7HI1wZq0pruGEIgvQqpfnCL4cC3ywsvw,102
|
|
10176
10176
|
simo/fleet/ble.py,sha256=eHA_9ABjbmH1vUVCv9hiPXQL2GZZSEVwfO0xyI1S0nI,1081
|
|
10177
10177
|
simo/fleet/controllers.py,sha256=rTxRFf-LKWAZxzixrsLZHHm51BmMx9a1PLdgf6inlNM,20533
|
|
10178
|
-
simo/fleet/forms.py,sha256=
|
|
10178
|
+
simo/fleet/forms.py,sha256=J3rjIvLgvd4lkxFM18ysf5int7fvLy5ARKYK5ca6O0U,36952
|
|
10179
10179
|
simo/fleet/gateways.py,sha256=KV5i5fxXIrlK-k6zyEkk83x11GJt-ELQ0npb4Ac83cM,3693
|
|
10180
10180
|
simo/fleet/managers.py,sha256=XOpDOA9L-f_550TNSyXnJbun2EmtGz1TenVTMlUSb8E,807
|
|
10181
10181
|
simo/fleet/models.py,sha256=ve-97F1cwGt-AmwfSJK0d-57pP3NyZpeu0XlHu2oK28,14494
|
|
@@ -10192,7 +10192,7 @@ simo/fleet/__pycache__/auto_urls.cpython-38.pyc,sha256=SqyTuaz_kEBvx-bL46SclsZEE
|
|
|
10192
10192
|
simo/fleet/__pycache__/base_types.cpython-38.pyc,sha256=deyPwjpT6xZiFxBGFnj5b7R-lbdOTh2krgpJhrcGVhc,274
|
|
10193
10193
|
simo/fleet/__pycache__/ble.cpython-38.pyc,sha256=Nrof9w7cm4OlpFWHeVnmvvanh2_oF9oQ3TknJiV93-0,1267
|
|
10194
10194
|
simo/fleet/__pycache__/controllers.cpython-38.pyc,sha256=l9bz18Qp33C12TJOKPSn9vIXnlBKnBusODNk7Fg64qA,18103
|
|
10195
|
-
simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=
|
|
10195
|
+
simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=EohqxmZDPg_NVSy6v5kR9bsLcY-8J2UI91TcQkIFrXg,27368
|
|
10196
10196
|
simo/fleet/__pycache__/gateways.cpython-38.pyc,sha256=YAcgTOqJbtjGI03lvEcU6keFfrwAHkObVmErYzfRvjk,3569
|
|
10197
10197
|
simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=8uz-xpUiqbGDgXIZ_XRZtFb-Tju6NGxflGg-Ee4Yo6k,1310
|
|
10198
10198
|
simo/fleet/__pycache__/models.cpython-38.pyc,sha256=pHNRUiPRjH0SLp14pzbSIxHi_-27SpZFgSh_7lzA8Wo,12359
|
|
@@ -10276,8 +10276,8 @@ simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
10276
10276
|
simo/generic/app_widgets.py,sha256=E_pnpA1hxMIhenRCrHoQ5cik06jm2BAHCkl_eo-OudU,1264
|
|
10277
10277
|
simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,409
|
|
10278
10278
|
simo/generic/controllers.py,sha256=WYuOUzDWvkYRaTvlbdGy_qmwp1o_ohqKDfV7OrOq2QU,52218
|
|
10279
|
-
simo/generic/forms.py,sha256=
|
|
10280
|
-
simo/generic/gateways.py,sha256=
|
|
10279
|
+
simo/generic/forms.py,sha256=NPHNg_8BPTIJt-DR0-GkNWgVo9bE0_50PUWSnpIE4Dg,24262
|
|
10280
|
+
simo/generic/gateways.py,sha256=Vw2r9wsIa86bs2nS-ExT31smpKnA19E0paiho7HeNX0,17390
|
|
10281
10281
|
simo/generic/models.py,sha256=92TACMhJHadAg0TT9GnARO_R3_Sl6i-GGjhG_x7YdFI,7391
|
|
10282
10282
|
simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
|
|
10283
10283
|
simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
|
|
@@ -10285,8 +10285,8 @@ simo/generic/__pycache__/__init__.cpython-38.pyc,sha256=mLu54WS9KIl-pHwVCBKpsDFI
|
|
|
10285
10285
|
simo/generic/__pycache__/app_widgets.cpython-38.pyc,sha256=0IoKRG9n1tkNRRkrqAeOQwWBPd_33u98JBcVtMVVCio,2374
|
|
10286
10286
|
simo/generic/__pycache__/base_types.cpython-38.pyc,sha256=ptw6axyAqemZA35oa6vzr7EihzvbhW9w7Y-G6kfDedU,555
|
|
10287
10287
|
simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=e0bvgyePgJbIs1omBq0TRPlVSKar2sK_JbUKqDRj7mY,33235
|
|
10288
|
-
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=
|
|
10289
|
-
simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=
|
|
10288
|
+
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=du8pawGkAyGP51Cb6uWgvVLx48JZKNkVCdOpRmqQFaA,17915
|
|
10289
|
+
simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=LcBnE4rzzBOpVP1oI2mHSoB4dtZ4wP_vL0Y-YzTBVRE,12786
|
|
10290
10290
|
simo/generic/__pycache__/models.cpython-38.pyc,sha256=PzlZsM1jxo3FVb7QDm3bny8UFwTsGrMQe4mj4tJ06eQ,5675
|
|
10291
10291
|
simo/generic/__pycache__/routing.cpython-38.pyc,sha256=xtxTUTBTdivzFyA5Wh7k-hUj1WDO_FiRq6HYXdbr9Ks,382
|
|
10292
10292
|
simo/generic/__pycache__/socket_consumers.cpython-38.pyc,sha256=piFHces0J9QuXu_CNBCQCYjoZEeoaxyVjLfJ9KaR8C8,1898
|
|
@@ -10456,8 +10456,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10456
10456
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10457
10457
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10458
10458
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10459
|
-
simo-2.0.
|
|
10460
|
-
simo-2.0.
|
|
10461
|
-
simo-2.0.
|
|
10462
|
-
simo-2.0.
|
|
10463
|
-
simo-2.0.
|
|
10459
|
+
simo-2.0.31.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10460
|
+
simo-2.0.31.dist-info/METADATA,sha256=65C9h0Hq9Zg-Iob4o6DO_iM3KjIs6e2u5D5qoNdprYw,1730
|
|
10461
|
+
simo-2.0.31.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10462
|
+
simo-2.0.31.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10463
|
+
simo-2.0.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|