philip1986 / pimatic-led-light

A template for creating plugins
http://pimatic.org/
GNU General Public License v2.0
7 stars 13 forks source link

Rules: brightness, variable as colour value #69

Closed joeyboey closed 7 years ago

joeyboey commented 7 years ago

It would be nice if you could set the brightness via the rules aswell as being able to input a variable as a colour value, e.g. "set milight to $temp_colour"

mwittig commented 7 years ago

Hi, you can change brightness using the dim action which takes a percentage value (0 - 100)! For example:

dim led-2 to 25

There may be cases where the action does not work as expected. For example, if the the bulb had been offline it may happen the dim action has no effect as driver does not properly retry requests on failure. This is due to shortcomings of the underlying driver package. I am planning to replace thedriver with a more robust implementation in the future.

joeyboey commented 7 years ago

Thanks for the quick answer. :) And whats with the variable?

mwittig commented 7 years ago

Say you have a variable $brightness you use the action as follows:


dim led-2 to $brightness
joeyboey commented 7 years ago

i wanted to temporarily store a colour value, then apply it later. i think i have to specify the variable type as "hex color" for it to work

Right now i'm getting a " could not find an provider that provides the next action..." error

mwittig commented 7 years ago

That's really another issue, isn't it?

You can specifiy the color by giving one of 140 selected color names or by providing the hexvalue preceded by a hash sign. Providing a variable is not supported at this point!

Examples:

set led-2 to red
set led-2 to #FF0000

For a list of supported color names see https://github.com/philip1986/pimatic-led-light/blob/master/color_schema.json

joeyboey commented 7 years ago

Yes it is. I just signed up for this, I'm not that experienced yet. Thanks for your quick help :)

Marcus Wittig notifications@github.com schrieb am Mi., 25. Jan. 2017, 15:45:

That's really another issue, isn't it?

You can specifiy the color by giving one of 140 selected color names of by providing the hexvalue preceded by a hash sign. Providing a variable is not supported at this point!

Examples:

set led-2 to red set led-2 to #FF0000

For a list of supported color names see https://github.com/philip1986/pimatic-led-light/blob/master/color_schema.json

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/philip1986/pimatic-led-light/issues/69#issuecomment-275126137, or mute the thread https://github.com/notifications/unsubscribe-auth/AYKn555bL03KfZC4uB-sbWXWnLl8EW5eks5rV2AngaJpZM4LtKRv .

mwittig commented 7 years ago

No worries. For general Q&A please also have a look at the pimatic forum. It provides a good source of information and lively exchange between users. https://forum.pimatic.org/