simo 2.0.16__py3-none-any.whl → 2.0.17__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__/models.cpython-38.pyc +0 -0
- simo/core/__pycache__/serializers.cpython-38.pyc +0 -0
- simo/core/__pycache__/tasks.cpython-38.pyc +0 -0
- simo/core/models.py +2 -2
- simo/core/serializers.py +2 -1
- simo/core/tasks.py +3 -6
- simo/generic/__pycache__/forms.cpython-38.pyc +0 -0
- simo/generic/__pycache__/models.cpython-38.pyc +0 -0
- simo/generic/forms.py +14 -2
- simo/generic/models.py +41 -0
- {simo-2.0.16.dist-info → simo-2.0.17.dist-info}/METADATA +1 -1
- {simo-2.0.16.dist-info → simo-2.0.17.dist-info}/RECORD +15 -15
- {simo-2.0.16.dist-info → simo-2.0.17.dist-info}/LICENSE.md +0 -0
- {simo-2.0.16.dist-info → simo-2.0.17.dist-info}/WHEEL +0 -0
- {simo-2.0.16.dist-info → simo-2.0.17.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
simo/core/models.py
CHANGED
|
@@ -79,7 +79,7 @@ class Instance(DirtyFieldsMixin, models.Model, SimoAdminMixin):
|
|
|
79
79
|
)
|
|
80
80
|
name = models.CharField(max_length=100, db_index=True, unique=True)
|
|
81
81
|
slug = models.CharField(max_length=100, db_index=True, unique=True)
|
|
82
|
-
cover_image =
|
|
82
|
+
cover_image = models.ImageField(
|
|
83
83
|
upload_to='hub_covers', null=True, blank=True
|
|
84
84
|
)
|
|
85
85
|
cover_image_synced = models.BooleanField(default=False)
|
|
@@ -151,7 +151,7 @@ class Category(DirtyFieldsMixin, models.Model, SimoAdminMixin):
|
|
|
151
151
|
instance = models.ForeignKey(Instance, on_delete=models.CASCADE)
|
|
152
152
|
name = models.CharField(_('name'), max_length=40)
|
|
153
153
|
icon = models.ForeignKey(Icon, on_delete=models.SET_NULL, null=True)
|
|
154
|
-
header_image =
|
|
154
|
+
header_image = models.ImageField(
|
|
155
155
|
upload_to='categories', null=True, blank=True,
|
|
156
156
|
help_text="Will be cropped down to: 830x430"
|
|
157
157
|
)
|
simo/core/serializers.py
CHANGED
|
@@ -51,7 +51,8 @@ class CategorySerializer(serializers.ModelSerializer):
|
|
|
51
51
|
|
|
52
52
|
def get_header_image_thumb(self, obj):
|
|
53
53
|
if obj.header_image:
|
|
54
|
-
|
|
54
|
+
thumbnailer = get_thumbnailer(obj.header_image.path)
|
|
55
|
+
url = thumbnailer.get_thumbnail(
|
|
55
56
|
{'size': (830, 430), 'crop': True}
|
|
56
57
|
).url
|
|
57
58
|
request = get_current_request()
|
simo/core/tasks.py
CHANGED
|
@@ -7,20 +7,16 @@ import datetime
|
|
|
7
7
|
import requests
|
|
8
8
|
import subprocess
|
|
9
9
|
import threading
|
|
10
|
-
import simo
|
|
11
10
|
import pkg_resources
|
|
12
11
|
from django.db.models import Q
|
|
13
12
|
from django.db import connection
|
|
14
|
-
from django.db import transaction
|
|
15
13
|
from django.template.loader import render_to_string
|
|
16
|
-
from easy_thumbnails.files import get_thumbnailer
|
|
17
14
|
from celeryc import celery_app
|
|
18
15
|
from django.utils import timezone
|
|
19
|
-
from
|
|
16
|
+
from easy_thumbnails.files import get_thumbnailer
|
|
20
17
|
from simo.conf import dynamic_settings
|
|
21
18
|
from simo.core.utils.helpers import get_self_ip
|
|
22
19
|
from .models import Instance, Component, ComponentHistory, HistoryAggregate
|
|
23
|
-
from .utils.helpers import get_random_string, is_update_available
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
def supervisor_restart():
|
|
@@ -150,7 +146,8 @@ def sync_with_remote():
|
|
|
150
146
|
if instance.share_location:
|
|
151
147
|
instance_data['location'] = instance.location
|
|
152
148
|
if instance.cover_image and not instance.cover_image_synced:
|
|
153
|
-
|
|
149
|
+
thumbnailer = get_thumbnailer(instance.cover_image.path)
|
|
150
|
+
cover_imb_path = thumbnailer.get_thumbnail(
|
|
154
151
|
{'size': (880, 490), 'crop': True}
|
|
155
152
|
).path
|
|
156
153
|
with open(cover_imb_path, 'rb') as img:
|
|
Binary file
|
|
Binary file
|
simo/generic/forms.py
CHANGED
|
@@ -218,6 +218,16 @@ class AlarmGroupConfigForm(BaseComponentForm):
|
|
|
218
218
|
required=False,
|
|
219
219
|
help_text="Defines if this is your main/top global alarm group."
|
|
220
220
|
)
|
|
221
|
+
arm_on_away = forms.ChoiceField(
|
|
222
|
+
required=False,
|
|
223
|
+
choices=(
|
|
224
|
+
(None, "No"),
|
|
225
|
+
('on_away', "Yes"),
|
|
226
|
+
('on_away_and_locked', "Yes, but only if at least one arming lock is Locked."),
|
|
227
|
+
('on_away_and_locked_all', "Yes, but only if all arming locks are Locked."),
|
|
228
|
+
),
|
|
229
|
+
help_text="Arm automatically as soon as everybody leaves.<br>"
|
|
230
|
+
)
|
|
221
231
|
arming_locks = forms.ModelMultipleChoiceField(
|
|
222
232
|
Component.objects.filter(base_type='lock'),
|
|
223
233
|
label="Arming locks", required=False,
|
|
@@ -228,7 +238,9 @@ class AlarmGroupConfigForm(BaseComponentForm):
|
|
|
228
238
|
)
|
|
229
239
|
),
|
|
230
240
|
help_text="Alarm group will get armed automatically whenever "
|
|
231
|
-
"any of assigned locks
|
|
241
|
+
"any of assigned locks changes it's state to locked. <br>"
|
|
242
|
+
"If Arm on away is enabled and set to work with arming locks, "
|
|
243
|
+
"arming will take effect only after everybody leaves."
|
|
232
244
|
)
|
|
233
245
|
disarming_locks = forms.ModelMultipleChoiceField(
|
|
234
246
|
Component.objects.filter(base_type='lock'),
|
|
@@ -240,7 +252,7 @@ class AlarmGroupConfigForm(BaseComponentForm):
|
|
|
240
252
|
)
|
|
241
253
|
),
|
|
242
254
|
help_text="Alarm group will be disarmed automatically whenever "
|
|
243
|
-
"any of assigned locks
|
|
255
|
+
"any of assigned locks changes it's state to unlocked. "
|
|
244
256
|
)
|
|
245
257
|
notify_on_breach = forms.IntegerField(
|
|
246
258
|
required=False, min_value=0,
|
simo/generic/models.py
CHANGED
|
@@ -5,6 +5,7 @@ from threading import Timer
|
|
|
5
5
|
from django.db.models.signals import pre_save, post_save, post_delete
|
|
6
6
|
from django.dispatch import receiver
|
|
7
7
|
from simo.core.models import Instance, Component
|
|
8
|
+
from simo.users.models import InstanceUser
|
|
8
9
|
from .controllers import AlarmGroup
|
|
9
10
|
|
|
10
11
|
|
|
@@ -124,6 +125,10 @@ def bind_controlling_locks_to_alarm_groups(sender, instance, *args, **kwargs):
|
|
|
124
125
|
base_type=AlarmGroup.base_type,
|
|
125
126
|
config__arming_locks__contains=instance.id
|
|
126
127
|
):
|
|
128
|
+
if ag.config.get(
|
|
129
|
+
'arm_on_away', ''
|
|
130
|
+
).startswith('on_away_and_locked'):
|
|
131
|
+
continue
|
|
127
132
|
ag.arm()
|
|
128
133
|
elif instance.value == 'unlocked':
|
|
129
134
|
for ag in Component.objects.filter(
|
|
@@ -132,3 +137,39 @@ def bind_controlling_locks_to_alarm_groups(sender, instance, *args, **kwargs):
|
|
|
132
137
|
):
|
|
133
138
|
ag.disarm()
|
|
134
139
|
|
|
140
|
+
|
|
141
|
+
@receiver(post_save, sender=InstanceUser)
|
|
142
|
+
def bind_alarm_groups(sender, instance, created, *args, **kwargs):
|
|
143
|
+
if created:
|
|
144
|
+
return
|
|
145
|
+
if instance.at_home:
|
|
146
|
+
return
|
|
147
|
+
if 'at_home' not in instance.get_dirty_fields():
|
|
148
|
+
return
|
|
149
|
+
users_at_home = InstanceUser.objects.filter(
|
|
150
|
+
instance=instance.instance, at_home=True
|
|
151
|
+
).exclude(is_active=False).exclude(instance.id)
|
|
152
|
+
if not users_at_home.count():
|
|
153
|
+
for ag in Component.objects.filter(
|
|
154
|
+
zone__instance=instance.instance,
|
|
155
|
+
base_type=AlarmGroup.base_type,
|
|
156
|
+
config__has_key='arm_on_away'
|
|
157
|
+
).exclude(config__arm_on_away=None):
|
|
158
|
+
if ag.config.get('arm_on_away') == 'on_away':
|
|
159
|
+
ag.arm()
|
|
160
|
+
elif ag.config.get('arm_on_away').startswith('on_away_and_locked'):
|
|
161
|
+
locked_states = [
|
|
162
|
+
True if l['value'] == 'locked' else False
|
|
163
|
+
for l in Component.objects.filter(
|
|
164
|
+
base_type='lock', id__in=ag.config.get('arming_locks', []),
|
|
165
|
+
).values('value')
|
|
166
|
+
]
|
|
167
|
+
if not any(locked_states):
|
|
168
|
+
continue
|
|
169
|
+
if ag.config['arm_on_away'] == 'on_away_and_locked':
|
|
170
|
+
ag.arm()
|
|
171
|
+
continue
|
|
172
|
+
if ag.config['arm_on_away'] == 'on_away_and_locked_all' \
|
|
173
|
+
and all(locked_states):
|
|
174
|
+
ag.arm()
|
|
175
|
+
continue
|
|
@@ -43,14 +43,14 @@ simo/core/gateways.py,sha256=s_c2W0v2_te89i6LS4Nj7F2wn9UwjZXPT7pfy6SToVo,3714
|
|
|
43
43
|
simo/core/loggers.py,sha256=EBdq23gTQScVfQVH-xeP90-wII2DQFDjoROAW6ggUP4,1645
|
|
44
44
|
simo/core/managers.py,sha256=WoQ4OX3akIvoroSYji-nLVqXBSJzCiC1u_IiWkKbKmA,2413
|
|
45
45
|
simo/core/middleware.py,sha256=64PYjnyRnYf4sgMvPfR0oQqf9UEtxUwnhJe3RV6z_HI,2040
|
|
46
|
-
simo/core/models.py,sha256=
|
|
46
|
+
simo/core/models.py,sha256=dPLPju4xxc46x9JciOTC65SFSPogboXyNxjwrewXB1Y,19400
|
|
47
47
|
simo/core/permissions.py,sha256=UmFjGPDWtAUbaWxJsWORb2q6BREHqndv9mkSIpnmdLk,1379
|
|
48
48
|
simo/core/routing.py,sha256=X1_IHxyA-_Q7hw1udDoviVP4_FSBDl8GYETTC2zWTbY,499
|
|
49
|
-
simo/core/serializers.py,sha256=
|
|
49
|
+
simo/core/serializers.py,sha256=1A0CW85d8U_xX5JSda7DHuQ_RigCcRxBE5VNhNEoYqQ,17161
|
|
50
50
|
simo/core/signal_receivers.py,sha256=EZ8NSYZxUgSaLS16YZdK7T__l8dl0joMRllOxx5PUt4,2809
|
|
51
51
|
simo/core/socket_consumers.py,sha256=n7VE2Fvqt4iEAYLTRbTPOcI-7tszMAADu7gimBxB-Fg,9635
|
|
52
52
|
simo/core/storage.py,sha256=YlxmdRs-zhShWtFKgpJ0qp2NDBuIkJGYC1OJzqkbttQ,572
|
|
53
|
-
simo/core/tasks.py,sha256=
|
|
53
|
+
simo/core/tasks.py,sha256=K64_8msFxUnggQDD2lBhtv4l7WliajQTlJNwe-m4BvY,10920
|
|
54
54
|
simo/core/todos.py,sha256=eYVXfLGiapkxKK57XuviSNe3WsUYyIWZ0hgQJk7ThKo,665
|
|
55
55
|
simo/core/types.py,sha256=WJEq48mIbFi_5Alt4wxWMGXxNxUTXqfQU5koH7wqHHI,1108
|
|
56
56
|
simo/core/views.py,sha256=hlAKpAbCbqI3a-uL5tDp532T2oLFiF0MBzKUJ_SNzo0,5833
|
|
@@ -74,14 +74,14 @@ simo/core/__pycache__/gateways.cpython-38.pyc,sha256=XBiwMfBkjoQ2re6jvADJOwK0_0A
|
|
|
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
|
|
76
76
|
simo/core/__pycache__/middleware.cpython-38.pyc,sha256=bGOFJNEhJeLbpsZp8LYn1VA3paLF5HULHQ6IFKa7Juc,2022
|
|
77
|
-
simo/core/__pycache__/models.cpython-38.pyc,sha256=
|
|
77
|
+
simo/core/__pycache__/models.cpython-38.pyc,sha256=J3VZfFaU-aMkptCoviPvAJzJ8zBptGHmt504zjf2TCI,17006
|
|
78
78
|
simo/core/__pycache__/permissions.cpython-38.pyc,sha256=uygjPbfRQiEzyo5-McCxsuMDJLbDYO_TLu55U7bJbR0,1809
|
|
79
79
|
simo/core/__pycache__/routing.cpython-38.pyc,sha256=3T3FPJ8Cn99xZCGvMyg2xjl7al-Shm9CelbSpkJtNP8,599
|
|
80
|
-
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=
|
|
80
|
+
simo/core/__pycache__/serializers.cpython-38.pyc,sha256=NbXYWaJMtJebncJdhHt1uaKtCICU7G9Oe-uj0AWO7ds,16578
|
|
81
81
|
simo/core/__pycache__/signal_receivers.cpython-38.pyc,sha256=sgjH_wv-1U99auH5uHb3or0qettPeHAlsz8P7B03ajY,2430
|
|
82
82
|
simo/core/__pycache__/socket_consumers.cpython-38.pyc,sha256=NJUr7nRyHFvmAumxxWpsod5wzVVZM99rCEuJs1utHA4,8432
|
|
83
83
|
simo/core/__pycache__/storage.cpython-38.pyc,sha256=BTkYH8QQyjqI0WOtJC8fHNtgu0YA1vjqZclXjC2vCVI,1116
|
|
84
|
-
simo/core/__pycache__/tasks.cpython-38.pyc,sha256=
|
|
84
|
+
simo/core/__pycache__/tasks.cpython-38.pyc,sha256=9L1a14-cifiS4WSS7SliJ2486tpL245YbPkmUiCUe3A,8244
|
|
85
85
|
simo/core/__pycache__/todos.cpython-38.pyc,sha256=lOqGZ58siHM3isoJV4r7sg8igrfE9fFd-jSfeBa0AQI,253
|
|
86
86
|
simo/core/__pycache__/views.cpython-38.pyc,sha256=YrKRZPaV_JM4VGpdhVhsK-90UwUTOqp-V-Yj0SRGZgs,4212
|
|
87
87
|
simo/core/__pycache__/widgets.cpython-38.pyc,sha256=sR0ZeHCHrhnNDBJuRrxp3zUsfBp0xrtF0xrK2TkQv1o,3520
|
|
@@ -10270,18 +10270,18 @@ simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
10270
10270
|
simo/generic/app_widgets.py,sha256=E_pnpA1hxMIhenRCrHoQ5cik06jm2BAHCkl_eo-OudU,1264
|
|
10271
10271
|
simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,409
|
|
10272
10272
|
simo/generic/controllers.py,sha256=WYuOUzDWvkYRaTvlbdGy_qmwp1o_ohqKDfV7OrOq2QU,52218
|
|
10273
|
-
simo/generic/forms.py,sha256=
|
|
10273
|
+
simo/generic/forms.py,sha256=U6MIS5U7jLG6XabqCZvrfSoiNCQiWZYE8VZPnyN3SJw,23757
|
|
10274
10274
|
simo/generic/gateways.py,sha256=b3tQ2bAkDVYXCF5iZi2yi-6nZAM8WmHE9ICwxMyR0to,17034
|
|
10275
|
-
simo/generic/models.py,sha256=
|
|
10275
|
+
simo/generic/models.py,sha256=iUE1-PVyAPvOkxczU6sXZKUwWVQxkljtx2E4g9WstnU,6711
|
|
10276
10276
|
simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
|
|
10277
10277
|
simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
|
|
10278
10278
|
simo/generic/__pycache__/__init__.cpython-38.pyc,sha256=mLu54WS9KIl-pHwVCBKpsDFIlOqml--JsOVzAUHg6cU,161
|
|
10279
10279
|
simo/generic/__pycache__/app_widgets.cpython-38.pyc,sha256=0IoKRG9n1tkNRRkrqAeOQwWBPd_33u98JBcVtMVVCio,2374
|
|
10280
10280
|
simo/generic/__pycache__/base_types.cpython-38.pyc,sha256=ptw6axyAqemZA35oa6vzr7EihzvbhW9w7Y-G6kfDedU,555
|
|
10281
10281
|
simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=e0bvgyePgJbIs1omBq0TRPlVSKar2sK_JbUKqDRj7mY,33235
|
|
10282
|
-
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=
|
|
10282
|
+
simo/generic/__pycache__/forms.cpython-38.pyc,sha256=lqpRTX5rnrkyJZ5Dga4e9y2WJ81r394AW5DV4KkvxXQ,17856
|
|
10283
10283
|
simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=a4lLIMPyxm9tNzIqorXHIPZFVTcXlPsM1ycJMghxcHA,12673
|
|
10284
|
-
simo/generic/__pycache__/models.cpython-38.pyc,sha256=
|
|
10284
|
+
simo/generic/__pycache__/models.cpython-38.pyc,sha256=GQeX2Y6diAiDKwd43RvSjRF3jGpkvXSu3ja7daEfQSA,5006
|
|
10285
10285
|
simo/generic/__pycache__/routing.cpython-38.pyc,sha256=xtxTUTBTdivzFyA5Wh7k-hUj1WDO_FiRq6HYXdbr9Ks,382
|
|
10286
10286
|
simo/generic/__pycache__/socket_consumers.cpython-38.pyc,sha256=piFHces0J9QuXu_CNBCQCYjoZEeoaxyVjLfJ9KaR8C8,1898
|
|
10287
10287
|
simo/generic/static/weather_icons/01d@2x.png,sha256=TZfWi6Rfddb2P-oldWWcjUiuCHiU9Yrc5hyrQAhF26I,948
|
|
@@ -10446,8 +10446,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10446
10446
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10447
10447
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10448
10448
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10449
|
-
simo-2.0.
|
|
10450
|
-
simo-2.0.
|
|
10451
|
-
simo-2.0.
|
|
10452
|
-
simo-2.0.
|
|
10453
|
-
simo-2.0.
|
|
10449
|
+
simo-2.0.17.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10450
|
+
simo-2.0.17.dist-info/METADATA,sha256=G9pIgmqL-p_PAXm14_HZElA4R_pGjIBC9ZGAxzZ4nGU,1700
|
|
10451
|
+
simo-2.0.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10452
|
+
simo-2.0.17.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10453
|
+
simo-2.0.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|