Commit Graph
59 Commits
Author SHA1 Message Date
J. Nick KostonandGitHub 58210b1968 Bump tesla-powerwall to 0.5.2 (#117823) 2024-05-20 16:51:39 -10:00
epenetandGitHub 9204ccfa17 Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost LekkerkerkerandGitHub f3ba713289 Use FlowResultType enum in config flow tests N-Z (#114682)
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost LekkerkerkerandGitHub ee66f6ec8c Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <[email protected]>
Co-authored-by: Marc Mueller <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
2024-03-26 00:02:16 +01:00
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <[email protected]>
2024-03-19 09:01:07 +01:00
Marc MuellerandGitHub 1722e23df8 Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
J. Nick KostonandGitHub dcfff6c138 Fix formatting of mac addresses from dhcp discovery mocking in powerwall (#110591)
dhcp returns addresses in lowercase without :
2024-02-14 23:11:25 +01:00
J. Nick KostonandGitHub f6d4617c7a Avoid directly changing config entry state in tests (part 2) (#110115)
followup to #110048 for more places
2024-02-10 07:20:15 +01:00
Marc MuellerandGitHub 438d3b01b9 Use builtin TimeoutError [o-s] (#109682) 2024-02-05 12:14:37 +01:00
Josh PettersenandGitHub 0cc8b2edf9 Remove battery charge sensor from powerwall (#109271) 2024-02-01 14:01:05 -06:00
Josh PettersenandGitHub b629ad9c3d Add individual battery banks as devices (#108339) 2024-01-30 19:03:01 -10:00
J. Nick KostonandGitHub e7c25d1c36 Migrate powerwall unique ids to use the gateway din (#107509) 2024-01-13 16:17:37 -10:00
J. Nick KostonandGitHub 3a4c64b0a7 Fix missing timeout exception check in powerwall config flow (#107899)
* 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
2024-01-12 21:39:27 +01:00
c74bef265a Update powerwall for tesla_powerwall 0.5.0 which is async (#107164)
Co-authored-by: J. Nick Koston <[email protected]>
2024-01-10 11:21:53 -10:00
Joost LekkerkerkerandGitHub 0ab0901f0f Add entity translations to Powerwall (#98843) 2023-08-22 21:58:57 +02:00
epenetandGitHub 69a46d4002 Adjust pylint plugin for components fixtures (#90217)
* Adjust pylint plugin for components fixtures

* Adjust components

* Use MagicMock

* Adjust

* Use None
2023-03-26 15:21:19 +02:00
epenetandGitHub d65dff3f9e Adjust entity registry access in tests (2) (#88960) 2023-03-01 16:23:36 +01:00
epenetandGitHub 2cdc741900 Add type hints to integration tests (part 17) (#88163) 2023-02-15 11:14:04 +01:00
epenetandGitHub 3abf7ea18a Add type hints to integration tests (m-p) (#87705) 2023-02-08 07:48:54 -08:00
epenetandGitHub 59ca7780fa Add typing to tests with single hass argument (#87631) 2023-02-07 15:01:16 +01:00
66e21d7701 Add Powerwall off grid switch (#86357)
Co-authored-by: J. Nick Koston <[email protected]>
2023-01-23 15:03:15 -10:00
J. Nick KostonandGitHub a1d9d7116c Prevent powerwall from switching addresses if its online (#82410)
* 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
2022-11-20 10:38:30 -05:00
Franck NijhofandGitHub a6244eea28 Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
jresterandGitHub ad5dbae425 Fix reauthentication for powerwall integration (#72174) 2022-05-20 14:53:43 -05:00
Matt ZimmermanandGitHub 8c00fde27d [powerwall] Skip backup reserve sensor if data is unavailable (#69637) 2022-04-07 20:34:00 -07:00
epenetandGitHub 053c4428a9 Prettify json (component test fixtures) (#68892) 2022-03-30 11:37:17 +02:00
J. Nick KostonandGitHub 4cc8998ea7 Make powerwall attribute sensors their own sensors (#68345) 2022-03-18 21:23:26 +01:00
Matt ZimmermanandGitHub d077c3b8d1 Add sensor to expose Powerwall backup reserve percentage (#66393) 2022-02-28 09:31:34 -10:00
3d8d507ed9 Migrate powerwall from using ip address as unique id (#65257)
Co-authored-by: Martin Hjelmare <[email protected]>
2022-02-03 18:39:57 +01:00
epenetandGitHub c3e9c1a7e8 Use DhcpServiceInfo in powerwall (#60051) 2021-11-21 07:56:22 -06:00
Paulus SchoutsenandGitHub 31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
b2d67f8d19 Add grid services active sensor to telsa powerwall integration (#56317)
Co-authored-by: Franck Nijhof <[email protected]>
2021-10-22 14:25:25 -10:00
a4d9019ffc Refactor persistent notification to no longer route all data via a service (#57157)
* 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 <[email protected]>
2021-10-07 12:58:00 +02:00
25f3cdde50 Add powerwall import and export sensors (#54018)
Co-authored-by: Bram Kragten <[email protected]>
2021-08-09 16:03:22 -07:00
Ville SkyttäandGitHub 153d6e891e Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Franck NijhofandGitHub 969c147b77 Clean up superfluous integration setup - part 4 (#49295)
* Clean up superfluous integration setup - part 4

* Adjust tests
2021-04-16 17:46:49 +02:00
Erik MontnemeryandGitHub ba2978c693 Update tests p-s to use async_get() instead of async_get_registry() (#47654) 2021-03-09 14:28:32 +01:00
884df40951 Update powerwall for new authentication requirements (#46254)
Co-authored-by: badguy99 <[email protected]>
2021-02-10 20:50:38 +01:00
J. Nick KostonandGitHub 38d4af1a6e Remove YAML support from powerwall (#45381) 2021-01-21 21:59:33 -05:00
J. Nick KostonandGitHub b71a9b5e28 Prefill the ip address for powerwall discovery (#45209) 2021-01-17 03:09:04 +01:00
Ville SkyttäandGitHub 2fb3be50ab Make DeviceRegistry.async_get_device connections arg optional (#44897)
* 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.
2021-01-07 13:49:45 +01:00
Franck NijhofandGitHub 65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Paulus SchoutsenandGitHub 1c36bf5e19 Fix block till done in create entry config flow tests (#42290) 2020-10-24 16:20:56 +02:00
jresterandGitHub 734972f876 Update tesla_powerwall to 0.3.3 (#41482) 2020-10-08 08:26:44 -05:00
springstanandGitHub d2b1918e9c Drop UNIT_ prefix for percentage constant (#39383) 2020-09-05 21:09:14 +02:00
Franck NijhofandGitHub 1c2ebdf307 Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
J. Nick KostonandGitHub 2d5faaf3f8 Remove powerwall attributes no longer present in latest firmware (#36667) 2020-06-11 10:15:02 -07:00
Paulus SchoutsenandGitHub ec47216388 Use built-in test helpers on 3.8 (#34901) 2020-04-30 13:29:50 -07:00
jresterandGitHub 4b998ea6af Improve error handling for Powerwall (#34580)
* Improve error handling
	modified:   homeassistant/components/powerwall/__init__.py
	modified:   homeassistant/components/powerwall/config_flow.py
	modified:   homeassistant/components/powerwall/const.py
	modified:   homeassistant/components/powerwall/strings.json
	modified:   homeassistant/components/powerwall/translations/en.json

* Change exception name
	modified:   homeassistant/components/powerwall/__init__.py
	modified:   homeassistant/components/powerwall/config_flow.py

* Add test

* Rename PowerwallError to POWERWALL_ERROR

* Modify handling of APIChangedErrors
	modified:   homeassistant/components/powerwall/__init__.py
	modified:   homeassistant/components/powerwall/const.py
2020-04-26 19:14:53 -05:00