simo 2.1.9__py3-none-any.whl → 2.1.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.

simo/core/api.py CHANGED
@@ -205,6 +205,9 @@ class ComponentViewSet(
205
205
  for method_name, param in json_data.items():
206
206
  if method_name in ('id', 'secret'):
207
207
  continue
208
+
209
+ component.prepare_controller()
210
+
208
211
  if not hasattr(component, method_name):
209
212
  raise APIValidationError(
210
213
  _('"%s" method not found on controller') % method_name,
@@ -291,8 +294,6 @@ class ComponentViewSet(
291
294
  return RESTResponse(resp_data)
292
295
 
293
296
 
294
-
295
-
296
297
  class HistoryResultsSetPagination(PageNumberPagination):
297
298
  page_size = 50
298
299
  page_size_query_param = 'page_size'
simo/core/models.py CHANGED
@@ -530,17 +530,32 @@ def is_in_alarm(self):
530
530
  return obj
531
531
 
532
532
  def arm(self):
533
+ # supports this method override in controller class
534
+ if not self._controller_initiated:
535
+ self._controller_initiated = True
536
+ self.prepare_controller()
537
+ return self.arm()
533
538
  self.refresh_from_db()
534
539
  if self.alarm_category:
535
540
  self.arm_status = 'pending-arm'
536
541
  self.save()
537
542
 
538
543
  def disarm(self):
544
+ # supports this method override in controller class
545
+ if not self._controller_initiated:
546
+ self._controller_initiated = True
547
+ self.prepare_controller()
548
+ return self.disarm()
539
549
  self.refresh_from_db()
540
550
  self.arm_status = 'disarmed'
541
551
  self.save()
542
552
 
543
553
  def is_in_alarm(self):
554
+ # supports this method override in controller class
555
+ if not self._controller_initiated:
556
+ self._controller_initiated = True
557
+ self.prepare_controller()
558
+ return self.is_in_alarm()
544
559
  return bool(self.value)
545
560
 
546
561
  def can_read(self, user):
@@ -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.ge('angle', 0)
720
+ value['angle'] = self.component.value.get('angle', 0)
721
721
 
722
722
  elif occasion == BEFORE_SET:
723
723
  if not isinstance(value, dict):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.1.9
3
+ Version: 2.1.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
@@ -14,7 +14,7 @@ simo/__pycache__/urls.cpython-38.pyc,sha256=sqfstQthcjXtv31Tad0RAlWWI2A0HH6HN0fW
14
14
  simo/__pycache__/wsgi.cpython-38.pyc,sha256=TpRxO7VM_ql31hbKphVdanydC5RI1nHB4l0QA2pdWxo,322
15
15
  simo/core/__init__.py,sha256=_s2TjJfQImsMrTIxqLAx9AZie1Ojmm6sCHASdl3WLGU,50
16
16
  simo/core/admin.py,sha256=Gb1lSyvFtYj2oC5lA7j3VqU6zlqlncx5R-_XJbb8Wdk,17927
17
- simo/core/api.py,sha256=_f0J9wmuB1ydN5qxZ487u-pKz4XiuENlTIhHfzBXvUY,27856
17
+ simo/core/api.py,sha256=SNBhrN60ig64VNZS-gOhHr7bT9uq9dba3ozKrgsbaEs,27899
18
18
  simo/core/api_auth.py,sha256=vCxvczA8aWNcW0VyKs5WlC_ytlqeGP_H_hkKUNVkCwM,1247
19
19
  simo/core/api_meta.py,sha256=EaiY-dCADP__9MvLpoHvhjytFT92IrxPZDv95xgqasU,4955
20
20
  simo/core/app_widgets.py,sha256=4Lh9FDzdkfh_mccJMe09dyRTT3Uqf9VXwbkurJ9E9oQ,2115
@@ -33,7 +33,7 @@ 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=sCo9R7ctGepYK-uspl7cR-KFBrJxSy3TZkbWbOP0YHs,2914
35
35
  simo/core/middleware.py,sha256=pO52hQOJV_JRmNyUe7zfufSnJFlRITOWX6jwkoPWJhk,2052
36
- simo/core/models.py,sha256=y5IG6hcVen6tDjzPJM8GxVeuop3XsVZElLqgoAiLVDE,20908
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
39
39
  simo/core/serializers.py,sha256=K13SDW-FIcNiRYmJufSDS2EkRAW3cuoiHRByof2DYXQ,20629
@@ -10299,7 +10299,7 @@ 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=bOlkkyjWmK3Pm5XEpQKKx7_MLPHv62aC4LyY2JT3EZs,58251
10302
+ simo/generic/controllers.py,sha256=YLkekwDFDJPAJKTC0w8As2B5ctzfvlLuRf0YLSi_vv4,58252
10303
10303
  simo/generic/forms.py,sha256=IAfDtmEk1-CP0JBoetOD_ahLm64nK41GOUXjmbUzNtY,29550
10304
10304
  simo/generic/gateways.py,sha256=cc_q_g2HsI2_rWmr8yZ3spnMPwsgoYS5ApWRimc11wU,18831
10305
10305
  simo/generic/models.py,sha256=92TACMhJHadAg0TT9GnARO_R3_Sl6i-GGjhG_x7YdFI,7391
@@ -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.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,,
10505
+ simo-2.1.10.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10506
+ simo-2.1.10.dist-info/METADATA,sha256=cEdSVJo82lzIaZ7seRKzsmZTw3AO9mqBzT8qHcIy55o,1848
10507
+ simo-2.1.10.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
10508
+ simo-2.1.10.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10509
+ simo-2.1.10.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10510
+ simo-2.1.10.dist-info/RECORD,,
File without changes