Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Fix missing timeout exception check in powerwall config flow
powerwall recently switched to asyncio, and every place we
check for unreachable we need to check for timeout error.
There was one missed
```
09:08 homeassistant homeassistant[546]: 2024-01-12 10:09:08.899 ERROR (MainThread) [homeassistant.components.powerwall.config_flow] Unexpected exception
Jan 12 20:09:08 homeassistant homeassistant[546]: Traceback (most recent call last):
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/src/homeassistant/homeassistant/components/powerwall/config_flow.py", line 168, in _async_try_connect
Jan 12 20:09:08 homeassistant homeassistant[546]: info = await validate_input(self.hass, user_input)
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/src/homeassistant/homeassistant/components/powerwall/config_flow.py", line 76, in validate_input
Jan 12 20:09:08 homeassistant homeassistant[546]: site_info, gateway_din = await _login_and_fetch_site_info(
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/src/homeassistant/homeassistant/components/powerwall/config_flow.py", line 43, in _login_and_fetch_site_info
Jan 12 20:09:08 homeassistant homeassistant[546]: await power_wall.login(password)
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/tesla_powerwall/powerwall.py", line 58, in login
Jan 12 20:09:08 homeassistant homeassistant[546]: return await self.login_as(User.CUSTOMER, password, email, force_sm_off)
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/tesla_powerwall/powerwall.py", line 49, in login_as
Jan 12 20:09:08 homeassistant homeassistant[546]: response = await self._api.login(user, email, password, force_sm_off)
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/tesla_powerwall/api.py", line 172, in login
Jan 12 20:09:08 homeassistant homeassistant[546]: return await self.post(
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/tesla_powerwall/api.py", line 146, in post
Jan 12 20:09:08 homeassistant homeassistant[546]: response = await self._http_session.post(
Jan 12 20:09:08 homeassistant homeassistant[546]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 601, in _request
Jan 12 20:09:08 homeassistant homeassistant[546]: await resp.start(conn)
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 960, in start
Jan 12 20:09:08 homeassistant homeassistant[546]: with self._timer:
Jan 12 20:09:08 homeassistant homeassistant[546]: File "/usr/local/lib/python3.12/site-packages/aiohttp/helpers.py", line 735, in __exit__
Jan 12 20:09:08 homeassistant homeassistant[546]: raise asyncio.TimeoutError from None
Jan 12 20:09:08 homeassistant homeassistant[546]: TimeoutError
```
* cov
* Prevent powerwall from switching addresses if its online
If the wifi interface was discovered we would switch the
ip address in the entry to the wifi ip even if it was
connected via ethernet
* cover
* more cover
* Convert persistent notification tests to async
* Create/dismiss persistent notifications in exposed functions, not service calls
* Fix notify persistent_notification
* Remove setting up persistent_notification
* Drop more setups
* Empty methods
* Undeprecate sync methods because too big task
* Fix setup clearing notifications
* Fix a bunch of tests
* Fix more tests
* Uno mas
* Test persistent notification events
* Clean up stale comment
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Make async_get_device connections Optional, default None
* Remove unnecessary async_get_device connections arg usages
Some of these were using an incorrect collection type, which didn't
cause issues mostly just due to luck.