Commit Graph

45 Commits (49b90fc140e17a88477523db44ca4624c81b6d8f)

Author SHA1 Message Date
Erik Montnemery ecb3bf79f3
Revert "Add support for subentries to config entries" ()
Revert "Add support for subentries to config entries ()"

This reverts commit ad15786115.
2024-12-18 13:51:05 +01:00
Erik Montnemery ad15786115
Add support for subentries to config entries ()
* Add support for subentries to config entries

* Improve error handling and test coverage

* Include subentry_id in subentry containers

* Auto-generate subentry_id and add optional unique_id

* Tweak

* Update tests

* Fix stale docstring

* Address review comments

* Typing tweaks

* Add methods to ConfigEntries to add and remove subentry

* Improve ConfigSubentryData typed dict

* Update test snapshots

* Adjust tests

* Fix unique_id logic

* Allow multiple subentries with None unique_id

* Add number of subentries to config entry JSON representation

* Add subentry translation support

* Allow integrations to implement multiple subentry flows

* Update translations schema

* Adjust exception text

* Change subentry flow init step to user

* Prevent creating a subentry with colliding unique_id

* Update tests

* Address review comments

* Remove duplicaetd unique_id collision check

* Remove change from the future

* Improve test coverage

* Add default value for unique_id
2024-12-12 20:16:18 +01:00
dontinelli 5ae875be77
Update test_config_flow for solarlog ()
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-03 22:29:58 +01:00
dontinelli 4eb5734d73
Remove CONF_NAME from config entry in solarlog ()
* Remove CONF_NAME from config entry

* Remove name from strings.json
2024-12-02 07:39:48 +01:00
dontinelli 4b680ffa5f
Dynamic add/remove devices for solarlog ()
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-10-25 18:02:14 +02:00
dontinelli ea164a2030
Add missing state_class to sensors in solarlog ()
* Add missing state_class

* Update snapshot
2024-10-25 09:32:56 +02:00
epenet 25aea140be
Cleanup unnecessary reconfigure_confirm from config flows () 2024-10-14 12:57:15 +02:00
dontinelli 99a40ae49f
Reverse unintended change of unique_id for solarlog () 2024-10-08 08:46:49 +02:00
epenet 9873371413
Use start_reconfigure_flow in config flow tests ()
* Use start_reconfigure_flow in config flow tests

* Adjust fritz
2024-10-02 10:01:15 +02:00
epenet a2404e7fb8
Use reconfigure_confirm in solarlog config flow ()
* Use reconfigure_confirm in solarlog config flow

* Fix test
2024-10-01 14:24:44 +02:00
Erik Montnemery d82bff1bc2
Index config entry discovery_keys by discovery domain ()
* Index config entry discovery_keys by discovery domain

* Add new signal

* Update tests

* Update homeassistant/config_entries.py

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

* Fix imports

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 21:48:11 +02:00
Erik Montnemery b2982c18bb
Reinitialize zeroconf discovery flow on unignore ()
* Reinitialize zeroconf discovery flow on unignore

* Adjust tests

* Improve comments

* Fix logic for updating discovery keys

* Add tests

* Use mock_config_flow helper in new config_entries test

* Add discovery_keys attribute to ConfigEntry

* Update zeroconf rediscovery

* Change type of ConfigEntry.discovery_keys

* Update tests

* Fix DiscoveryKey.from_json_dict and add tests

* Fix test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 16:49:21 +02:00
dontinelli 41ffa8d6db
Add login and rewrite access to extended data for solarlog ()
* Initial commit

* Add/update tests

* Minor adjustment

* Update data_schema

* Adjust get password

* Set const for has_password, remove deletion of extended_data

* Update diagnostics snapshot

* Correct typo

* Add test for migration from mv 2 to 3

* Adjust migration test
2024-09-20 14:19:45 +02:00
Marc Mueller d3badb88ef
Fix solarlog test RuntimeWarning () 2024-09-08 11:43:50 +02:00
dontinelli d68ee8dcea
Replace _host_in_configuration_exists with async_abort_entries_match in solarlog ()
* Add diagnostics to solarlog

* Fix wrong comment

* Move to async_abort_entries_match

* Remove obsolete method solarlog_entries

* Update tests/components/solarlog/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/solarlog/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/solarlog/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/solarlog/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Amend import of config_entries.SOURCE_USER

* Update tests/components/solarlog/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Ruff

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-09-03 00:38:09 +02:00
dontinelli 7c4fd9473c
Add diagnostics to solarlog ()
* Add diagnostics to solarlog

* Fix wrong comment
2024-09-02 20:08:44 +02:00
dontinelli 5300eddf33
Remove roundig in Solarlog and add suggested_display_precision ()
* Remove roundig and add suggested_display_precision

* Add suggested_unit_of_measurement

* Put lamda in parentheses
2024-09-02 19:50:09 +02:00
dontinelli 1661304f10
Bump solarlog_cli to 0.2.2 ()
* Add inverter-devices

* Minor code adjustments

* Update manifest.json

Seperate dependency upgrade to seperate PR

* Update requirements_all.txt

Seperate dependency upgrade to seperate PR

* Update requirements_test_all.txt

Seperate dependency upgrade to seperate PR

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Split up base class, document SolarLogSensorEntityDescription

* Split up sensor types

* Update snapshot

* Bump solarlog_cli to 0.2.1

* Add strict typing

* Bump fyta_cli to 0.6.3 ()

* Ensure write access to hassrelease data folder ()

Co-authored-by: Robert Resch <robert@resch.dev>

* Update a roborock blocking call to be fully async ()

