simo 2.2.2__py3-none-any.whl → 2.2.3__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.
Binary file
simo/core/forms.py CHANGED
@@ -23,7 +23,7 @@ class HiddenField(forms.CharField):
23
23
  Hidden field used in API
24
24
  '''
25
25
  def __init__(self, *args, **kwargs):
26
- super().__init__(widget=forms.HiddenInput())
26
+ super().__init__(widget=forms.HiddenInput(), *args, **kwargs)
27
27
 
28
28
 
29
29
  class AdminAuthenticationForm(OrgAdminAuthenticationForm):
simo/core/middleware.py CHANGED
@@ -65,9 +65,8 @@ def instance_middleware(get_response):
65
65
 
66
66
  if not instance:
67
67
  if request.user.is_authenticated:
68
- if len(request.user.instances) == 1:
69
- for inst in request.user.instances:
70
- instance = inst
68
+ if request.user.instances:
69
+ instance = request.user.instances[0]
71
70
 
72
71
  if instance:
73
72
  introduce_instance(instance, request)
@@ -793,8 +793,6 @@ class Watering(ControllerBase):
793
793
  'ai_assist': True, 'soil_type': 'loamy', 'ai_assist_level': 50,
794
794
  'schedule': config_to_dict(self._get_default_schedule()),
795
795
  'estimated_moisture': 50,
796
- 'last_run': None,
797
- 'next_run': None,
798
796
  }
799
797
 
800
798
 
@@ -836,7 +834,7 @@ class Watering(ControllerBase):
836
834
  def start(self):
837
835
  self.component.refresh_from_db()
838
836
  if not self.component.value.get('program_progress', 0):
839
- self.component.config['last_run'] = timezone.now().timestamp()
837
+ self.component.meta['last_run'] = timezone.now().timestamp()
840
838
  self.component.save()
841
839
  self.set(
842
840
  {'status': 'running_program',
simo/generic/forms.py CHANGED
@@ -333,18 +333,20 @@ class AlarmBreachEventForm(forms.Form):
333
333
  if not self.cleaned_data.get('breach_action'):
334
334
  return self.cleaned_data
335
335
  component = self.cleaned_data.get('component')
336
- if not hasattr(component, self.cleaned_data['breach_action']):
336
+ if not getattr(component, self.cleaned_data['breach_action'], None):
337
337
  self.add_error(
338
338
  'breach_action',
339
339
  f"{component} has no {self.cleaned_data['breach_action']} action!"
340
340
  )
341
341
  if self.cleaned_data.get('disarm_action'):
342
- if not hasattr(component, self.cleaned_data['disarm_action']):
342
+ if not getattr(component, self.cleaned_data['disarm_action'], None):
343
343
  self.add_error(
344
344
  'disarm_action',
345
345
  f"{component} has no "
346
346
  f"{self.cleaned_data['disarm_action']} action!"
347
347
  )
348
+ if not self.cleaned_data.get('uid'):
349
+ self.cleaned_data['uid'] = get_random_string(6)
348
350
  return self.cleaned_data
349
351
 
350
352
 
@@ -434,14 +436,6 @@ class AlarmGroupConfigForm(BaseComponentForm):
434
436
  self.fields['is_main'].widget.attrs['disabled'] = 'disabled'
435
437
 
436
438
 
437
- def clean_breach_events(self):
438
- events = self.cleaned_data['breach_events']
439
- for i, cont in enumerate(events):
440
- if not cont.get('uid'):
441
- cont['uid'] = get_random_string(6)
442
- return events
443
-
444
-
445
439
  def recurse_check_alarm_groups(self, components, start_comp=None):
446
440
  for comp in components:
447
441
  check_cmp = start_comp if start_comp else comp
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.2.2
3
+ Version: 2.2.3
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
@@ -28,11 +28,11 @@ 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=QTPEe7nxzhg8NNCQFsVJpoO1LQW6MNNTHkEhBs7keYw,21386
31
+ simo/core/forms.py,sha256=kg_zAmEXy3lgvktOKSrIGAuWWeh5utoA8qo9varrd7c,21403
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
- simo/core/middleware.py,sha256=Go4DAdnXWd7i0ZEbftwfcZI5YGjZ31aQqDzWE4s676c,1970
35
+ simo/core/middleware.py,sha256=iIwwiQ8cPqqY2timKnd7aJzhi0nQPeIbkJHyM1dR9Ok,1921
36
36
  simo/core/models.py,sha256=Mg6UjGQjA5WtxO2kq9fO-iW2f9UzDh58etcZ9-X5RSU,21570
37
37
  simo/core/permissions.py,sha256=D8JA3gdsbSfA1Lz6-AIP5ILsYYZ59_Rw4csLqVpuKuE,2928
38
38
  simo/core/routing.py,sha256=X1_IHxyA-_Q7hw1udDoviVP4_FSBDl8GYETTC2zWTbY,499
@@ -56,16 +56,16 @@ simo/core/__pycache__/auto_urls.cpython-38.pyc,sha256=Tyf8PYHq5YqSwTp25Joy-eura_
56
56
  simo/core/__pycache__/autocomplete_views.cpython-38.pyc,sha256=hJ6JILI1LqrAtpQMvxnLvljGdW1v1gpvBsD79vFkZ58,3972
57
57
  simo/core/__pycache__/base_types.cpython-38.pyc,sha256=hmq22vvGyCmhbYyuV6bFAOOSIupspgW5yq_VzqWd-vY,759
58
58
  simo/core/__pycache__/context.cpython-38.pyc,sha256=MSZPDhqMhCpUuBJl3HCIBHZA3BntYeP8RAnQcdqAH9k,1278
59
- simo/core/__pycache__/controllers.cpython-38.pyc,sha256=hqSv7xLR6qhK-d7Ymu17aVeHfVqPkLR9IiTs646vV5E,26574
59
+ simo/core/__pycache__/controllers.cpython-38.pyc,sha256=oGbgeiG7Jf_2YJ1819u2DRMISYsNoo3X2tY8mzorx3M,26563
60
60
  simo/core/__pycache__/dynamic_settings.cpython-38.pyc,sha256=9ge2uV4QBKdA4f2pIZp4EIGB9vY2z4IUb-UMc4ZY0I4,2384
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=gDYKULuBTMLxrKfzWXaLDbxuCJvhi2rwR5rIMC_IIVI,17672
64
+ simo/core/__pycache__/forms.cpython-38.pyc,sha256=euZTfdn_eWdBWok_cx6CnK_uC8Y46NsdOwkRMpXiVGE,17678
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
- simo/core/__pycache__/middleware.cpython-38.pyc,sha256=94jRByEYOhsIuiMgPq_oHrRKrvD8rgQw8plS0n1Mrz8,1933
68
+ simo/core/__pycache__/middleware.cpython-38.pyc,sha256=h1aW1QlojpVM2NulRbsd3JiF-fV4euysv4e2MvcfsPc,1901
69
69
  simo/core/__pycache__/models.cpython-38.pyc,sha256=rKg-_vQ-3L3_NKbCd0HIij7Nyev1t7SOz32-6PS4Rds,17907
70
70
  simo/core/__pycache__/permissions.cpython-38.pyc,sha256=pg11ulzmKh4IeWGPIDJ-KYG-S0dKyY5lHh-S3iljb0E,2930
71
71
  simo/core/__pycache__/routing.cpython-38.pyc,sha256=3T3FPJ8Cn99xZCGvMyg2xjl7al-Shm9CelbSpkJtNP8,599
@@ -10174,7 +10174,7 @@ simo/core/utils/__pycache__/config_values.cpython-38.pyc,sha256=fqTVDhkjaWFv14Pr
10174
10174
  simo/core/utils/__pycache__/easing.cpython-38.pyc,sha256=LupxHv19OiBqL0VXmTbMCtAOpgvBpq_b0XwLU8El-Jk,2137
10175
10175
  simo/core/utils/__pycache__/form_fields.cpython-38.pyc,sha256=nBk6k9aj6BpWwdkpceIXdl5NU0fB6NPFhSBPaA-VtPs,1252
10176
10176
  simo/core/utils/__pycache__/form_widgets.cpython-38.pyc,sha256=MYAYEq0I4P0WErG9FamTJYWue7-cPartAWbFAiSSg5w,908
10177
- simo/core/utils/__pycache__/formsets.cpython-38.pyc,sha256=S0ekEmo_ar_g9Jx8U1xYpYj8a133lM3jNdTcVFjf1_U,4946
10177
+ simo/core/utils/__pycache__/formsets.cpython-38.pyc,sha256=b0BuoiXFQwNgok0OWuMma8pwTC6s9c-s9yuet_YLlZk,4946
10178
10178
  simo/core/utils/__pycache__/helpers.cpython-38.pyc,sha256=jTGaN7kSJRwouP0EuYSaiJeMylo_RzJwSm-DKRwceHA,4291
10179
10179
  simo/core/utils/__pycache__/json.cpython-38.pyc,sha256=TKc88VpPKgimeaozhgx34WWJ1mwTWFWN6B9-VAH8qT0,532
10180
10180
  simo/core/utils/__pycache__/logs.cpython-38.pyc,sha256=BVVeQoOhfRHm3SHnCoE1d5G84kTpJZFmr_btc3jDYTU,2156
@@ -10300,8 +10300,8 @@ simo/fleet/templates/fleet/controllers_info/ENS160AirQualitySensor.md,sha256=3LS
10300
10300
  simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10301
10301
  simo/generic/app_widgets.py,sha256=E_pnpA1hxMIhenRCrHoQ5cik06jm2BAHCkl_eo-OudU,1264
10302
10302
  simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,409
10303
- simo/generic/controllers.py,sha256=lnojSqDQ-1FArF2wH_c11y0qd906Wog-qrSG1DoqeXc,58284
10304
- simo/generic/forms.py,sha256=IAfDtmEk1-CP0JBoetOD_ahLm64nK41GOUXjmbUzNtY,29550
10303
+ simo/generic/controllers.py,sha256=x7BQfz9wVP-QAplv_bmolOk3cmPaUKJZihvhx2CRxJs,58222
10304
+ simo/generic/forms.py,sha256=VzJJjZEuvpDEa2uObw9SkPmzQ4J_LkJ6UCNCoQImm0g,29427
10305
10305
  simo/generic/gateways.py,sha256=cc_q_g2HsI2_rWmr8yZ3spnMPwsgoYS5ApWRimc11wU,18831
10306
10306
  simo/generic/models.py,sha256=flpK2jsBFghrvRHzl6IKT-t3WZ-hNOj4ZP2vmBzx0K8,7657
10307
10307
  simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
@@ -10309,8 +10309,8 @@ simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5
10309
10309
  simo/generic/__pycache__/__init__.cpython-38.pyc,sha256=mLu54WS9KIl-pHwVCBKpsDFIlOqml--JsOVzAUHg6cU,161
10310
10310
  simo/generic/__pycache__/app_widgets.cpython-38.pyc,sha256=0IoKRG9n1tkNRRkrqAeOQwWBPd_33u98JBcVtMVVCio,2374
10311
10311
  simo/generic/__pycache__/base_types.cpython-38.pyc,sha256=ptw6axyAqemZA35oa6vzr7EihzvbhW9w7Y-G6kfDedU,555
10312
- simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=9ZnI6Z084og6Q-9fmhT-PZEM5w_yOC1rwMAHHA6af_Q,36460
10313
- simo/generic/__pycache__/forms.cpython-38.pyc,sha256=v85YEQR9l0QyUgYW_uTKr5qFCjp8TYOAAnfYQvYActI,21227
10312
+ simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=ysLkKnwyh5vrhF8s7CPaz0me7HsMO4uz6vTd3SxAFig,36447
10313
+ simo/generic/__pycache__/forms.cpython-38.pyc,sha256=g-KKlxmRVWVN_mVOoXsuIGTNaVgs76BisphknIyD8vI,21071
10314
10314
  simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=8NbsLVDww3Ov5DKF--LKgyrgnrn8yVcKrY21cdvV5aA,13979
10315
10315
  simo/generic/__pycache__/models.cpython-38.pyc,sha256=n3FeTMJYh4B6nCPiPKeXiWsUOOWkLHca7qTvfTK6Iik,5844
10316
10316
  simo/generic/__pycache__/routing.cpython-38.pyc,sha256=xtxTUTBTdivzFyA5Wh7k-hUj1WDO_FiRq6HYXdbr9Ks,382
@@ -10505,9 +10505,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
10505
10505
  simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10506
10506
  simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10507
10507
  simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10508
- simo-2.2.2.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10509
- simo-2.2.2.dist-info/METADATA,sha256=Ru0FCahOkylESH_ERFdMhvY_J5YwYXMmIBsjAZvsdKY,1847
10510
- simo-2.2.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
10511
- simo-2.2.2.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10512
- simo-2.2.2.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10513
- simo-2.2.2.dist-info/RECORD,,
10508
+ simo-2.2.3.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10509
+ simo-2.2.3.dist-info/METADATA,sha256=BRSjaHYWMayEzqka-dRfmz589HhLBL-LEmrbGEXXkbk,1847
10510
+ simo-2.2.3.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
10511
+ simo-2.2.3.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10512
+ simo-2.2.3.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10513
+ simo-2.2.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.1.0)
2
+ Generator: setuptools (74.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5