simo 2.1.12__py3-none-any.whl → 2.1.13__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/generic/models.py CHANGED
@@ -125,12 +125,8 @@ def bind_controlling_locks_to_alarm_groups(sender, instance, *args, **kwargs):
125
125
  base_type=AlarmGroup.base_type,
126
126
  config__arming_locks__contains=instance.id
127
127
  ):
128
- if ag.config.get('arm_on_away') in (None, 'on_away'):
129
- for ag in Component.objects.filter(
130
- base_type=AlarmGroup.base_type,
131
- config__arming_locks__contains=instance.id
132
- ):
133
- ag.arm()
128
+ if ag.config.get('arm_on_away') in (None, '', 'on_away'):
129
+ ag.controller.arm()
134
130
  continue
135
131
 
136
132
  users_at_home = InstanceUser.objects.filter(
@@ -140,7 +136,7 @@ def bind_controlling_locks_to_alarm_groups(sender, instance, *args, **kwargs):
140
136
  continue
141
137
  if ag.config.get('arm_on_away') == 'on_away_and_locked':
142
138
  print(f"Nobody is at home, lock was locked. Arm {ag}!")
143
- ag.arm()
139
+ ag.controller.arm()
144
140
  continue
145
141
  locked_states = [
146
142
  True if l['value'] == 'locked' else False
@@ -150,14 +146,14 @@ def bind_controlling_locks_to_alarm_groups(sender, instance, *args, **kwargs):
150
146
  ]
151
147
  if all(locked_states):
152
148
  print(f"Nobody is at home, all locks are now locked. Arm {ag}!")
153
- ag.arm()
149
+ ag.controller.arm()
154
150
 
155
151
  elif instance.value == 'unlocked':
156
152
  for ag in Component.objects.filter(
157
153
  base_type=AlarmGroup.base_type,
158
154
  config__arming_locks__contains=instance.id
159
155
  ):
160
- ag.disarm()
156
+ ag.controller.disarm()
161
157
 
162
158
 
163
159
  @receiver(post_save, sender=InstanceUser)
@@ -189,10 +185,10 @@ def bind_alarm_groups(sender, instance, created, *args, **kwargs):
189
185
  continue
190
186
  if ag.config['arm_on_away'] == 'on_away_and_locked':
191
187
  print(f"Everybody is away, single lock is locked, arm {ag}!")
192
- ag.arm()
188
+ ag.controller.arm()
193
189
  continue
194
190
  if ag.config['arm_on_away'] == 'on_away_and_locked_all' \
195
191
  and all(locked_states):
196
192
  print(f"Everybody is away, all locks are locked, arm {ag}!")
197
- ag.arm()
193
+ ag.controller.arm()
198
194
  continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.1.12
3
+ Version: 2.1.13
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
@@ -10302,7 +10302,7 @@ simo/generic/base_types.py,sha256=djymox_boXTHX1BTTCLXrCH7ED-uAsV_idhaDOc3OLI,40
10302
10302
  simo/generic/controllers.py,sha256=gojeCP_vSyLTaP4h56LqqLDykny5lEG-nLclieyVrRg,58292
10303
10303
  simo/generic/forms.py,sha256=IAfDtmEk1-CP0JBoetOD_ahLm64nK41GOUXjmbUzNtY,29550
10304
10304
  simo/generic/gateways.py,sha256=cc_q_g2HsI2_rWmr8yZ3spnMPwsgoYS5ApWRimc11wU,18831
10305
- simo/generic/models.py,sha256=jKlNOzpGrjIZt7zL5tKM4AzcD6cAQgqF2AwsIb7anVo,7607
10305
+ simo/generic/models.py,sha256=sa8mFL5i5THMhu9QOTNzBq_KvoChlTyckqO9i1UYw3U,7487
10306
10306
  simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
10307
10307
  simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
10308
10308
  simo/generic/__pycache__/__init__.cpython-38.pyc,sha256=mLu54WS9KIl-pHwVCBKpsDFIlOqml--JsOVzAUHg6cU,161
@@ -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.12.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10506
- simo-2.1.12.dist-info/METADATA,sha256=9gW_akGr2kphJi5Aj9G3FQJfEtSPVIykU8ugLkZrAXE,1848
10507
- simo-2.1.12.dist-info/WHEEL,sha256=-oYQCr74JF3a37z2nRlQays_SX2MqOANoqVjBBAP2yE,91
10508
- simo-2.1.12.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10509
- simo-2.1.12.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10510
- simo-2.1.12.dist-info/RECORD,,
10505
+ simo-2.1.13.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10506
+ simo-2.1.13.dist-info/METADATA,sha256=6OF1UCBLP9AUuLxWH3mUP6FeMEDmOee9WnDow0o-zdY,1848
10507
+ simo-2.1.13.dist-info/WHEEL,sha256=-oYQCr74JF3a37z2nRlQays_SX2MqOANoqVjBBAP2yE,91
10508
+ simo-2.1.13.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10509
+ simo-2.1.13.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10510
+ simo-2.1.13.dist-info/RECORD,,
File without changes