simo 2.2.9__py3-none-any.whl → 2.2.10__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.

Binary file
Binary file
simo/core/forms.py CHANGED
@@ -219,7 +219,10 @@ class ComponentAdminForm(forms.ModelForm):
219
219
 
220
220
  class Meta:
221
221
  model = Component
222
- fields = 'name', 'icon', 'zone', 'category', 'show_in_app', 'notes',
222
+ fields = (
223
+ 'name', 'icon', 'zone', 'category', 'show_in_app', 'notes',
224
+ 'alarm_category'
225
+ )
223
226
  widgets = {
224
227
  'icon': autocomplete.ModelSelect2(
225
228
  url='autocomplete-icon', attrs={'data-html': True}
simo/core/models.py CHANGED
@@ -12,7 +12,6 @@ from timezone_utils.choices import ALL_TIMEZONES_CHOICES
12
12
  from location_field.models.plain import PlainLocationField
13
13
  from model_utils import FieldTracker
14
14
  from dirtyfields import DirtyFieldsMixin
15
- from actstream import action
16
15
  from simo.core.utils.mixins import SimoAdminMixin
17
16
  from simo.core.storage import OverwriteStorage
18
17
  from simo.core.utils.validators import validate_svg
@@ -386,7 +385,9 @@ def is_in_alarm(self):
386
385
  ('security', _("Security")), ('fire', _("Fire")),
387
386
  ('flood', _("Flood")), ('other', _("Other"))
388
387
  ),
389
- help_text=_("Enable alarm properties by choosing one of alarm categories.")
388
+ help_text=_(
389
+ "Enable alarm properties by choosing one of alarm categories."
390
+ )
390
391
  )
