AaronLionsheep / ShellyMQTT

IndigoDomo Plugin that interfaces with Shelly devices over MQTT.
MIT License
0 stars 0 forks source link

Indigo action SetColorLevels float issue #122

Closed AaronLionsheep closed 1 year ago

AaronLionsheep commented 3 years ago

Report: https://forums.indigodomo.com/viewtopic.php?f=330&t=25176

https://github.com/AaronLionsheep/ShellyMQTT/blob/5530112976963eb8cb394c8eefc070edb34eb9eb/ShellyMQTT.indigoPlugin/Contents/Server%20Plugin/Devices/RGBW2/Shelly_RGBW2_Color.py#L128-L138

Indigo will attempt to save color values as floats strings. Casting a float string as an int fails, so additional logic is needed to handle this case.

   Trigger                         new trigger
   ShellyMQTT Error                Error in plugin execution ExecuteAction:

Traceback (most recent call last):
  File "plugin.py", line 590, in actionControlDevice
  File "/Library/Application Support/Perceptive Automation/Indigo 7.4/Plugins/ShellyMQTT.indigoPlugin/Contents/Server Plugin/Devices/RGBW2/Shelly_RGBW2_Color.py", line 130, in handleAction
ValueError: invalid literal for int() with base 10: '100.00'

This following devices are impacted: