Struggling with dynamic list generation, callback methods !

Posted on
Thu May 04, 2023 1:15 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Struggling with dynamic list generation, callback methods !

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

Posted on
Fri May 05, 2023 10:43 am
jay (support) offline
Site Admin
User avatar
Posts: 18224
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Struggling with dynamic list generation, callback method

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.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon May 15, 2023 4:44 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Struggling with dynamic list generation, callback method

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.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 24 guests

cron