simo 2.1.8__py3-none-any.whl → 2.1.9__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/dynamic_settings.py +8 -1
- simo/core/tasks.py +0 -14
- simo/generic/controllers.py +1 -1
- simo/generic/gateways.py +13 -0
- simo/users/models.py +3 -3
- simo/users/tasks.py +6 -4
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/METADATA +1 -1
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/RECORD +12 -12
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/LICENSE.md +0 -0
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/WHEEL +0 -0
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/entry_points.txt +0 -0
- {simo-2.1.8.dist-info → simo-2.1.9.dist-info}/top_level.txt +0 -0
simo/core/dynamic_settings.py
CHANGED
|
@@ -66,4 +66,11 @@ class AutoUpdate(BooleanPreference):
|
|
|
66
66
|
os.remove(os.path.join(settings.VAR_DIR, 'auto_update'))
|
|
67
67
|
except:
|
|
68
68
|
pass
|
|
69
|
-
return
|
|
69
|
+
return
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
@global_preferences_registry.register
|
|
73
|
+
class NeedsMqttAclsRebuild(BooleanPreference):
|
|
74
|
+
section = core
|
|
75
|
+
name = 'needs_mqtt_acls_rebuild'
|
|
76
|
+
default = True
|
simo/core/tasks.py
CHANGED
|
@@ -255,19 +255,6 @@ def sync_with_remote():
|
|
|
255
255
|
).update(is_active=False)
|
|
256
256
|
|
|
257
257
|
|
|
258
|
-
@celery_app.task
|
|
259
|
-
def watch_timers():
|
|
260
|
-
for component in Component.objects.filter(
|
|
261
|
-
meta__timer_to__gt=0
|
|
262
|
-
).filter(meta__timer_to__lt=time.time()):
|
|
263
|
-
component.meta['timer_to'] = 0
|
|
264
|
-
component.meta['timer_start'] = 0
|
|
265
|
-
component.save()
|
|
266
|
-
try:
|
|
267
|
-
component.controller._on_timer_end()
|
|
268
|
-
except Exception as e:
|
|
269
|
-
print(traceback.format_exc(), file=sys.stderr)
|
|
270
|
-
|
|
271
258
|
|
|
272
259
|
@celery_app.task
|
|
273
260
|
def clear_history():
|
|
@@ -411,7 +398,6 @@ def low_battery_notifications():
|
|
|
411
398
|
|
|
412
399
|
@celery_app.on_after_finalize.connect
|
|
413
400
|
def setup_periodic_tasks(sender, **kwargs):
|
|
414
|
-
sender.add_periodic_task(1, watch_timers.s())
|
|
415
401
|
sender.add_periodic_task(20, sync_with_remote.s())
|
|
416
402
|
sender.add_periodic_task(60 * 60, clear_history.s())
|
|
417
403
|
sender.add_periodic_task(60 * 60, update_latest_version_available.s())
|
simo/generic/controllers.py
CHANGED
|
@@ -717,7 +717,7 @@ class Blinds(ControllerBase, TimerMixin):
|
|
|
717
717
|
"Integer between 0 - 180 is required for blinds angle."
|
|
718
718
|
)
|
|
719
719
|
else:
|
|
720
|
-
value['angle'] = self.component.value
|
|
720
|
+
value['angle'] = self.component.value.ge('angle', 0)
|
|
721
721
|
|
|
722
722
|
elif occasion == BEFORE_SET:
|
|
723
723
|
if not isinstance(value, dict):
|
simo/generic/gateways.py
CHANGED
|
@@ -178,6 +178,7 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
178
178
|
('watch_scripts', 10),
|
|
179
179
|
('watch_watering', 60),
|
|
180
180
|
('watch_alarm_events', 1),
|
|
181
|
+
('watch_timers', 1)
|
|
181
182
|
)
|
|
182
183
|
|
|
183
184
|
def watch_thermostats(self):
|
|
@@ -496,6 +497,18 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
|
496
497
|
alarm.meta['events_triggered'].append(uid)
|
|
497
498
|
alarm.save(update_fields=['meta'])
|
|
498
499
|
|
|
500
|
+
def watch_timers(self):
|
|
501
|
+
for component in Component.objects.filter(
|
|
502
|
+
meta__timer_to__gt=0
|
|
503
|
+
).filter(meta__timer_to__lt=time.time()):
|
|
504
|
+
component.meta['timer_to'] = 0
|
|
505
|
+
component.meta['timer_start'] = 0
|
|
506
|
+
component.save()
|
|
507
|
+
try:
|
|
508
|
+
component.controller._on_timer_end()
|
|
509
|
+
except Exception as e:
|
|
510
|
+
print(traceback.format_exc(), file=sys.stderr)
|
|
511
|
+
|
|
499
512
|
|
|
500
513
|
class DummyGatewayHandler(BaseObjectCommandsGatewayHandler):
|
|
501
514
|
name = "Dummy"
|
simo/users/models.py
CHANGED
|
@@ -135,7 +135,7 @@ def post_instance_user_save(sender, instance, created, **kwargs):
|
|
|
135
135
|
).publish()
|
|
136
136
|
transaction.on_commit(post_update)
|
|
137
137
|
if 'role' or 'is_active' in instance.dirty_fields:
|
|
138
|
-
|
|
138
|
+
dynamic_settings['core__needs_mqtt_acls_rebuild'] = True
|
|
139
139
|
|
|
140
140
|
|
|
141
141
|
class User(AbstractBaseUser, SimoAdminMixin):
|
|
@@ -491,7 +491,7 @@ class ComponentPermission(models.Model):
|
|
|
491
491
|
@receiver(post_save, sender=ComponentPermission)
|
|
492
492
|
def rebuild_mqtt_acls_on_create(sender, instance, created, **kwargs):
|
|
493
493
|
if not created:
|
|
494
|
-
|
|
494
|
+
dynamic_settings['core__needs_mqtt_acls_rebuild'] = True
|
|
495
495
|
|
|
496
496
|
|
|
497
497
|
|
|
@@ -507,7 +507,7 @@ def create_component_permissions_comp(sender, instance, created, **kwargs):
|
|
|
507
507
|
'write': role.is_superuser or role.is_owner
|
|
508
508
|
}
|
|
509
509
|
)
|
|
510
|
-
|
|
510
|
+
dynamic_settings['core__needs_mqtt_acls_rebuild'] = True
|
|
511
511
|
|
|
512
512
|
|
|
513
513
|
@receiver(post_save, sender=PermissionsRole)
|
simo/users/tasks.py
CHANGED
|
@@ -18,12 +18,14 @@ def clear_device_report_logs():
|
|
|
18
18
|
|
|
19
19
|
@celery_app.task
|
|
20
20
|
def rebuild_mqtt_acls():
|
|
21
|
-
from .
|
|
22
|
-
|
|
21
|
+
from simo.conf import dynamic_settings
|
|
22
|
+
if dynamic_settings['core__needs_mqtt_acls_rebuild']:
|
|
23
|
+
dynamic_settings['core__needs_mqtt_acls_rebuild'] = False
|
|
24
|
+
from .utils import update_mqtt_acls
|
|
25
|
+
update_mqtt_acls()
|
|
23
26
|
|
|
24
27
|
|
|
25
28
|
@celery_app.on_after_finalize.connect
|
|
26
29
|
def setup_periodic_tasks(sender, **kwargs):
|
|
27
30
|
sender.add_periodic_task(60 * 60, clear_device_report_logs.s())
|
|
28
|
-
|
|
29
|
-
sender.add_periodic_task(60 * 60 * 24, rebuild_mqtt_acls.s())
|
|
31
|
+
sender.add_periodic_task(30, rebuild_mqtt_acls.s())
|
|
@@ -24,7 +24,7 @@ simo/core/autocomplete_views.py,sha256=JT5LA2_Wtr60XYSAIqaXFKFYPjrmkEf6yunXD9y2z
|
|
|
24
24
|
simo/core/base_types.py,sha256=qVh6MrXZEfN7bFOyFftC7u0yyz0PkvpsjllLBc6SCp4,616
|
|
25
25
|
simo/core/context.py,sha256=98PXAMie43faRVBFkOG22uNpvGRNprcGhzjBFkrxaRY,1367
|
|
26
26
|
simo/core/controllers.py,sha256=2XqqnpZy1nYwowflIKI4lcNMbotERf_YkbY0ztExfbY,29529
|
|
27
|
-
simo/core/dynamic_settings.py,sha256=
|
|
27
|
+
simo/core/dynamic_settings.py,sha256=U9pY7p_hoeD1LxobIvxZqQ7Zn_4MhYMqZvsr4O0PAYs,1871
|
|
28
28
|
simo/core/events.py,sha256=LvtonJGNyCb6HLozs4EG0WZItnDwNdtnGQ4vTcnKvUs,4438
|
|
29
29
|
simo/core/filters.py,sha256=ghtOZcrwNAkIyF5_G9Sn73NkiI71mXv0NhwCk4IyMIM,411
|
|
30
30
|
simo/core/form_fields.py,sha256=9tIjiEN3IE55GPyB4tOlfkd51JDne3-h8pKhpL3tLFE,2220
|
|
@@ -40,7 +40,7 @@ simo/core/serializers.py,sha256=K13SDW-FIcNiRYmJufSDS2EkRAW3cuoiHRByof2DYXQ,2062
|
|
|
40
40
|
simo/core/signal_receivers.py,sha256=9-qFCCeSLcMFEMg6QUtKOVgUsoNoqhzGoI98nuNSTEo,6228
|
|
41
41
|
simo/core/socket_consumers.py,sha256=n7VE2Fvqt4iEAYLTRbTPOcI-7tszMAADu7gimBxB-Fg,9635
|
|
42
42
|
simo/core/storage.py,sha256=YlxmdRs-zhShWtFKgpJ0qp2NDBuIkJGYC1OJzqkbttQ,572
|
|
43
|
-
simo/core/tasks.py,sha256=
|
|
43
|
+
simo/core/tasks.py,sha256=BAnCnNPuHtZQL9CG4n_e6G_aKL0aZBZFjp-HOWQg4O0,14049
|
|
44
44
|
simo/core/todos.py,sha256=eYVXfLGiapkxKK57XuviSNe3WsUYyIWZ0hgQJk7ThKo,665
|
|
45
45
|
simo/core/types.py,sha256=WJEq48mIbFi_5Alt4wxWMGXxNxUTXqfQU5koH7wqHHI,1108
|
|
46
46
|
simo/core/views.py,sha256=ze8yX0PBLN-DH8B8jol6NKj0hLOAE4WA1rTXf07G-MU,2129
|
|
@@ -10299,9 +10299,9 @@ simo/fleet/templates/fleet/controllers_info/button.md,sha256=GIuxqG617174NEtpPeC
|
|
|
10299
10299
|
simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10300
10300
|
simo/generic/app_widgets.py,sha256=E_pnpA1hxMIhenRCrHoQ5cik06jm2BAHCkl_eo-OudU,1264
|
|
10301
10301
|
simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,409
|
|
10302
|
-
simo/generic/controllers.py,sha256=
|
|
10302
|
+
simo/generic/controllers.py,sha256=bOlkkyjWmK3Pm5XEpQKKx7_MLPHv62aC4LyY2JT3EZs,58251
|
|
10303
10303
|
simo/generic/forms.py,sha256=IAfDtmEk1-CP0JBoetOD_ahLm64nK41GOUXjmbUzNtY,29550
|
|
10304
|
-
simo/generic/gateways.py,sha256=
|
|
10304
|
+
simo/generic/gateways.py,sha256=cc_q_g2HsI2_rWmr8yZ3spnMPwsgoYS5ApWRimc11wU,18831
|
|
10305
10305
|
simo/generic/models.py,sha256=92TACMhJHadAg0TT9GnARO_R3_Sl6i-GGjhG_x7YdFI,7391
|
|
10306
10306
|
simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
|
|
10307
10307
|
simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
|
|
@@ -10408,12 +10408,12 @@ simo/users/auth_backends.py,sha256=I5pnaTa20-Lxfw_dFG8471xDITb0_fQl1PVhJalp5vU,3
|
|
|
10408
10408
|
simo/users/auto_urls.py,sha256=lcJvteBsbHQMJieZpDz-63tDYejLApqsW3CUnDakd7k,272
|
|
10409
10409
|
simo/users/dynamic_settings.py,sha256=sEIsi4yJw3kH46Jq_aOkSuK7QTfQACGUE-lkyBogCaM,570
|
|
10410
10410
|
simo/users/middleware.py,sha256=GMCrnWSc_2qCleyQIkfQGdL-pU-UTEcSg1wPvIKZ9uk,1210
|
|
10411
|
-
simo/users/models.py,sha256=
|
|
10411
|
+
simo/users/models.py,sha256=Y3dkwIvkSbTGWQmAUeK-7ADMsTUU3IqQKOXwtWWzxqY,19824
|
|
10412
10412
|
simo/users/permissions.py,sha256=IwtYS8yQdupWbYKR9VimSRDV3qCJ2jXP57Lyjpb2EQM,242
|
|
10413
10413
|
simo/users/serializers.py,sha256=DwbFGi4WeTYXOSnfrBfd5rC5OGtevYurn27EaTVa1EU,2553
|
|
10414
10414
|
simo/users/sso_urls.py,sha256=gQOaPvGMYFD0NCVSwyoWO-mTEHe5j9sbzV_RK7kdvp0,251
|
|
10415
10415
|
simo/users/sso_views.py,sha256=-XI67TvQ7SN3goU4OuAHyn84u_1vtusvpn7Pu0K97zo,4648
|
|
10416
|
-
simo/users/tasks.py,sha256=
|
|
10416
|
+
simo/users/tasks.py,sha256=HJAqiyWGsaN3wSfquU0UyQ20jL-njXeaaTOdDT3TQ3s,979
|
|
10417
10417
|
simo/users/utils.py,sha256=7gU_TDnAOsDYqJM0CFo8efPah2bTXfGpXxRqzD5RiSs,1270
|
|
10418
10418
|
simo/users/views.py,sha256=dOQVvmlHG7ihWKJLFUBcqKOA0UDctlMKR0pTc36JZqg,3487
|
|
10419
10419
|
simo/users/__pycache__/__init__.cpython-38.pyc,sha256=VFoDJE_SKKaPqqYaaBYd1Ndb1hjakkTo_u0EG_XJ1GM,211
|
|
@@ -10502,9 +10502,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10502
10502
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10503
10503
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10504
10504
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10505
|
-
simo-2.1.
|
|
10506
|
-
simo-2.1.
|
|
10507
|
-
simo-2.1.
|
|
10508
|
-
simo-2.1.
|
|
10509
|
-
simo-2.1.
|
|
10510
|
-
simo-2.1.
|
|
10505
|
+
simo-2.1.9.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10506
|
+
simo-2.1.9.dist-info/METADATA,sha256=6jypPzyCrJ4lr1ajBXmhhD70eNrM4pNfPtDT5bwvtRs,1847
|
|
10507
|
+
simo-2.1.9.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
|
|
10508
|
+
simo-2.1.9.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
|
|
10509
|
+
simo-2.1.9.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10510
|
+
simo-2.1.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|