Open TermoZour opened 1 year ago
It's been a long time since I used the official app! They must have updated it since I last used it. I might have a look if this is something that can be done with the standard Idasen that I have though no promises. I would definitely accept a PR to implement this if anyone else is interested.
Found the code for an app that already seems to implement setting favorite values here
I will test the app and follow along the lines to see if I can figure it out. I did send a packet with nRF Connect Android app but it seemed to clear all my favorites instead, so I might have done something wrong with the data I sent.
EDIT: It doesn't want to connect to Idasen Desk. Maybe it was made for a different Linak controller (the app also has 4 favorite slots and not just 3). It keeps spamming some errors about how it's trying to write some stuff to certain characteristics that don't seem to work for our desk.
I'll try to decompile the Linak app and see if I can understand anything from it (unless the code is obfuscated).
Thanks to the DPG1C issue I think I understand enough to implement this. Do you have suggestions for how it would work?
One idea, we have some special favourite names "favourite-1", "favourite-2" etc. which correspond to the favourite slots in the desk/app.
If you do not set these in the idasen controller config then using them in the --move-to favourite-1
argument will check the value from the desk first, and then move to it.
If you do set these values in the idasen controller config then using them in the --move-to favourite-1
will move to that height and write the value to the desk favourite.
Honestly, this sounds like the best behavior.
I just got an Ikea Idasen and I also installed the Desk Control app from Linak that is also compatible. The app allows you to set 3 predefined profiles and after that, you can use the controls on the desk to "snap" to those profiles while also allowing you to move between them.
Would "setting" profiles be something you're interested in implementing? Maybe even getting those profiles from the desk itself (like you're reading the height) so they are always in sync.
Let's say the desk is at height 741. You have a set a profile from the app to height 758 and another at 1152. You pull the button up so you start raising the desk. It will keep rising until it reaches 758, then wait a second. If the button is still pressed, it will start rising again until it reaches 1152, at which point it will wait for a second again.
It would be really cool to have 3 profiles from the config sync with the 3 profiles set from the app, as well as being able to set new values from the CLI which can then be used with the hardware controls as well. This way, I can either control the desk and the profiles via it's hardware buttons, my personal laptop, or my phone when I'm using the work laptop.