Skip to content

fix (1.0.x backport): parse single-quoted SSO config values on the Hive login page - #170

Merged
KJonline merged 1 commit into
Pyhass:masterfrom
matt-thepie:fix/sso-single-quotes-master
Oct 20, 2026
Merged

KJonline merged 1 commit into
Pyhass:masterfrom
matt-thepie:fix/sso-single-quotes-master

Conversation

@matt-thepie

Copy link
Copy Markdown
Contributor

Backport of the dev PR for a 1.0.10 patch release. Home Assistant pins pyhive-integration==1.0.9 (from this branch), so every HA install that restarts is currently losing Hive: home-assistant/core#187516.

Problem

Since 20 October 2026, https://sso.hivehome.com/ emits its bootstrap config as window.HiveSSOPoolId = 'eu-west-1_…' (single quotes, spaces around =). The string-replace JSON builder in getLoginInfo() only works with the old window.X="…", format, so it raises JSONDecodeError ("Expecting value: line 1 column 20"), returns None, and HiveAuthAsync.async_init crashes with AttributeError.

Fix

Replace the string munging with a regex over the window.<key> = <value> assignments that accepts either quote character. Verified against the live page:

{'UPID': 'eu-west-1_SamNfoWtf', 'CLIID': '3rl4i0ajrmtdm8sbre54p9dvd9', 'REGION': 'eu-west-1_SamNfoWtf'}

master has no unit tests for this path; the tests are in the dev PR.

🤖 Generated with Claude Code

Since 2026-10-20 https://sso.hivehome.com/ emits its bootstrap config as
window.HiveSSOPoolId = 'eu-west-1_...' (single quotes, spaces around =)
instead of window.HiveSSOPoolId="...". The string-replace JSON builder in
getLoginInfo() only works with the old format, so it raises JSONDecodeError,
returns None, and HiveAuthAsync.async_init crashes with AttributeError on
self.data.get. Home Assistant (pinned to 1.0.9) then fails to set up the
Hive integration after every restart (home-assistant/core#187516).

Parse the window.* assignments with a regex that accepts either quote
character. Backport of the dev-branch fix for a 1.0.10 patch release.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@matt-thepie

Copy link
Copy Markdown
Contributor Author

Note on the six pending checks: they are defined only in the dev-branch workflows (tests.yml, guard-master.yml), so they will never report on a PR into master, and source-branch-is-dev would fail a fork branch by design. All 15 lint/build checks pass. This backport is here in case you want a 1.0.10 hotfix from master, since Home Assistant pins pyhive-integration==1.0.9 and is currently broken (home-assistant/core#187516). If you would rather release from dev only, feel free to close this and keep #169.

@KJonline
KJonline merged commit 457028f into Pyhass:master Oct 20, 2026
15 checks passed
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.

2 participants