Skip to content

Commit

Permalink
Fixed Fade command
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyingDiver committed Jun 27, 2019
1 parent fb2b262 commit f4ab594
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Lutron RadioRA 2.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>7.2.6</string>
<string>7.2.7</string>
<key>ServerApiVersion</key>
<string>2.0</string>
<key>IwsApiVersion</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<CallbackMethod>fadeDimmer</CallbackMethod>
<ConfigUI>
<Field id="brightness" type="textfield">
<Label>Brightness:</Label>
<Label>Brightness (0-100):</Label>
</Field>
<Field id="fadeTime" type="textfield">
<Label>Fade Time:</Label>
<Label>Fade Time (in seconds):</Label>
</Field>
<Field id="simpleSeparator2" type="separator"/>
<Field id="messageNote" type="label" fontSize="small" fontColor="darkgray">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,8 @@ def fadeDimmer(self, pluginAction, dimmerDevice):
fadeTime = indigo.activePlugin.substitute(pluginAction.props["fadeTime"])
zone = dimmerDevice.address

sendCmd = ("#OUTPUT," + zone + ",1," + str(brightness) + "," + str(fadeTime))
m, s = divmod(int(fadeTime), 60)
sendCmd = ("#OUTPUT,{},1,{},{:02}:{:02}".format(zone, brightness, m, s))
self.logger.info(u"{}: Set brightness to {} with fade {}".format(dimmerDevice.name, brightness, fadeTime))
self._sendCommand(sendCmd)

Expand Down

0 comments on commit f4ab594

Please sign in to comment.