vniehues / homebridge-linak

Apache License 2.0
18 stars 2 forks source link

Variable Height Desks #2

Closed Pob4acke closed 2 years ago

Pob4acke commented 2 years ago

Hey Vince,

as your plugin tries to address all kinds of Linak desks I suspect there can be different heights as my Ikea Idasen. So the values in my calculation might only apply to that one.

I would suggest the max and min height of the desk should be entered as parameters to the plugin and from there we need to calculate the conversion from percentage to height individually.

For the universal stuff there are to calculations to be done:

  1. Percentage to height (easy!) Height = "min" + ("percentage" / 100) * ("max" - "min")
  2. height to percentage (a bit more tricky, but solvable) Percentage = (100 "height") / ("max" - "min") - (100 "min") / ("max" - "min")

Maybe in your readme you can then hint to some standard values for known desks and for the rest to check with "idasen-controller --monitor" for the end positions

vniehues commented 2 years ago

Yeah you're right, I should make these settings configurable. Great job with the calculations! Those would have taken me days to come up with.. not even kidding. I will try to implement these changes over the next weekend :) Thank you!

vniehues commented 2 years ago

Closed with v1.1.0 . Thanks again for your input!

Big thanks as well to the contributors over at idasen-controller for making the required changes in a matter of minutes!

Pob4acke commented 2 years ago

Community Power! :D