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

@@ -121,15 +121,18 @@ class PresenceLighting(Script):
121
121
  name = _("Presence lighting")
122
122
  config_form = PresenceLightingConfigForm
123
123
 
124
- # script specific variables
125
- sensors = {}
126
- condition_comps = {}
127
- light_org_values = {}
128
- is_on = False
129
- turn_off_task = None
130
- last_presence = 0
131
- hold_time = 60
132
- conditions = []
124
+ def __init__(self, *args, **kwargs):
125
+ super().__init__(*args, **kwargs)
126
+ # script specific variables
127
+ self.sensors = {}
128
+ self.condition_comps = {}
129
+ self.light_org_values = {}
130
+ self.light_send_values = {}
131
+ self.is_on = False
132
+ self.turn_off_task = None
133
+ self.last_presence = 0
134
+ self.hold_time = 60
135
+ self.conditions = []
133
136
 
134
137
  def _run(self):
135
138
  self.hold_time = self.component.config.get('hold_time', 0) * 10
@@ -174,7 +177,10 @@ class PresenceLighting(Script):
174
177
  self._regulate()
175
178
 
176
179
  def _on_light_change(self, light):
177
- if self.is_on:
180
+ # change original value if it has been changed to something different
181
+ # than this script does.
182
+ if self.is_on and light.value != self.light_send_values[light.id]:
183
+ self.light_send_values[light.id] = light.value
178
184
  self.light_org_values[light.id] = light.value
179
185
 
180
186
  def _regulate(self, on_val_change=True):
@@ -226,8 +232,12 @@ class PresenceLighting(Script):
226
232
  if not comp or not comp.controller:
227
233
  continue
228
234
  self.light_org_values[comp.id] = comp.value
229
- print(f"Send {light_params['on_value']} to {comp}!")
230
- comp.controller.send(light_params['on_value'])
235
+ on_val = light_params['on_value']
236
+ if type(comp.controller.default_value) == bool:
237
+ on_val = bool(on_val)
238
+ print(f"Send {on_val} to {comp}!")
239
+ self.light_send_values[comp.id] = on_val
240
+ comp.controller.send(on_val)
231
241
  return
232
242
 
233
243
  if self.is_on:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.6.4
3
+ Version: 2.6.5
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
@@ -13,7 +13,7 @@ simo/__pycache__/urls.cpython-38.pyc,sha256=u0x6EqT8S1YfDOSPgbI8Kf-RDlveY9OV-EDX
13
13
  simo/__pycache__/wsgi.cpython-38.pyc,sha256=TpRxO7VM_ql31hbKphVdanydC5RI1nHB4l0QA2pdWxo,322
14
14
  simo/automation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  simo/automation/app_widgets.py,sha256=gaqImMZjuMHm7nIb9a4D-Y3qipz_WhSPAHXcwGx4Uzs,199
16
- simo/automation/controllers.py,sha256=gIkEOqq7IJ3BoDF40mN2aTGE8_yVwhQrO0RZlJYiYfg,9451
16
+ simo/automation/controllers.py,sha256=pKC8kXiT8mvkLJChl10cdlgmeetG89wsY1xIW5ULvEs,10045
17
17
  simo/automation/forms.py,sha256=wJMaXE5ngO_o60jqxnf4Om09q48yXpWwRna0FkQCZYs,10081
18
18
  simo/automation/gateways.py,sha256=7r33NOAiRd_RGMMm44i0KYzuAuweQnEF4HxLo-Rpexs,9408
19
19
  simo/automation/helpers.py,sha256=iP-fxxB8HsFQy3k2CjFubu86aMqvWgmh-p24DiyOrek,4330
@@ -22,7 +22,7 @@ simo/automation/serializers.py,sha256=PjyFrjdPK1mBsgbNhyqMi9SWzcymqTa742ipy0LhAN
22
22
  simo/automation/state.py,sha256=aZZvNBae7unnux_zGHCIWCV2z47hVJc-DIL72Hqfkeo,600
23
23
  simo/automation/__pycache__/__init__.cpython-38.pyc,sha256=YmP0xAD-mxpQHgdTZeC64sXChA8TriMZD1jckNYi3xg,164
24
24
  simo/automation/__pycache__/app_widgets.cpython-38.pyc,sha256=7DfUA9V_1MiwrOe_ta-ts8dYY8xXb9UMg2_9A3XoRcs,523
25
- simo/automation/__pycache__/controllers.cpython-38.pyc,sha256=JUQ105NN-9Si1pyCkqn4P_4yQ9NG7OnQfSRBzBaeth4,7535
25
+ simo/automation/__pycache__/controllers.cpython-38.pyc,sha256=oswJRk8WGzzrNpg9S2LMl-zrAKaGxENacFzj6jT_tNI,7889
26
26
  simo/automation/__pycache__/forms.cpython-38.pyc,sha256=qxQZeTafJOT_lrXOKY6134XjIrx5OzABAZdncNnRV4E,7720
27
27
  simo/automation/__pycache__/gateways.cpython-38.pyc,sha256=W6OrugOLOGaYbibEWSs-zBZc8jQpNlO_NmJU-rmd6fU,7558
28
28
  simo/automation/__pycache__/helpers.cpython-38.pyc,sha256=4VSSarOFnUk_KExWwvDlx5dEhv8aHUCHMZDtGG--pUY,3627
@@ -10599,9 +10599,9 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
10599
10599
  simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10600
10600
  simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10601
10601
  simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10602
- simo-2.6.4.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10603
- simo-2.6.4.dist-info/METADATA,sha256=NoyEMezGXQEMN7GPtCpiLjVhl1WvSZrArBjsdJc8h0U,1952
10604
- simo-2.6.4.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10605
- simo-2.6.4.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10606
- simo-2.6.4.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10607
- simo-2.6.4.dist-info/RECORD,,
10602
+ simo-2.6.5.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10603
+ simo-2.6.5.dist-info/METADATA,sha256=bqH7ricDLu2pweU223qNedu6xRzUm130-ZOrO192p9g,1952
10604
+ simo-2.6.5.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
10605
+ simo-2.6.5.dist-info/entry_points.txt,sha256=S9PwnUYmTSW7681GKDCxUbL0leRJIaRk6fDQIKgbZBA,135
10606
+ simo-2.6.5.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10607
+ simo-2.6.5.dist-info/RECORD,,
File without changes