Page 1 of 1

Struggling with dynamic list generation, callback methods !

PostPosted: Thu May 04, 2023 1:15 pm
by neilk
I have pretty much completed a new plugin to support the VELUX ACTIVE Gateway for blind support. Up until now my device configuration work has been pretty simple in plugins, and this is is still pretty trivial. The logic is

- one refreshing list that pulls a home name / home ID from the API

- a second list that uses the home_id to pull a list of blinds

I currently have two methods working fine to populate the list but have hard coded the home_id in the version to date.

What is the correct approach to pass the selection from the first list to populate the list in the second ?

I appreciate this is probably blindingly obvious but after trawling the forums I am not getting it, I am sure the key is the ValuesDict. Any example will help.

Thanks,
Neil

Re: Struggling with dynamic list generation, callback method

PostPosted: Fri May 05, 2023 10:43 am
by jay (support)
Recall that whenever a callback for dynamic lists is called, the current values of the entire dialog are sent along. So if you have dynamicReload set on the menus, then whenever a menu changes, any other menu callbacks are called and will reflect the selections of them all. That's how you'd do hierarchical menus.

Re: Struggling with dynamic list generation, callback method

PostPosted: Mon May 15, 2023 4:44 am
by neilk
Thanks for the pointer, I also took the opportunity to setup the debugger in PyCharm and "teach" myself to use it, made a difference to figuring this out. It is working now, I still need to dig in a little more as I am not 100% confident I have this fully understood but it is now working.