Skip to content

Commit

Permalink
fix: fix option flow oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
topsworld committed Jan 9, 2025
1 parent 0d04ceb commit 4a2411f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/xiaomi_home/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,9 @@ async def async_step_auth_config(self, user_input=None):
async def async_step_oauth(self, user_input=None):
try:
if self._cc_task_oauth is None:
state = str(secrets.randbits(64))
state = hashlib.sha1(
f'd=ha.{self._entry_data["uuid"]}'.encode('utf-8')
).hexdigest()
self.hass.data[DOMAIN][self._virtual_did]['oauth_state'] = state
self._miot_oauth.set_redirect_url(
redirect_url=self._oauth_redirect_url_full)
Expand Down

0 comments on commit 4a2411f

Please sign in to comment.