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

@@ -322,7 +322,7 @@ class Thermostat(ControllerBase):
322
322
  ).first()
323
323
 
324
324
  if not temperature_sensor or not temperature_sensor.alive:
325
- print(f"No temperature sensor on {self.component}!")
325
+ self.component.error_msg = "No temperature sensor"
326
326
  self.component.alive = False
327
327
  self.component.save()
328
328
  return
@@ -355,7 +355,7 @@ class Thermostat(ControllerBase):
355
355
 
356
356
  if mode in ('auto', 'heater'):
357
357
  if (not heater or not heater.alive) and mode == 'heater':
358
- print(f"No heater on {self.component}!")
358
+ self.component.error_msg = "No heater"
359
359
  self.component.alive = False
360
360
  self.component.save()
361
361
  return
simo/generic/gateways.py CHANGED
@@ -304,25 +304,32 @@ class GenericGatewayHandler(BaseObjectCommandsGatewayHandler):
304
304
  mqtt_client.subscribe(command.get_topic())
305
305
 
306
306
  def on_mqtt_message(self, client, userdata, msg):
307
- from simo.generic.controllers import Script, Blinds, AlarmGroup, Gate
307
+ print("Mqtt message: ", msg.payload)
308
+ from simo.generic.controllers import (
309
+ Script, Blinds, AlarmGroup, Gate
310
+ )
308
311
  payload = json.loads(msg.payload)
309
312
  component = get_event_obj(payload, Component)
310
313
  if not component:
311
314
  return
315
+ try:
316
+ if isinstance(component.controller, Script):
317
+ if payload.get('set_val') == 'start':
318
+ self.start_script(component)
319
+ elif payload.get('set_val') == 'stop':
320
+ self.stop_script(component)
321
+ return
322
+ elif component.controller_uid == Blinds.uid:
323
+ self.control_blinds(component, payload.get('set_val'))
324
+ elif component.controller_uid == AlarmGroup.uid:
325
+ self.control_alarm_group(component, payload.get('set_val'))
326
+ elif component.controller_uid == Gate:
327
+ self.control_gate(component, payload.get('set_val'))
328
+ else:
329
+ component.controller.set(payload.get('set_val'))
330
+ except Exception:
331
+ print(traceback.format_exc(), file=sys.stderr)
312
332
 
313
- if isinstance(component.controller, Script):
314
- if payload.get('set_val') == 'start':
315
- print("START THIS SCRIPT!!!", component)
316
- self.start_script(component)
317
- elif payload.get('set_val') == 'stop':
318
- self.stop_script(component)
319
- return
320
- elif component.controller_uid == Blinds.uid:
321
- self.control_blinds(component, payload.get('set_val'))
322
- elif component.controller_uid == AlarmGroup.uid:
323
- self.control_alarm_group(component, payload.get('set_val'))
324
- elif component.controller_uid == Gate:
325
- self.control_gate(component, payload.get('set_val'))
326
333
 
327
334
  def start_script(self, component):
328
335
  print("START SCRIPT %s" % str(component))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: simo
3
- Version: 2.1.7
3
+ Version: 2.1.8
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
@@ -10299,9 +10299,9 @@ 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=tZ0q1op_A_ql2OWW6KM3XlpOrZYGsUuhWgr1ZiiIEwY,58249
10302
+ simo/generic/controllers.py,sha256=fgjsEtc4tJx3VaZ4R6HcrYQ0JosarR7JKKEar7ip5HI,58245
10303
10303
  simo/generic/forms.py,sha256=IAfDtmEk1-CP0JBoetOD_ahLm64nK41GOUXjmbUzNtY,29550
10304
- simo/generic/gateways.py,sha256=io9l67q4DwnPjqnEgy-aYxUf_FAOf__HJIPGluqNqZQ,18113
10304
+ simo/generic/gateways.py,sha256=FAGShbPuO88Ww8f5KxUwsMvvowK2d6BWsC4o3706y7Y,18354
10305
10305
  simo/generic/models.py,sha256=92TACMhJHadAg0TT9GnARO_R3_Sl6i-GGjhG_x7YdFI,7391
10306
10306
  simo/generic/routing.py,sha256=elQVZmgnPiieEuti4sJ7zITk1hlRxpgbotcutJJgC60,228
10307
10307
  simo/generic/socket_consumers.py,sha256=NfTQGYtVAc864IoogZRxf_0xpDPM0eMCWn0SlKA5P7Y,1751
@@ -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.7.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10506
- simo-2.1.7.dist-info/METADATA,sha256=GmYnqsbm6poKGIYXr6sl5CHQHn-5b7BVWLpiZpI0OgM,1847
10507
- simo-2.1.7.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
10508
- simo-2.1.7.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10509
- simo-2.1.7.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10510
- simo-2.1.7.dist-info/RECORD,,
10505
+ simo-2.1.8.dist-info/LICENSE.md,sha256=M7wm1EmMGDtwPRdg7kW4d00h1uAXjKOT3HFScYQMeiE,34916
10506
+ simo-2.1.8.dist-info/METADATA,sha256=nWipQhTgzmOkBqv6OOGUYMoptAirTzYtomh-xD-4x_c,1847
10507
+ simo-2.1.8.dist-info/WHEEL,sha256=mguMlWGMX-VHnMpKOjjQidIo1ssRlCFu4a4mBpz1s2M,91
10508
+ simo-2.1.8.dist-info/entry_points.txt,sha256=SJBxiDpH7noO0STxVI_eRIsGR-nLgdXXeqCDe8cXlbM,65
10509
+ simo-2.1.8.dist-info/top_level.txt,sha256=GmS1hrAbpVqn9OWZh6UX82eIOdRLgYA82RG9fe8v4Rs,5
10510
+ simo-2.1.8.dist-info/RECORD,,
File without changes