mihai-dinculescu / tapo

Unofficial Tapo API Client. Works with TP-Link Tapo smart devices. Tested with light bulbs (L510, L520, L530, L610, L630), light strips (L900, L920, L930), plugs (P100, P105, P110, P115, P300), hubs (H100), switches (S200B) and sensors (KE100, T100, T110, T300, T310, T315).
MIT License
373 stars 37 forks source link

In-/decrease brightness by value #141

Closed h00t2y closed 10 months ago

h00t2y commented 10 months ago

FOA big thx for this project! Never used rust, took me half a day to make an on-off button in homebridge to control my l930 lights :) gonna be ok from now on...

If am right there is no option to in-/decrease brightness by value, like by steps, by for example +/-5%

Any idead how to achieve this or could i request a feature like this?

mihai-dinculescu commented 10 months ago

It can be achieved in a two-step process.

  1. Read the current brightness by calling get_device_info.
  2. Call set_brightness and pass it current_brightness -/+ 5.

Some checks will be needed to ensure the new value doesn't go below 0 or above 100.