Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.23k stars 2.49k forks source link

Login Error #15

Closed shanespringer closed 1 year ago

shanespringer commented 1 year ago

Getting a blocking error on this integration causing it to fail.

I'm curious if using a gmail alias is something your codebase supports? Bolded below is the correct email that I signed up with and use in the Haier app, but I know it sometimes freaks out other things

This error originated from a custom integration.

Logger: homeassistant.config_entries Source: custom_components/hon/init.py:32 Integration: Haier hOn (documentation, issues) First occurred: 2:03:07 PM (2 occurrences) Last logged: 2:03:28 PM

Error setting up entry XXXXX+XXXXXXX@gmail.com for hon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/hon/init.py", line 32, in async_setup_entry await hon.setup() File "/usr/local/lib/python3.10/site-packages/pyhon/api.py", line 54, in setup headers=await self._headers) as resp: File "/usr/local/lib/python3.10/site-packages/pyhon/api.py", line 44, in _headers if await auth.authorize(self._email, self._password, self._mobile_id): File "/usr/local/lib/python3.10/site-packages/pyhon/auth.py", line 142, in authorize if not (url := await self._login(session, email, password, fw_uid, loaded, login_url)): File "/usr/local/lib/python3.10/site-packages/pyhon/auth.py", line 104, in _login return (await response.json())["events"][0]["attributes"]["values"]["url"] KeyError: 'events'

tempus2016 commented 1 year ago

11

https://github.com/Andre0512/hon/issues/11#issuecomment-1500860230

Andre0512 commented 1 year ago

Hey, can you test if v0.5.0-beta.4 also works for you? The "+" and all other special characters in mail or passwords would be encoded and shouldn't be a problem.

shanespringer commented 1 year ago

apologies @Andre0512 , I think I might be an idiot. the beta version didn't resolve the issue, but I think I was also conflating the smartHQ app and the hOn app. i'm guessing this is the source of the failure as smartHQ is available in my region and hOn is not. please feel free to reopen if that isn't the problem, but i'm going to go ahead and close this before shamefully hanging my head :)

Andre0512 commented 1 year ago

No problem, this is really confusing with all these apps. There is hOn, haier u+, simply-fi, wizard, smartHQ... they have some compatibilities with each other, but I have not yet understood the exact connections :smiley:

shanespringer commented 1 year ago

It’s a crappy boat, but the company is good

Andre0512 commented 1 year ago

Hey, have a look at #8, we really had a problem with special characters like the plus. :see_no_evil: Maybe it wasn't the regional apps thing, would be interesting if you could try again.