Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix hass_url undefined #2417

Merged
merged 2 commits into from
Aug 8, 2024
Merged

Conversation

danielbrunt57
Copy link
Collaborator

Removed self.config.pop("hass_url")
Fixes #2408

Removed self.config.pop("hass_url")
@chrisvblemos
Copy link
Contributor

I'm not sure yet why this pop was there to begin with and can't comment on whether removing it could break other things. I think the root issue is at line 815. Solution is very simple, as given by @LorenzoRogai, and should be included anyway even if the .pop is unnecessary as it is a critical error (hass_url doesn't exist in the given context):

Change
CONF_HASS_URL, default=self.config.get(CONF_HASS_URL, hass_url)
to:
CONF_HASS_URL, default=self.config.get(CONF_HASS_URL, DEFAULT_HASS_URL)

@danielbrunt57
Copy link
Collaborator Author

I've compared v4.12.5 with v4.10.3 and in 4.10.3, hass_url was never in _update_schema_defaults:

                vol.Required(
                    CONF_HASS_URL, default=self.config.get(CONF_HASS_URL, hass_url)
                ): str,

I think I added it with the intention it be a reconfigurable option but after a little discussion with Alan, decided to not make it reconfigurable and that section of code lingered. I've tested my config_flow leaving lines 620-621 with config.pop in _test_login as they were previously but removed lines 814-816 in _update_schema_defaults. Initial configuration worked and also a reconfigure options so I believe at this point, that is the correct fix.

Revert previous commit and apply new fix
@alandtse alandtse merged commit 7cb1818 into alandtse:dev Aug 8, 2024
3 checks passed
@alandtse alandtse changed the title fix: hass_url undefined fix: fix hass_url undefined Aug 8, 2024
alandtse added a commit that referenced this pull request Aug 8, 2024
fix: fix hass_url undefined (#2417)
@grantclem
Copy link

Sadly not working for .com.au

chrisvblemos pushed a commit to chrisvblemos/alexa_media_player that referenced this pull request Aug 8, 2024
chrisvblemos pushed a commit to chrisvblemos/alexa_media_player that referenced this pull request Aug 8, 2024
@danielbrunt57 danielbrunt57 deleted the hass_url_undefined branch August 17, 2024 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

config_flow.py line 815: hass_url undefined
5 participants