simo 2.7.16__py3-none-any.whl → 2.7.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.

@@ -1177,14 +1177,11 @@ class MainState(StateSelect):
1177
1177
  return False
1178
1178
 
1179
1179
 
1180
- def owner_phones_on_sleep(self, all_phones=False):
1180
+ def owner_phones_on_charge(self, all_phones=False):
1181
1181
  sleeping_phones_hour = self.component.config.get('sleeping_phones_hour')
1182
1182
  if sleeping_phones_hour is None:
1183
1183
  return False
1184
1184
 
1185
- if not self.is_sleep_time():
1186
- return False
1187
-
1188
1185
  from simo.users.models import InstanceUser
1189
1186
 
1190
1187
  phones_on_charge = []
@@ -1198,7 +1195,7 @@ class MainState(StateSelect):
1198
1195
  phones_on_charge.append(iuser.phone_on_charge)
1199
1196
 
1200
1197
 
1201
- if all:
1198
+ if all_phones:
1202
1199
  return all(phones_on_charge)
1203
1200
  else:
1204
1201
  return any(phones_on_charge)
simo/generic/forms.py CHANGED
@@ -491,7 +491,7 @@ class MainStateSelectForm(BaseComponentForm):
491
491
  "No value disables this behavior."
492
492
  )
493
493
  sleeping_phones_hour = forms.IntegerField(
494
- initial=True, required=False, min_value=18, max_value=24,
494
+ initial=22, required=False, min_value=18, max_value=24,
495
495
  help_text='Set mode to "Sleep" if it is later than given hour '
496
496
  'and all home owners phones who are at home are put on charge '
497
497
  '(requires location and fitness permissions on mobile app). <br>'
simo/generic/gateways.py CHANGED
@@ -421,11 +421,12 @@ class GenericGatewayHandler(
421
421
 
422
422
  if state.config.get('sleeping_phones_hour') is not None:
423
423
  if state.value != 'sleep':
424
- if state.owner_phones_on_sleep(True):
424
+ if state.is_sleep_time() and state.owner_phones_on_charge(True):
425
425
  print(f"New main state of {state.zone.instance} - sleep")
426
426
  state.send('sleep')
427
427
  else:
428
- if not state.owner_phones_on_sleep(False):
428
+ if not state.owner_phones_on_charge(True) \
429
+ and not state.is_sleep_time():
429
430
  try:
430
431
  new_state = state.get_day_evening_night_morning()
431
432
  except:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.7.16
3
+ Version: 2.7.17
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
@@ -10591,9 +10591,9 @@ simo/fleet/templates/fleet/controllers_info/ENS160AirQualitySensor.md,sha256=3LS
10591
10591
  simo/generic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10592
10592
  simo/generic/app_widgets.py,sha256=y8W3jR76Hh26O9pPQyg2SophMbYIOtAWD33MPKbB8Mg,856
10593
10593
  simo/generic/base_types.py,sha256=u3SlfpNYaCwkVBwomWgso4ODzL71ay9MhiAW-bxgnDU,341
10594
- simo/generic/controllers.py,sha256=HDhf-bC6WATWzHFFEndap4z213n0LgtBhVG1lfMxzMU,46597
10595
- simo/generic/forms.py,sha256=N9Jv4-e2IroSAeXXrpdpThQnH2sw5ADh08nFtdOK9Ds,26035
10596
- simo/generic/gateways.py,sha256=bq01qX2Q62B47yHmTKdCfQE8tcwmI70jvJko-pIyQag,17534
10594
+ simo/generic/controllers.py,sha256=C3bwn7kSpOz0Gs0fL5VQFYi8pL8VV57mo-9PfLTBBQA,46542
10595
+ simo/generic/forms.py,sha256=ynf-u9RE-VU0xQgCYovUVEZO3ZJ_pCsem91KSeQdHbs,26033
10596
+ simo/generic/gateways.py,sha256=6mu6bSjn-UmeiFLWpskyCGO8MR8KpesruHspEUeOvDo,17609
10597
10597
  simo/generic/models.py,sha256=Adq7ipWK-renxJlNW-SZnAq2oGEOwKx8EdUWaKnfcVQ,7597
10598
10598
  simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
10599
10599
  simo/generic/socket_consumers.py,sha256=pyiqzfGxSKBNqfrfEJ_kCU0UbSC28XnvDn6QjKkbqyY,1767
@@ -10603,11 +10603,11 @@ simo/generic/__pycache__/app_widgets.cpython-312.pyc,sha256=ywoKk91YSEZxpyt9haG5
10603
10603
  simo/generic/__pycache__/app_widgets.cpython-38.pyc,sha256=D9b13pbMlirgHmjDnQhfLIDGSVINoSouHb4SWOeCRrs,1642
10604
10604
  simo/generic/__pycache__/base_types.cpython-312.pyc,sha256=h8Mwu49i-zmwTbL33JaLJfRDGOgkQh2_VqrfzEc4UQ4,616
10605
10605
  simo/generic/__pycache__/base_types.cpython-38.pyc,sha256=aV5NdIuvXR-ItKpI__MwcyPZHD6Z882TFdgYkPCkr1I,493
10606
- simo/generic/__pycache__/controllers.cpython-312.pyc,sha256=g5fjTUYYNFGR7Sv-hoES7Vfofc7bxMk0Ef6nGNhvgNM,53145
10606
+ simo/generic/__pycache__/controllers.cpython-312.pyc,sha256=Ti6xqlOVIA_DYAo4HS72j-2g20xuvAaiEsZl4eIEPfs,53085
10607
10607
  simo/generic/__pycache__/controllers.cpython-38.pyc,sha256=jJjwKVaDYyazrRGNjUFoY74nr_jX_DEnsC9KjyxZCgc,30427
10608
- simo/generic/__pycache__/forms.cpython-312.pyc,sha256=NtOAjTxXh0vaYNdUY9PVJy1Q9Bm_HiFX6oXxW5yQ62Y,34676
10608
+ simo/generic/__pycache__/forms.cpython-312.pyc,sha256=naGe-9nY5GFqM_bNpg52acV8s5j9PFILS7l0UTuWbQQ,34681
10609
10609
  simo/generic/__pycache__/forms.cpython-38.pyc,sha256=k8lz3taXdWAg5P9jcnw66mWH51pCc4SOsg32kVEtBCg,19416
10610
- simo/generic/__pycache__/gateways.cpython-312.pyc,sha256=bq-k85HBSfg_EHtDFQmo1BMBDjgPqP0lfw5BEnP1vB4,21672
10610
+ simo/generic/__pycache__/gateways.cpython-312.pyc,sha256=o2Ijs-IXKmytSXRkVs-MChscxuGv97_if13tN2piwY4,21787
10611
10611
  simo/generic/__pycache__/gateways.cpython-38.pyc,sha256=GIeMT51oZU2OCFD4eUDFdSRRYE0Qf14AcOr_gdUqG94,12705
10612
10612
  simo/generic/__pycache__/models.cpython-312.pyc,sha256=xriUzjkaM2Y4mT3jo2OPK-XGBroBBSFJfLqK0jMA4MA,10200
10613
10613
  simo/generic/__pycache__/models.cpython-38.pyc,sha256=MZpum7syAFxuulf47K7gtUlJJ7xRD-IBUBAwUM1ZRnw,5825
@@ -10924,9 +10924,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
10924
10924
  simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10925
10925
  simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10926
10926
  simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10927
- simo-2.7.16.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10928
- simo-2.7.16.dist-info/METADATA,sha256=uuLTNmwN-BR8ZrQ9eBFoXWOf1Roj8fqHPUdwJNlA-5k,2009
10929
- simo-2.7.16.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
10930
- simo-2.7.16.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10931
- simo-2.7.16.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10932
- simo-2.7.16.dist-info/RECORD,,
10927
+ simo-2.7.17.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10928
+ simo-2.7.17.dist-info/METADATA,sha256=J5dFupbSoGVFuKx_tBG3mzNT9Yau8gd0CuAigZ2Oigk,2009
10929
+ simo-2.7.17.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
10930
+ simo-2.7.17.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10931
+ simo-2.7.17.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10932
+ simo-2.7.17.dist-info/RECORD,,
File without changes