Documentation error?

Forum rules

This is a legacy forum which is locked for new topics. New topics should be started in one of the other forums under Extending Indigo

Posted on
Sun Jan 15, 2012 8:33 pm
p7willm offline
Posts: 25
Joined: Aug 29, 2010

Documentation error?

On page http://www.perceptiveautomation.com/wik ... base_class under the Dim and Brighten you show parameters of by and delay. In both sets of examples you use a parameter of to. There is setBrightness that takes a brightness value.

dim does currently take the to parameter. Is the doc incorrect and to is a valid parameter or is the doc correct and to will stop working when you fix the bug?

If to is valid when would I use setBrightness?

Feature or bug? I can issue a dim("A", to=50) for a dimmer that is off and it will brighten it to 50.

Another feature? I can also brighten from 100 to 10.

Thanks

PS I read the post and I wanted to say I am not trying to be a dick. It does appear the to has been left out as a parameter. But I don't really care how the rest works.

Posted on
Sun Jan 15, 2012 9:47 pm
matt (support) offline
Site Admin
User avatar
Posts: 21427
Joined: Jan 27, 2003
Location: Texas

Re: Documentation error?

Both dim and brighten have arguments of by and to, but I probably shouldn't have added the to arguments. The by arg is used to do a relative dim/brighten (relative to the current brightness value), but if to is defined then it does an absolute set brightness command (and the by arg is ignored if specified). So using either dim or brighten with the to argument is the same as using the setBrightness command (with its value argument).

That all makes sense logically IMO, but we shouldn't really provide multiple ways to do the same thing since it just causes confusion. Therefore, I removed the to examples from the documentation for dim/brighten, but am going to leave the arguments in as an undocumented feature so no existing plugins/scripts break. So they will keep working as described above but the preferred API for setting absolute brightness will be the setBrightness function.

Image

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest

cron