feat: per-shade home key + improved config flow#25
Conversation
Reuse the home key from already-configured shades so adding subsequent shades skips the key step. Show human-readable shade names from the hub in the device picker. Allow selecting multiple shades at once instead of repeating the flow for each one. Default to hub fetch as the key method.
…ated descriptions
4c58796 to
abb0a3e
Compare
|
Great, thanks for that input! I'll have a look and come back with potential issues or do you want me to change/fix them directly? |
|
No worries! The key is home-wide — it's the same for all shades on a home. It's stored per-entry because each HA config entry needs to be self-contained (entries can be removed independently). The user is only prompted once; subsequent shades auto-inherit it via _existing_home_key(). Happy to refactor to a hub-based parent entry if you'd prefer that pattern. Just provide feedback and I can fix. Sorry about the double/huge PR's, but in my local testing everything is looking good and very up-to-date. I'll look at those linting and hass failures. |
|
PR #29 is a better architecture. |
Previously the home key was hardcoded in
const.pyand shared across all shades at the module level. This meant you had to edit source code to set it, and every shade used the same constant. This PR moves the key into each shade's config entry data and adds a proper config flow to collect it.Home key handling
HOME_KEYbytes constant fromconst.py, replaced with aCONF_HOME_KEYconfig entry data fieldPowerViewBLEhas_keyproperty onPowerViewBLEsocover.pycan check whether encryption is available without referencing a global constantapi.has_keyinstead of comparing against the old globalConfig flow
extract_gateway3_homekey.py
Housekeeping