391
392
  arm_status = models.CharField(
392
393
  max_length=20, db_index=True, default='disarmed', choices=(
Binary file
simo/fleet/controllers.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import json
2
2
  from django.utils.translation import gettext_lazy as _
3
3
  from django.db.transaction import atomic
4
+ from simo.core.middleware import get_current_instance
4
5
  from simo.core.events import GatewayObjectCommand
5
6
  from simo.core.controllers import (
6
7
  BinarySensor as BaseBinarySensor,
@@ -152,6 +153,13 @@ class DS18B20Sensor(FleeDeviceMixin, BasicSensorMixin, BaseNumericSensor):
152
153
  name = "DS18B20 Temperature sensor"
153
154
 
154
155
 
156
+
157
+ # TODO: need to change this to {
158
+ # 'temp': self.sensor.temperature, 'hum': self.sensor.humidity,
159
+ # 'pressure': self.sensor.pressure, 'gas': self.sensor.gas
160
+ # }
161
+ # which is used by BME680Sensor
162
+
155
163
  class BaseClimateSensor(FleeDeviceMixin, BasicSensorMixin, BaseMultiSensor):
156
164
  app_widget = NumericSensorWidget
157
165
 
@@ -194,6 +202,8 @@ class BaseClimateSensor(FleeDeviceMixin, BasicSensorMixin, BaseMultiSensor):
194
202
  return new_val
195
203
 
196
204
 
205
+
206
+
197
207
  class DHTSensor(BaseClimateSensor):
198
208
  config_form = ColonelDHTSensorConfigForm
199
209
  name = "DHT climate sensor"
@@ -210,6 +220,20 @@ class MPC9808TempSensor(FleeDeviceMixin, BaseNumericSensor):
210
220
  config_form = MPC9808SensorConfigForm
211
221
  name = "MPC9808 Temperature Sensor (I2C)"
212
222
 
223
+ @property
224
+ def default_value_units(self):
225
+ instance = get_current_instance()
226
+ if not instance:
227
+ return 'C'
228
+ if instance.units_of_measure == 'imperial':
229
+ return 'F'
230
+ return 'C'
231
+
232
+ def _prepare_for_set(self, value):
233
+ if self.component.zone.instance.units_of_measure == 'imperial':
234
+ return round((value[0][1] * 9 / 5) + 32, 1)
235
+ return value
236
+
213
237
 
214
238
  class ENS160AirQualitySensor(FleeDeviceMixin, BaseMultiSensor):
215
239
  gateway_class = FleetGatewayHandler
@@ -23,6 +23,7 @@ server{
23
23
  expires max;
24
24
  }
25
25
 
26
+ # daphne
26
27
  location /ws {
27
28
  include proxy_params;
28
29
 
@@ -32,9 +33,14 @@ server{
32
33
  proxy_pass http://unix:/tmp/http.sock;
33
34
  }
34
35
 
36
+ # gunicorn
35
37
  location / {
36
38
  include proxy_params;
37
- proxy_pass http://unix:/tmp/http.sock;
39
+ proxy_connect_timeout 600;
40
+ proxy_send_timeout 600;
41
+ proxy_read_timeout 600;
42
+ send_timeout 600;
43
+ proxy_pass http://unix:/tmp/gunicorn.sock;
38
44
  }
39
45
  }
40
46
 
@@ -74,6 +80,7 @@ server{
74
80
  expires max;
75
81
  }
76
82
 
83
+ # daphne
77
84
  location /ws {
78
85
  include proxy_params;
79
86
 
@@ -83,9 +90,14 @@ server{
83
90
  proxy_pass http://unix:/tmp/http.sock;
84
91
  }
85
92
 
93
+ # gunicorn
86
94
  location / {
87
95
  include proxy_params;
88
- proxy_pass http://unix:/tmp/http.sock;
96
+ proxy_connect_timeout 600;
97
+ proxy_send_timeout 600;
98
+ proxy_read_timeout 600;
99
+ send_timeout 600;
100
+ proxy_pass http://unix:/tmp/gunicorn.sock;
89
101
  }
90
102
 
91
103
  }
@@ -1,15 +1,30 @@
1
- [program:simo-http]
1
+ # using gunicorn for regular requests
2
+ [program:simo-gunicorn]
3
+ directory={{ project_dir }}/hub/
4
+ command=/usr/local/bin/gunicorn --workers 4 --timeout 120 --bind unix:/tmp/gunicorn.sock wsgi:application
5
+ process_name=%(program_name)s
6
+ user=root
7
+ stdout_logfile=/var/log/simo/gunicorn.log
8
+ stdout_logfile_maxbytes=1MB
9
+ stdout_logfile_backups=3
10
+ redirect_stderr=true
11
+ autostart=true
12
+ autorestart=true
13
+
14
+ # using daphne for socket connections routed to /ws/ on nginx.conf
15
+ [program:simo-daphne]
2
16
  directory={{ project_dir }}/hub/
3
17
  command=/usr/local/bin/daphne -u /tmp/http.sock --access-log /dev/stdout --proxy-headers asgi:application
4
18
  process_name=%(program_name)s
5
19
  user=root
6
- stdout_logfile=/var/log/simo/http.log
20
+ stdout_logfile=/var/log/simo/daphne.log
7
21
  stdout_logfile_maxbytes=1MB
8
22
  stdout_logfile_backups=3
9
23
  redirect_stderr=true
10
24
  autostart=true
11
25
  autorestart=true
12
26
 
27
+
13
28
  [program:simo-gateways]
14
29
  command=/usr/bin/python3 {{ project_dir }}/hub/manage.py gateways_manager
15
30
  process_name=%(program_name)s
@@ -0,0 +1,11 @@
1
+ """
2
+ WSGI config for SIMO.io project.
3
+
4
+ It exposes the WSGI callable as a module-level variable named ``application``.
5
+ """
6
+ import os
7
+ from django.core.wsgi import get_wsgi_application
8
+
9
+ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
10
+
11
+ application = get_wsgi_application()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.2.9
3
+ Version: 2.2.10
4
4
  Summary: Smart Home on Steroids!
5
5
  Author-email: Simanas Venčkauskas <simanas@simo.io>
6
6
  Project-URL: Homepage, https://simo.io
@@ -48,4 +48,5 @@ Requires-Dist: daphne ==4.1.2
48
48
  Requires-Dist: Pillow ==9.5.0
49
49
  Requires-Dist: django-markdownify ==0.9.5
50
50
  Requires-Dist: django-activity-stream ==2.0.0
51
+ Requires-Dist: gunicorn ==23.0.0
51
52
 
@@ -28,12 +28,12 @@ simo/core/dynamic_settings.py,sha256=U9pY7p_hoeD1LxobIvxZqQ7Zn_4MhYMqZvsr4O0PAYs
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
31
- simo/core/forms.py,sha256=AE-WWLOCH1O2TkhGzmYX2yr3QZJEB4mVh111SLVBuys,21851
31
+ simo/core/forms.py,sha256=sFVz8tENhi4QSudORu_e5tlGEC0aXumy6wzJqQNYBPk,21904
32
32
  simo/core/gateways.py,sha256=m0eS3XjVe34Dge6xtoCq16kFWCKJcdQrT0JW0REqoq8,3715
33
33
  simo/core/loggers.py,sha256=EBdq23gTQScVfQVH-xeP90-wII2DQFDjoROAW6ggUP4,1645
34
34
  simo/core/managers.py,sha256=n-b3I4uXzfHKTeB1VMjSaMsDUxp8FegFJwnbV1IsWQ4,3019
35
35
  simo/core/middleware.py,sha256=LIMpHJDQ4zx9dfmy5z0-rEW2EPO9d-iG1ZJbJ_6t6hc,1927
36
- simo/core/models.py,sha256=Mg6UjGQjA5WtxO2kq9fO-iW2f9UzDh58etcZ9-X5RSU,21570
36
+ simo/core/models.py,sha256=hQA8SeAPtGRSs4gk-bci2Ni3ZANtS62V-IDgCyJh2qE,21563
37
37
  simo/core/permissions.py,sha256=v0iJM4LOeYoEfMiw3OLPYio272G1aUEAg_z9Wd1q5m0,2993
38
38
  simo/core/routing.py,sha256=X1_IHxyA-_Q7hw1udDoviVP4_FSBDl8GYETTC2zWTbY,499
39
39
  simo/core/serializers.py,sha256=quXznnTKCm57rvRgke0mBnlWmaO8C5scJ8R251wa1jY,20869
@@ -61,15 +61,15 @@ simo/core/__pycache__/dynamic_settings.cpython-38.pyc,sha256=9ge2uV4QBKdA4f2pIZp
61
61
  simo/core/__pycache__/events.cpython-38.pyc,sha256=A1Axx-qftd1r7st7wkO3DkvTdt9-RkcJe5KJhpzJVk8,5109
62
62
  simo/core/__pycache__/filters.cpython-38.pyc,sha256=VIMADCBiYhziIyRmxAyUDJluZvuZmiC4bNYWTRsGSao,721
63
63
  simo/core/__pycache__/form_fields.cpython-38.pyc,sha256=u0voKXkA64xbH6LY_-jMBHQS4mOJZZeuB9WTvtv9JWE,3433
64
- simo/core/__pycache__/forms.cpython-38.pyc,sha256=yK5bcsGXG9QAi965Kg4jjKA6Wbi0nzluNStWjDVjIPQ,17887
64
+ simo/core/__pycache__/forms.cpython-38.pyc,sha256=JDCNYJQrZHUaMb4qZ6A0f1JptoCHQK1yfJwMJlhV7fI,17892
65
65
  simo/core/__pycache__/gateways.cpython-38.pyc,sha256=D1ooHL-iSpQrxnD8uAl4xWFJmm-QWZfbkLiLlFOMtdU,4553
66
66
  simo/core/__pycache__/loggers.cpython-38.pyc,sha256=Z-cdQnC6XlIonPV4Sl4E52tP4NMEdPAiHK0cFaIL7I8,1623
67
67
  simo/core/__pycache__/managers.cpython-38.pyc,sha256=6RTIxyjOgpQGtAqcUyE2vFPS09w1V5Wmd_vOV7rHRRI,3370
68
68
  simo/core/__pycache__/middleware.cpython-38.pyc,sha256=UZTX3tUUHkigr_3GiSLbUX3RbJBg1_JBPiXy6saJ9GA,1911
69
- simo/core/__pycache__/models.cpython-38.pyc,sha256=rKg-_vQ-3L3_NKbCd0HIij7Nyev1t7SOz32-6PS4Rds,17907
69
+ simo/core/__pycache__/models.cpython-38.pyc,sha256=nAgEN2wfcQkeWtRDwN_u-3mOn09irA2hFX23ziFJwIw,17911
70
70
  simo/core/__pycache__/permissions.cpython-38.pyc,sha256=fH4iyqd9DdzRLEu2b621-FeM-napR0M7hzBUTHo9Q3g,2972
71
71
  simo/core/__pycache__/routing.cpython-38.pyc,sha256=3T3FPJ8Cn99xZCGvMyg2xjl7al-Shm9CelbSpkJtNP8,599
72
- simo/core/__pycache__/serializers.cpython-38.pyc,sha256=g2xW2Epw2ne2qUS41Dsrvr9Ih56v5Ba0VfmetJJRlXk,19495
72
+ simo/core/__pycache__/serializers.cpython-38.pyc,sha256=PzKJTctrfXeTtD1QlRL5vKKIW4YxB5MuEPj_Z2w9Wgc,19495
73
73
  simo/core/__pycache__/signal_receivers.cpython-38.pyc,sha256=3Bt9S47DR_ZFS3O-crElFgLLXPIYyDgPIc2ibwEkaic,4904
74
74
  simo/core/__pycache__/socket_consumers.cpython-38.pyc,sha256=NJUr7nRyHFvmAumxxWpsod5wzVVZM99rCEuJs1utHA4,8432
75
75
  simo/core/__pycache__/storage.cpython-38.pyc,sha256=9R1Xu0FJDflfRXUPsqEgt0SpwiP7FGk7HaR8s8XRyI8,721
@@ -10191,7 +10191,7 @@ simo/fleet/api.py,sha256=Hxn84xI-Q77HxjINgRbjSJQOv9jii4OL20LxK0VSrS8,2499
10191
10191
  simo/fleet/auto_urls.py,sha256=UX66eR2ykMqFgfIllW-RTdjup5-FieCWl_BVm3CcXKg,702
10192
10192
  simo/fleet/base_types.py,sha256=wL9RVkHr0gA7HI1wZq0pruGEIgvQqpfnCL4cC3ywsvw,102
10193
10193
  simo/fleet/ble.py,sha256=eHA_9ABjbmH1vUVCv9hiPXQL2GZZSEVwfO0xyI1S0nI,1081
10194
- simo/fleet/controllers.py,sha256=9IJnT6ATuKsfIAh7oTJgSZCY2c9HVIOBLqd0CQ3mjC4,29790
10194
+ simo/fleet/controllers.py,sha256=NOoM7XmMIJfqw92JE5PI6sQo-Vlzb67YDMtebUW7T9k,30507
10195
10195
  simo/fleet/forms.py,sha256=YF34ZCDbLeAKpq4u0KTi8IsyqhDtNUWcal2DELRayuI,57668
10196
10196
  simo/fleet/gateways.py,sha256=lKEJW0MgaOEiNnijH50DNSVChvaUT3TA3UurcI57P8k,5677
10197
10197
  simo/fleet/managers.py,sha256=XOpDOA9L-f_550TNSyXnJbun2EmtGz1TenVTMlUSb8E,807
@@ -10208,8 +10208,8 @@ simo/fleet/__pycache__/api.cpython-38.pyc,sha256=rL9fb7cCQatyFvXyKmlNOKmxVo8vHYe
10208
10208
  simo/fleet/__pycache__/auto_urls.cpython-38.pyc,sha256=Tc6a6BCXHjijP8U2jE2ghlJwnSNrGm59-hW5t-80wF0,689
10209
10209
  simo/fleet/__pycache__/base_types.cpython-38.pyc,sha256=deyPwjpT6xZiFxBGFnj5b7R-lbdOTh2krgpJhrcGVhc,274
10210
10210
  simo/fleet/__pycache__/ble.cpython-38.pyc,sha256=Nrof9w7cm4OlpFWHeVnmvvanh2_oF9oQ3TknJiV93-0,1267
10211
- simo/fleet/__pycache__/controllers.cpython-38.pyc,sha256=PXWcEzGvEVtaKfQah35liipySnaGpswwyDG_MKm5phU,24860
10212
- simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=8Pl_cztv5iYmIySOFqiCk3NnVAvIu7os0-r5OjI05iA,39066
10211
+ simo/fleet/__pycache__/controllers.cpython-38.pyc,sha256=Pot0NMkAvOR6YEX0UYVApcGlLzLQWS-zWSa7byDL8Zc,25373
10212
+ simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=LOxl1jynQbd_36Qa8eyTRkHLXiA575Ph29XVqGX0qsU,39066
10213
10213
  simo/fleet/__pycache__/gateways.cpython-38.pyc,sha256=0RKVn0ndreVKhsrukqeLPSdMnRrsQ_W7yeVeBkRLfIk,5058
10214
10214
  simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=8uz-xpUiqbGDgXIZ_XRZtFb-Tju6NGxflGg-Ee4Yo6k,1310
10215
10215
  simo/fleet/__pycache__/models.cpython-38.pyc,sha256=GZ01BjdvTn6_XJBfV8VrSldJ67X06ne-xW4CsQ6N6Wc,13756
@@ -10352,10 +10352,11 @@ simo/management/__pycache__/on_http_start.cpython-38.pyc,sha256=ERfcMNz3QnqDJTJ4
10352
10352
  simo/management/_hub_template/hub/asgi.py,sha256=ElN_fdeSkf0Ysa7pS9rJVmZ1HmLhFxb8jFaMLqe1220,126
10353
10353
  simo/management/_hub_template/hub/celeryc.py,sha256=3ksDXftIZKJ4Cq9WNKJERdZdQlDEnjTQXycweRFmsSQ,27
10354
10354
  simo/management/_hub_template/hub/manage.py,sha256=PNNlw3EVeIJDgkG0l-klqoxsKWfTYWG9jzRG0upmAaI,620
10355
- simo/management/_hub_template/hub/nginx.conf,sha256=wAV7wWgZc9JqhLI94i-j1olhLwMi8SCvE8NiyTEDwJI,2002
10355
+ simo/management/_hub_template/hub/nginx.conf,sha256=40hvXL42MeiqqkLURNcDQsRudv1dNFLJnvb2-Y3RCkk,2394
10356
10356
  simo/management/_hub_template/hub/settings.py,sha256=4QhvhbtLRxHvAntwqG_qeAAtpDUqKvN4jzw9u3vqff8,361
10357
- simo/management/_hub_template/hub/supervisor.conf,sha256=IY3fdK0fDD2eAothB0n54xhjQj8LYoXIR96-Adda5Z8,1353
10357
+ simo/management/_hub_template/hub/supervisor.conf,sha256=DpLGDoyTRs27tVN-vg5ANpUnDUC68cFdlBsAp-XEm78,1815
10358
10358
  simo/management/_hub_template/hub/urls.py,sha256=Ydm-1BkYAzWeEF-MKSDIFf-7aE4qNLPm48-SA51XgJQ,25
10359
+ simo/management/_hub_template/hub/wsgi.py,sha256=Lo-huLHnMDTxSmMBOodVFMWBls9poddrV2KRzXU0xGo,280
10359
10360
  simo/multimedia/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10360
10361
  simo/multimedia/admin.py,sha256=GgXiKTLfi3omjBurU-bKgneJRK-tAeiR8o2jo3zD7zs,1002
10361
10362
  simo/multimedia/api.py,sha256=mZ5BTggWdc_kL8P70JGC3rTCiZKPnxWYoyNcAQkFnX4,285
@@ -10506,9 +10507,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
10506
10507
  simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10507
10508
  simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10508
10509
  simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10509
- simo-2.2.9.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10510
- simo-2.2.9.dist-info/METADATA,sha256=1UFNm0bYqKsBbPc6SjdYGFfT3BTrNxcRt3GVKW6ZluU,1847
10511
- simo-2.2.9.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
10512
- simo-2.2.9.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10513
- simo-2.2.9.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10514
- simo-2.2.9.dist-info/RECORD,,
10510
+ simo-2.2.10.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10511
+ simo-2.2.10.dist-info/METADATA,sha256=EEKuyC6CQhzBgYsGV0L6R-28zL45JxZuLNnulJrs5wU,1881
10512
+ simo-2.2.10.dist-info/WHEEL,sha256=5Mi1sN9lKoFv_gxcPtisEVrJZihrm_beibeg5R6xb4I,91
10513
+ simo-2.2.10.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10514
+ simo-2.2.10.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10515
+ simo-2.2.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5