simo 2.0.13__py3-none-any.whl → 2.0.15__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/__pycache__/controllers.cpython-38.pyc +0 -0
- simo/core/controllers.py +0 -10
- simo/fleet/__pycache__/forms.cpython-38.pyc +0 -0
- simo/fleet/forms.py +57 -27
- {simo-2.0.13.dist-info → simo-2.0.15.dist-info}/METADATA +1 -1
- {simo-2.0.13.dist-info → simo-2.0.15.dist-info}/RECORD +9 -9
- {simo-2.0.13.dist-info → simo-2.0.15.dist-info}/LICENSE.md +0 -0
- {simo-2.0.13.dist-info → simo-2.0.15.dist-info}/WHEEL +0 -0
- {simo-2.0.13.dist-info → simo-2.0.15.dist-info}/top_level.txt +0 -0
|
Binary file
|
simo/core/controllers.py
CHANGED
|
@@ -697,16 +697,6 @@ class Switch(MultiSwitchBase, TimerMixin, OnOffPokerMixin):
|
|
|
697
697
|
self.turn_off()
|
|
698
698
|
threading.Thread(target=toggle_back).start()
|
|
699
699
|
|
|
700
|
-
def _prepare_for_send(self, value):
|
|
701
|
-
if self.component.config.get('inverse'):
|
|
702
|
-
return not value
|
|
703
|
-
return value
|
|
704
|
-
|
|
705
|
-
def _prepare_for_set(self, value):
|
|
706
|
-
if self.component.config.get('inverse'):
|
|
707
|
-
return not value
|
|
708
|
-
return value
|
|
709
|
-
|
|
710
700
|
|
|
711
701
|
class DoubleSwitch(MultiSwitchBase):
|
|
712
702
|
name = _("Double Switch")
|
|
Binary file
|
simo/fleet/forms.py
CHANGED
|
@@ -196,18 +196,10 @@ class ColonelBinarySensorConfigForm(ColonelComponentForm):
|
|
|
196
196
|
]
|
|
197
197
|
)
|
|
198
198
|
)
|
|
199
|
-
pull = forms.ChoiceField(
|
|
200
|
-
choices=(
|
|
201
|
-
('HIGH', "HIGH"), ('LOW', "LOW"), ("FLOATING", "leave floating"),
|
|
202
|
-
),
|
|
203
|
-
help_text="If you are not sure what is this all about, "
|
|
204
|
-
"you are most definitely want to pull this HIGH or LOW "
|
|
205
|
-
"but not leave it floating!"
|
|
206
|
-
)
|
|
207
199
|
inverse = forms.TypedChoiceField(
|
|
208
|
-
choices=((1, "Yes"), (0, "No")), coerce=int,
|
|
209
|
-
help_text="Hint: Set
|
|
210
|
-
"you deliver GND to the
|
|
200
|
+
choices=((1, "Yes"), (0, "No")), coerce=int, initial=1,
|
|
201
|
+
help_text="Hint: Set inverse to Yes, to get ON signal when "
|
|
202
|
+
"you deliver GND to the input and OFF when you cut it out."
|
|
211
203
|
)
|
|
212
204
|
debounce = forms.IntegerField(
|
|
213
205
|
min_value=0, max_value=1000 * 60 * 60, required=False, initial=0,
|
|
@@ -215,7 +207,6 @@ class ColonelBinarySensorConfigForm(ColonelComponentForm):
|
|
|
215
207
|
"between ON/OFF states when engaged. <br>"
|
|
216
208
|
"Set debounce value in milliseconds, to remediate this. "
|
|
217
209
|
"100ms offers a good starting point!"
|
|
218
|
-
|
|
219
210
|
)
|
|
220
211
|
|
|
221
212
|
def clean(self):
|
|
@@ -508,17 +499,12 @@ class ColonelSwitchConfigForm(ColonelComponentForm):
|
|
|
508
499
|
]
|
|
509
500
|
)
|
|
510
501
|
)
|
|
511
|
-
engaged_action = forms.ChoiceField(
|
|
512
|
-
choices=(('HIGH', "HIGH"), ('LOW', "LOW")),
|
|
513
|
-
)
|
|
514
502
|
auto_off = forms.FloatField(
|
|
515
503
|
required=False, min_value=0.01, max_value=1000000000,
|
|
516
504
|
help_text="If provided, switch will be turned off after "
|
|
517
505
|
"given amount of seconds after every turn on event."
|
|
518
506
|
)
|
|
519
|
-
inverse = forms.BooleanField(
|
|
520
|
-
label=_("Inverse switch value"), required=False
|
|
521
|
-
)
|
|
507
|
+
inverse = forms.BooleanField(required=False)
|
|
522
508
|
slaves = forms.ModelMultipleChoiceField(
|
|
523
509
|
required=False,
|
|
524
510
|
queryset=Component.objects.filter(
|
|
@@ -681,14 +667,30 @@ class ColonelRGBLightConfigForm(ColonelComponentForm):
|
|
|
681
667
|
num_leds = forms.IntegerField(
|
|
682
668
|
label=_("Number of leds"), min_value=1, max_value=2000
|
|
683
669
|
)
|
|
684
|
-
|
|
685
|
-
|
|
670
|
+
strip_type = forms.ChoiceField(
|
|
671
|
+
label="LED strip type",
|
|
672
|
+
choices=(
|
|
673
|
+
("WS2811", "WS2811"),
|
|
674
|
+
('WS2812', "WS2812"),
|
|
675
|
+
('WS2812B', "WS2812B"),
|
|
676
|
+
('WS2813', "WS2813"),
|
|
677
|
+
('WS2815', "WS2815"),
|
|
678
|
+
('SK6812', "SK6812"),
|
|
679
|
+
('generic', "Generic"),
|
|
680
|
+
)
|
|
686
681
|
)
|
|
687
|
-
|
|
688
|
-
|
|
682
|
+
has_white = forms.BooleanField(initial=False, required=False)
|
|
683
|
+
color_order = forms.ChoiceField(
|
|
684
|
+
required=False, choices=(
|
|
685
|
+
(None, 'Default'),
|
|
689
686
|
("RGB", "RGB"), ("RBG", "RBG"), ("GRB", "GRB"),
|
|
690
687
|
("RGBW", "RGBW"), ("RBGW", "RBGW"), ("GRBW", "GRBW"),
|
|
691
|
-
)
|
|
688
|
+
),
|
|
689
|
+
)
|
|
690
|
+
custom_timing = forms.CharField(
|
|
691
|
+
required=False,
|
|
692
|
+
help_text="Custom addressable led strip timing (T0H, T0L, T1H, T1L). <br>"
|
|
693
|
+
"For example SK6812 is: (300, 900, 600, 600)"
|
|
692
694
|
)
|
|
693
695
|
controls = FormsetField(
|
|
694
696
|
formset_factory(
|
|
@@ -698,12 +700,26 @@ class ColonelRGBLightConfigForm(ColonelComponentForm):
|
|
|
698
700
|
|
|
699
701
|
def save(self, commit=True):
|
|
700
702
|
self.instance.config['output_pin_no'] = self.cleaned_data['output_pin'].no
|
|
701
|
-
if len(self.cleaned_data['order']) > 3:
|
|
702
|
-
self.instance.config['has_white'] = True
|
|
703
|
-
else:
|
|
704
|
-
self.instance.config['has_white'] = False
|
|
705
703
|
return super().save(commit)
|
|
706
704
|
|
|
705
|
+
def clean_custom_timing(self):
|
|
706
|
+
custom_timing = self.cleaned_data.get('custom_timing')
|
|
707
|
+
if not custom_timing:
|
|
708
|
+
return custom_timing
|
|
709
|
+
custom_timing = custom_timing.strip().\
|
|
710
|
+
strip('(').strip('[').rstrip(')').rstrip(']').split(',')
|
|
711
|
+
if len(custom_timing.split(',')) != 4:
|
|
712
|
+
raise forms.ValidationError("Tuple of 4 integers please.")
|
|
713
|
+
for t in custom_timing.split(','):
|
|
714
|
+
try:
|
|
715
|
+
t = int(t)
|
|
716
|
+
except:
|
|
717
|
+
raise forms.ValidationError(f"Integers only please.")
|
|
718
|
+
if t <= 0:
|
|
719
|
+
raise forms.ValidationError(f"Intervals must be greater than 0.")
|
|
720
|
+
if t > 100000:
|
|
721
|
+
raise forms.ValidationError(f"{t} seems way to much!")
|
|
722
|
+
return f"({custom_timing})"
|
|
707
723
|
|
|
708
724
|
def clean(self):
|
|
709
725
|
super().clean()
|
|
@@ -712,6 +728,20 @@ class ColonelRGBLightConfigForm(ColonelComponentForm):
|
|
|
712
728
|
if not self.cleaned_data.get('output_pin'):
|
|
713
729
|
return self.cleaned_data
|
|
714
730
|
|
|
731
|
+
if self.cleaned_data.get('color_order'):
|
|
732
|
+
if self.cleaned_data['has_white']:
|
|
733
|
+
if len(self.cleaned_data['color_order']) != 4:
|
|
734
|
+
self.add_error(
|
|
735
|
+
"color_order",
|
|
736
|
+
_("4 colors expected for stripes with dedicated White led.")
|
|
737
|
+
)
|
|
738
|
+
else:
|
|
739
|
+
if len(self.cleaned_data['color_order']) != 3:
|
|
740
|
+
self.add_error(
|
|
741
|
+
"color_order",
|
|
742
|
+
_("3 colors expected for stripes without dedicated White led.")
|
|
743
|
+
)
|
|
744
|
+
|
|
715
745
|
self._clean_pin('output_pin')
|
|
716
746
|
|
|
717
747
|
if not self.cleaned_data.get('controls'):
|
|
@@ -34,7 +34,7 @@ simo/core/auto_urls.py,sha256=0gu-IL7PHobrmKW6ksffiOkAYu-aIorykWdxRNtwGYo,1194
|
|
|
34
34
|
simo/core/autocomplete_views.py,sha256=JT5LA2_Wtr60XYSAIqaXFKFYPjrmkEf6yunXD9y2zco,4022
|
|
35
35
|
simo/core/base_types.py,sha256=yqbIZqBksrAkEuHRbt6iExwPDDy0K5II2NzRCkmOvMU,589
|
|
36
36
|
simo/core/context.py,sha256=98PXAMie43faRVBFkOG22uNpvGRNprcGhzjBFkrxaRY,1367
|
|
37
|
-
simo/core/controllers.py,sha256=
|
|
37
|
+
simo/core/controllers.py,sha256=2NH1xZFA4_YWNjJWjHqEvCB6SerebiQ5eHZix_xYvx8,26967
|
|
38
38
|
simo/core/dynamic_settings.py,sha256=U2WNL96JzVXdZh0EqMPWrxqO6BaRR2Eo5KTDqz7MC4o,1943
|
|
39
39
|
simo/core/events.py,sha256=LvtonJGNyCb6HLozs4EG0WZItnDwNdtnGQ4vTcnKvUs,4438
|
|
40
40
|
simo/core/filters.py,sha256=ghtOZcrwNAkIyF5_G9Sn73NkiI71mXv0NhwCk4IyMIM,411
|
|
@@ -65,7 +65,7 @@ simo/core/__pycache__/auto_urls.cpython-38.pyc,sha256=SVl4fF0-yiq7e9gt08jIM6_rL4
|
|
|
65
65
|
simo/core/__pycache__/autocomplete_views.cpython-38.pyc,sha256=hJ6JILI1LqrAtpQMvxnLvljGdW1v1gpvBsD79vFkZ58,3972
|
|
66
66
|
simo/core/__pycache__/base_types.cpython-38.pyc,sha256=CasZJN42cK_ymoQgn5E4s8oOkuZJ18fVHCgN4GPuT7c,735
|
|
67
67
|
simo/core/__pycache__/context.cpython-38.pyc,sha256=MSZPDhqMhCpUuBJl3HCIBHZA3BntYeP8RAnQcdqAH9k,1278
|
|
68
|
-
simo/core/__pycache__/controllers.cpython-38.pyc,sha256
|
|
68
|
+
simo/core/__pycache__/controllers.cpython-38.pyc,sha256=WmItOZU7CPqyYhxxB1F9I7QAhCqwUn0DSbLii_pqXwI,23818
|
|
69
69
|
simo/core/__pycache__/dynamic_settings.cpython-38.pyc,sha256=ELu06Hub4DOidja71ybvD3ZM4HdXiyZjNJrZfnXZXNA,2476
|
|
70
70
|
simo/core/__pycache__/events.cpython-38.pyc,sha256=A1Axx-qftd1r7st7wkO3DkvTdt9-RkcJe5KJhpzJVk8,5109
|
|
71
71
|
simo/core/__pycache__/filters.cpython-38.pyc,sha256=VIMADCBiYhziIyRmxAyUDJluZvuZmiC4bNYWTRsGSao,721
|
|
@@ -10169,7 +10169,7 @@ simo/fleet/auto_urls.py,sha256=X04oKJWA48wFW5iXg3PPROY2KDdHn_a99orQSE28QC4,518
|
|
|
10169
10169
|
simo/fleet/base_types.py,sha256=wL9RVkHr0gA7HI1wZq0pruGEIgvQqpfnCL4cC3ywsvw,102
|
|
10170
10170
|
simo/fleet/ble.py,sha256=eHA_9ABjbmH1vUVCv9hiPXQL2GZZSEVwfO0xyI1S0nI,1081
|
|
10171
10171
|
simo/fleet/controllers.py,sha256=rTxRFf-LKWAZxzixrsLZHHm51BmMx9a1PLdgf6inlNM,20533
|
|
10172
|
-
simo/fleet/forms.py,sha256=
|
|
10172
|
+
simo/fleet/forms.py,sha256=Ree_e3V0rBkVk1bVPr4aV8bsdo0pfCS8i5UV2OBtMJQ,37684
|
|
10173
10173
|
simo/fleet/gateways.py,sha256=KV5i5fxXIrlK-k6zyEkk83x11GJt-ELQ0npb4Ac83cM,3693
|
|
10174
10174
|
simo/fleet/managers.py,sha256=XOpDOA9L-f_550TNSyXnJbun2EmtGz1TenVTMlUSb8E,807
|
|
10175
10175
|
simo/fleet/models.py,sha256=J-rnn7Ew-7s3646NNRVY947Sbz21mUD_nBHtuHAKXds,14160
|
|
@@ -10185,7 +10185,7 @@ simo/fleet/__pycache__/auto_urls.cpython-38.pyc,sha256=SqyTuaz_kEBvx-bL46SclsZEE
|
|
|
10185
10185
|
simo/fleet/__pycache__/base_types.cpython-38.pyc,sha256=deyPwjpT6xZiFxBGFnj5b7R-lbdOTh2krgpJhrcGVhc,274
|
|
10186
10186
|
simo/fleet/__pycache__/ble.cpython-38.pyc,sha256=Nrof9w7cm4OlpFWHeVnmvvanh2_oF9oQ3TknJiV93-0,1267
|
|
10187
10187
|
simo/fleet/__pycache__/controllers.cpython-38.pyc,sha256=l9bz18Qp33C12TJOKPSn9vIXnlBKnBusODNk7Fg64qA,18103
|
|
10188
|
-
simo/fleet/__pycache__/forms.cpython-38.pyc,sha256
|
|
10188
|
+
simo/fleet/__pycache__/forms.cpython-38.pyc,sha256=IvK-njOrKBAlvzSGsvPrKnsHwB1gcRrmWL8Nlkg_fF0,27050
|
|
10189
10189
|
simo/fleet/__pycache__/gateways.cpython-38.pyc,sha256=YAcgTOqJbtjGI03lvEcU6keFfrwAHkObVmErYzfRvjk,3569
|
|
10190
10190
|
simo/fleet/__pycache__/managers.cpython-38.pyc,sha256=8uz-xpUiqbGDgXIZ_XRZtFb-Tju6NGxflGg-Ee4Yo6k,1310
|
|
10191
10191
|
simo/fleet/__pycache__/models.cpython-38.pyc,sha256=S9pPqRjIxASXahoIOkkjQX7cBwjkdu4d2nXMju0-Cf8,12283
|
|
@@ -10444,8 +10444,8 @@ simo/users/templates/invitations/expired_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCe
|
|
|
10444
10444
|
simo/users/templates/invitations/expired_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10445
10445
|
simo/users/templates/invitations/taken_msg.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10446
10446
|
simo/users/templates/invitations/taken_suggestion.html,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10447
|
-
simo-2.0.
|
|
10448
|
-
simo-2.0.
|
|
10449
|
-
simo-2.0.
|
|
10450
|
-
simo-2.0.
|
|
10451
|
-
simo-2.0.
|
|
10447
|
+
simo-2.0.15.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
|
|
10448
|
+
simo-2.0.15.dist-info/METADATA,sha256=UqCCt7aUFVM4KSRZgpdaBDqE7HmzyUYAa8BKE01kwz8,1700
|
|
10449
|
+
simo-2.0.15.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
10450
|
+
simo-2.0.15.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
|
|
10451
|
+
simo-2.0.15.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|