22 Commits

Author SHA1 Message Date
Arie Catsman
4c91d1b402
Add support for ACB batteries to Enphase Envoy (#131298)
* Add support for ACB batteries to Enphase Envoy

* Add tests for ACB battery support in ENphase Envoy

* make acb state sensordeviceclass ENUM

* Capitalize strings and use common idle
2024-12-18 08:48:37 +01:00
Arie Catsman
74b78307ee
Add balanced grid import/export to enphase_envoy (#123154)
* Add balanced grid import/export to enphase_envoy

* rebuild sensor snapshot after dev merge

* Cleanup snapshot file
2024-09-08 12:15:00 +02:00
Arie Catsman
ea7b2ecec0
Improve coordinator test coverage for enphase_envoy (#122375)
* Improve coordinator test coverage for enphase_envoy

* rename to test_coordinator to test_init for enphase_envoy

* Mock pyenphase _obtain_token instead of httpx auth requests in enphase_envoy tests.

* Move EnvoyTokenAuth patch to mock_envoy of enphase_envoy
2024-09-06 17:14:37 +02:00
Marc Mueller
c92d9dcb74
Use TypeVar defaults for Generator (#122170) 2024-07-19 13:06:45 +02:00
Arie Catsman
baa97ca981
Add fixture files to Enphase_Envoy tests (#121864)
* Add fixture files to Enphase_Envoy tests

* optimize fixtures in enphase_envoy conftest

* combine setup_enphase_envoy and mock_envoy in enphase_envoy tests

* Revert "combine setup_enphase_envoy and mock_envoy in enphase_envoy tests"

This reverts commit ec072c4726bc1348f87608f744ff06117e762bae.

* Rework enphase tests

* Rework enphase tests

* reset diagnostics test snapshot

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-07-16 21:14:46 +02:00
Marc Mueller
2f0dd6f704
Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
epenet
629dab238f
Improve type hints in enphase_envoy tests (#120676) 2024-06-27 13:24:22 -05:00
Arie Catsman
158c8b8400
Add optional test fixture collection to enphase_envoy diagnostic report (#116242)
* diagnostics_fixtures

* fix codespell errors

* fix merge order and typo

* remove pointless-string-statement
2024-06-24 10:37:32 +02:00
Arie Catsman
bbaa0c16cc
Cancel timer on enphase_envoy config entry unload (#111406)
* lingeringtimer

* Add async_cleanup to enphase_envoy_coordinator and call from unload_entry
2024-04-24 16:33:14 +02:00
Arie Catsman
2c651e190f
Add additional zeroconf discovery coverage and logging to enphase_envoy (#114405)
* add debug info to zeroconf for enphase_envoy

* Implement review feedback, lost space

Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>

* review feedback textual changes.

* implement review feedbackw.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Add some more zeroconf tests and valid jwt

* review feedback assert abort reason and keyerror for serialnumber

* Review feedback config flow test ends with abort or create_entry

* Review feedback optimize resource usage

* Cover new code in test.

* Use caplog for debug COV

---------

Co-authored-by: Charles Garwood <cgarwood@newdealmultimedia.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-23 08:26:53 -04:00
Joost Lekkerkerker
6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
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>
2024-03-26 00:02:16 +01:00
Arie Catsman
205c457a77
Add home battery storage entities for enphase_envoy (#114015) 2024-03-22 08:46:39 -10:00
Marc Mueller
38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Arie Catsman
d8d44069b5
Add Grid import export to Enphase Envoy (#110884)
* Add Grid import export to enphase Envoy

* Update snapshot for labels dict element in entity registry

* use identity check for enum

* Revert use of identity check, didn't add entities

* Implement review feedback for tests

* ct phase sensors disabled by default

* import PHASENAMES from pyenphase

* Update tests/components/enphase_envoy/test_sensor.py

* Update tests/components/enphase_envoy/test_sensor.py

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-27 16:43:43 -05:00
Arie Catsman
2b33feb341
Add phase entities to Enphase Envoy (#108725)
* add phase entities to Enphase Envoy

* Implement review feedback for translation strings

* Enphase Envoy multiphase review changes

Move device name logic to separate function.
Refactor native value for phases
Use dataclasses.replace for phase entities, add on-phase to base class as well, no need for phase entity descriptions anymore

* Enphase Envoy reviewe feedback

Move model determination to library.
Revert states test for future split to sensor test.

* Enphase_Envoy use model description from pyenphase library

* Enphase_Envoy refactor Phase Sensors

* Enphase_Envoy use walrus in phase sensor

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-01-28 22:46:47 +01:00
Charles Garwood
032d120a26
Include Envoy firmware version in Enphase diagnostics (#105742)
* Include Envoy firmware version in Enphase diagnostics

* Update tests
2023-12-14 13:59:39 -05:00
Aarni Koskela
706add4a57
Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
Joost Lekkerkerker
a539d851cc
Use snapshot assertion for Enphase Envoy diagnostics test (#98910) 2023-08-23 17:57:55 -05:00
J. Nick Koston
00e78fbf19
Cache envoy auth tokens to ensure integration works if cloud is offline (#97872) 2023-08-05 14:51:19 -10:00
J. Nick Koston
02e546e3ef
Refactor enphase_envoy to use pyenphase library (#97862) 2023-08-05 13:33:16 -10:00
Aaron Bach
414d478d3e
Ensure Enphase Envoy test fixtures aren't session-scoped (#80499)
* Ensure Enphase Envoy test fixtures aren't session-scoped

* Code review
2022-10-18 10:24:49 -06:00
Aaron Bach
72f4665d33
Streamline Enphase Envoy config flow tests (#79914)
* Streamline Enphase Envoy config flow tests

* Don't test data results using constants

* Fix data issues

* Fixtures

* Simplify mock creation

* Docstrings
2022-10-17 20:29:10 +03:00