Remove a blocking call in roborock

* Add inverter-devices

* Split up sensor types

* Update snapshot

* Bump solarlog_cli to 0.2.1

* Backport/rebase

* Tidy up

* Simplyfication coordinator.py

* Minor adjustments

* Ruff

* Bump solarlog_cli to 0.2.2

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/solarlog/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update persentage-values in fixture

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Allen Porter <allen@thebends.org>
2024-09-01 12:47:52 +02:00
dontinelli 20f9b9e412
Add inverter-devices to solarlog ()
* Add inverter-devices

* Minor code adjustments

* Update manifest.json

Seperate dependency upgrade to seperate PR

* Update requirements_all.txt

Seperate dependency upgrade to seperate PR

* Update requirements_test_all.txt

Seperate dependency upgrade to seperate PR

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Split up base class, document SolarLogSensorEntityDescription

* Split up sensor types

* Update snapshot

* Add all devices in config_flow

* Remove options flow

* Move devices in config_entry from options to data

* Correct mock_config_entry

* Minor adjustments

* Remove enabled_devices from config

* Remove obsolete test

* Update snapshot

* Delete obsolete code snips

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Remove obsolete test in setting up sensors

* Update homeassistant/components/solarlog/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/solarlog/entity.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/solarlog/config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Fix typing error

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-08-30 17:03:24 +02:00
epenet 18b49a6f62
Cleanup unused import in solarlog config flow () 2024-08-28 12:59:53 +02:00
epenet f66b539027
Add missing hass type hint in component tests (s) () 2024-08-20 12:53:29 +02:00
Joost Lekkerkerker e8d7eb05ae
Delete unused snapshots ()
* Delete unused snapshots

* Delete unused snapshots
2024-08-12 13:28:09 +02:00
epenet 02dffcde1a
Use common registry fixtures in solarlog () 2024-07-02 12:36:30 +02:00
Marc Mueller 414525503c
Use TypeVar defaults for Generator ()
* Use TypeVar defaults for Generator

* Code review
2024-07-01 14:02:54 +02:00
TheJulianJES 1bebf79e5c
Fix Solarlog snapshot missing self-consumption sensor () 2024-06-21 17:53:05 +02:00
dontinelli a0f81cb401
Add solarlog reconfigure flow () 2024-06-21 13:35:22 +02:00
dontinelli af9f4f310b
Add additional tests for solarlog () 2024-06-21 12:44:25 +02:00
dontinelli 2555827030
Replace Solarlog unmaintained library ()
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-18 09:06:22 +02:00
Joost Lekkerkerker f3ba713289
Use FlowResultType enum in config flow tests N-Z ()
Use FlowResultType enum in config flow tests
2024-04-03 09:53:20 +02:00
Joost Lekkerkerker ee66f6ec8c
Use is in enum comparison in config flow tests P-T () 2024-04-02 11:21:50 -10:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 ()
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
Marc Mueller 7d6251ca08
Add empty line after module docstring [tests q-s] () 2024-03-08 14:47:22 +01:00
epenet 3a9adacdde
Add type hints to integration tests (part 20) () 2023-02-15 15:23:34 +01:00
epenet ba85fdcd61
Add type hints to integration tests (q-s) () 2023-02-08 08:12:54 -08:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum () 2022-07-07 19:57:36 +03:00
Paulus Schoutsen a4d9019ffc
Refactor persistent notification to no longer route all data via a service ()
* 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>
2021-10-07 12:58:00 +02:00
Franck Nijhof af80ca6795
Clean up superfluous integration setup - part 5 () 2021-04-16 09:22:56 -07:00
Franck Nijhof 65cf2fcb6f
Drop asynctest () 2021-01-01 22:31:56 +01:00
Paulus Schoutsen 1c36bf5e19
Fix block till done in create entry config flow tests () 2020-10-24 16:20:56 +02:00
Franck Nijhof 1c2ebdf307
Upgrade black to 20.8b1 () 2020-08-27 13:56:20 +02:00
Paulus Schoutsen ec47216388
Use built-in test helpers on 3.8 () 2020-04-30 13:29:50 -07:00
Paulus Schoutsen 0d700f6a63
Fix tests for Python 3.8 () 2020-04-25 14:32:55 -07:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell ()
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Bas Nijholt 127d84edd1 Sort imports according to PEP8 for solarlog () 2019-12-09 13:11:37 +01:00
Ernst Klamer acc3646ef3 Add Solar-Log platform ()
* Add Solar-Log sensor

* Codeowners update

* Update homeassistant/components/solarlog/manifest.json

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* remove sunwatcher from gen_requirements_all.py

* remove sunwatcher from requirements_test_all.txt

* Remove scan_interval as configuration variable

I've set it to a fixed scan_interval of 1 minute. Removed the configuration option.

* Fix black format

* Config flow added (__init__.py)

* Config flow added (manifest.json)

* Config flow added (const.py)

* Config flow added (config_flow.py)

* Config flow added (strings.json)

* Config flow added (en.json translation)

* Config flow added (sensor.py rewritten)

* Config flow added (sensor.py)

* Config flow added (config_flows.py)

* resolve conflict config_flows.py

* Add tests

* add tests

* add tests

* Update .coverage to include all files for solarlog

* Fix await the unload

* Adjust icons, add http:// to default host

* Change icons

* Add http:// to host if not provided, fix await

* Add http:// to host if not provided, fix await

* Adjust tests for http:// added to host

* remove line

* Remove without http:// requirement

* Remove without http;// requirement
2019-10-22 23:31:43 -07:00