1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-12 18:09:17 +00:00

518 Commits

Author SHA1 Message Date
J. Nick Koston
f13bdd0da4
Add support for passing though description_placeholders to _abort_if_unique_id_configured () 2025-04-12 07:47:02 -10:00
Erik Montnemery
cf63175232
Abort reauth flows on config entry reload ()
* Abort reauth flows on config entry reload

* Don't cancel reauth when reload is triggered by a reauth flow

* Revert "Don't cancel reauth when reload is triggered by a reauth flow"

This reverts commit f37c75621e99d4c160c2c4adc9b36e52e4cc81ec.

* Don't fail in FlowManager._async_handle_step when the flow was aborted

* Update tplink config flow

* Add tests

* Don't allow create_entry from an aborted flow

* Add comment

* Adjust after merge with dev
2025-04-10 20:55:34 +02:00
Erik Montnemery
7cbcb21e80
Revert "Don't create repairs asking user to remove duplicate flipr config entries" ()
Revert "Don't create repairs asking user to remove duplicate flipr config ent…"

This reverts commit 536e6868923ae7956f06b90baeb8f5bb1f15dfb1.
2025-04-10 19:50:50 +02:00
Erik Montnemery
eee6e8a2c3
Add WS command config_entries/flow/subscribe () 2025-04-10 16:58:46 +02:00
Erik Montnemery
f344314762
Abort if a flow is removed during a step ()
* Abort if a flow is removed during a step

* Reorganize code

* Only call _set_pending_import_done if an entry is created

* Try a new approach

* Add tests

* Update tests
2025-04-09 07:04:41 -10:00
Erik Montnemery
170e6bdcab
Protect hass data keys in setup.py () 2025-04-09 15:27:52 +02:00
Erik Montnemery
33fa8df73e
Remove ConfigEntriesFlowManager.async_post_init ()
Remove ConfigEntriesFlowManager.async_post_init
2025-04-07 13:28:09 +02:00
Erik Montnemery
b7bc9607a2
Fix lying comment in ConfigEntriesFlowManager.async_finish_flow () 2025-04-03 10:21:26 +02:00
J. Nick Koston
0b61b62334
Avoid logging a warning when replacing an ignored config entry ()
Replacing an ignored config entry with one from the user
flow should not generate a warning. We should only warn
if we are replacing a usable config entry.

Followup to adjust the warning added in 
cc @epenet
2025-04-03 09:38:50 +02:00
Erik Montnemery
6e6f10c085
Don't create persistent notification when starting discovery flow ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2025-03-31 14:42:58 +02:00
Erik Montnemery
ab9d29bf9d
Remove reauth persistent notification ()
* Remove persistent notification created when starting reauth

* Update netatmo tests
2025-03-24 09:29:14 +01:00
Pieter Viljoen
d65392a374
ConfigSubEntryFlow _get_reconfigure_entry() -> _get_entry() ()
* ConfigSubEntryFlow _get_reconfigure_entry() -> _get_entry()

* Update MQTT test

* Fix test_config_entries

* Minimize changes to keep existing tests working

* Re-revert and update negative test instead
2025-03-24 09:24:43 +01:00
Erik Montnemery
290dab25bf
Don't raise in ConfigFlow.async_set_unique_id if the other flow is a reauth flow ()
* Don't raise in ConfigFlow.async_set_unique_id if the other flow is a reauth flow

* Improve test
2025-03-17 09:04:30 -10:00
epenet
3edc7913de
Fix blog post link in comment () 2025-03-01 13:06:10 +01:00
epenet
030a1460de
Log a warning when replacing existing config entry with same unique id ()
* Log a warning when replacing existing config entry with same unique id

* Exclude mobile_app

* Ignore custom integrations

* Apply suggestions from code review

* Apply suggestions from code review

* Update config_entries.py

* Fix handler

* Adjust and add tests

* Apply suggestions from code review

* Apply suggestions from code review

* Update comment

* Update config_entries.py

* Apply suggestions from code review
2025-02-28 14:20:39 +01:00
Josef Zweck
e59ec8f867
Add ability to get callback when a config entry state changes ()
* Add entry_on_state_change_helper

* undo black

* remove unload

* no coro

* Add tests

* Don't accept coro

* Review feedback

* Add error test

* Make it callback type

* Make it callback type

* Removal test

* change type
2025-02-21 11:55:56 +01:00
Erik Montnemery
e0795e6d07
Improve config entry state transitions when unloading and removing entries ()
* Improve config entry state transitions when unloading and removing entries

* Update integrations which check for a single loaded entry

* Update tests checking state after unload fails

* Update homeassistant/config_entries.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-17 18:16:57 +01:00
Erik Montnemery
6abf7b525a
Improve test coverage of config subentries and fix related issues ()
Improve test coverage of config subentries
2025-02-11 21:46:56 +01:00
Erik Montnemery
4b34d1bbb5
Merge config subentry feature branch to dev ()
* Reapply "Add support for subentries to config entries" () ()

* Reapply "Add support for subentries to config entries" ()

This reverts commit ecb3bf79f32a2e25d141ff467e5958826ed9fc3a.

* Update test snapshot

* Add config subentry support to device registry ()

* Add config subentry support to device registry

* Apply suggestions from code review

* Update syrupy serializer

* Update snapshots

* Address review comments

* Allow a device to be connected to no or a single subentry of a config entry

* Update snapshots

* Revert "Allow a device to be connected to no or a single subentry of a config entry"

This reverts commit ec6f613151cb4a806b7961033c004b71b76510c2.

* Update test snapshots

* Bump release version in comments

* Rename config_subentries to config_entries_subentries

* Add config subentry support to entity registry ()

* Add config subentry support to entity registry

* Update syrupy serializer

* Update snapshots

* Update snapshots

* Accept suggested changes

* Clean registries when removing subentry ()

* Clean up registries when removing subentry

* Update tests

* Clean up subentries from deleted devices when removing config entry ()

* Clean up subentries from deleted devices when removing config entry

* Move

* Add config subentry support to entity platform ()

* Add config subentry support to entity platform

* Rename subentry_id to config_subentry_id

* Store subentry type in subentry ()

* Add reconfigure support to config subentries ()

* Add reconfigure support to config subentries

* Update test

* Minor adjustment

* Rename supported_subentry_flows to supported_subentry_types

* Address review comments

* Add subentry support to kitchen sink ()

* Add subentry support to kitchen sink

* Add subentry reconfigure support to kitchen_sink

* Update kitchen_sink tests with subentry type stored in config entry

* Update kitchen_sink

* Update kitchen_sink

* Adjust kitchen sink tests

* Fix hassfest

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Improve docstrings and strings.json

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-10 16:40:07 +01:00
Ville Skyttä
40eb8b91cc
Adjust to recommended propcache.api import paths () 2025-01-21 10:58:22 +01:00
Marc Mueller
46b17b539c
Use new syntax for TypeVar defaults () 2025-01-17 09:12:52 +01:00
epenet
e83ee00af8
Move UsbServiceInfo to service_info helpers ()
* Move UsbServiceInfo to service_info helpers

* Adjust components
2025-01-15 15:10:25 +01:00
epenet
8c13daf6d9
Move SsdpServiceInfo to service_info helpers ()
* Move SsdpServiceInfo to service_info helpers

* docstring

* Move string constants

* Adjust components
2025-01-15 15:00:27 +02:00
epenet
31c36beb2e
Move DhcpServiceInfo to service_info helpers ()
* Move DhcpServiceInfo to service_info helpers

* Fix mypy/pylint
2025-01-15 13:09:18 +01:00
epenet
b046ca9abe
Move ZeroconfServiceInfo to service_info helpers ()
* Move ZeroconfServiceInfo to service_info helpers

* Adjust deprecation date

* Fix mypy/pylint

* Fix DeprecatedConstant

* Add deprecation test

* Adjust

* Also deprecate ATTR_PROPERTIES_ID
2025-01-15 12:25:42 +01:00
Franck Nijhof
60bdc13c94
Drop Python 3.12 support () 2025-01-14 16:23:15 +01:00
tronikos
f7df214dd8
Fix config entries typo s/entruis/entries/ ()
Fix typo s/entruis/entries/
2025-01-12 11:07:45 +01:00
epenet
5df7092f41
Improve formatting in core files ()
* Adjust core files formatting

* Adjust translations script
2025-01-10 09:08:37 +01:00
Erik Montnemery
ecb3bf79f3
Revert "Add support for subentries to config entries" ()
Revert "Add support for subentries to config entries ()"

This reverts commit ad15786115673c5b3fe40ea2f5d61b4b896f433e.
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
epenet
7ba3ce67f1
Use short namespace for dr and er in config_entries () 2024-11-24 00:12:40 +01:00
epenet
b11d951ed7
Add ability to get config_entry as required ()
* Add ability to get config_entry as required

* One more

* Use new API
2024-11-23 22:26:16 +01:00
Erik Montnemery
23acc31616
Improve comments in ConfigEntriesFlowManager.async_finish_flow () 2024-11-21 16:33:43 +01:00
epenet
9add3a6c9b
Add ability to pass integration domain to report_usage ()
* Add ability to pass integration domain to report_usage

* Adjust

* Fix

* Add tests

* Update test_frame.py

* Update test_frame.py

* Update test_frame.py

* Update test_frame.py

* Update test_frame.py

* Update test_frame.py

* Finish tests

* Docstring

* Replace logger warning with report_usage

* Improve

* docstring

* Improve tests

* Adjust docstring for exclude_integrations

* Fix behavior and improve tests
2024-11-21 16:01:36 +01:00
epenet
deeb55ac50
Add ability to set HA breaking version in report_usage ()
* Add ability to set breaking version in report_usage

* Adjust tests

* Adjust test

* Adjust tests

* Rename breaks_in_version => breaks_in_ha_version
2024-11-20 21:41:57 +01:00
epenet
e772eef035
Prevent None strings in description_placeholders () 2024-11-15 14:39:57 +01:00
epenet
600f83ddab
Finish migration from report to report_usage () 2024-11-15 12:35:50 +01:00
epenet
f1ce7ee8ce
Adjust logging for OptionsFlow deprecation () 2024-11-11 21:02:09 +01:00
epenet
353ccf3ea7
Only apply OptionsFlowWithConfigEntry deprecation to core ()
* Only apply OptionsFlowWithConfigEntry deprecation to core

* Fix match string in pytest.raises

* Improve coverage
2024-11-08 15:55:19 +01:00
Erik Montnemery
2b7d593ebe
Avoid collision when replacing existing config entry with same unique id () 2024-11-08 07:45:16 +01:00
Erik Montnemery
536e686892
Don't create repairs asking user to remove duplicate flipr config entries ()
* Don't create repairs asking user to remove duplicate flipr config entries

* Improve comments
2024-11-07 17:38:10 +01:00
Erik Montnemery
c5e3ba536c
Don't create repairs asking user to remove duplicate ignored config entries () 2024-11-07 17:07:23 +01:00
epenet
03d5b18974
Remove options property from OptionFlow ()
* Remove options property from OptionFlow

* Update test_config_entries.py

* Partial revert of "Remove deprecated property setters in option flows ()"

* Partial revert "Use new helper properties in crownstone options flow ()"

* Restore onewire init

* Restore onvif

* Restore roborock

* Use deepcopy in onewire

* Restore steam_online

* Restore initial options property in OptionsFlowWithConfigEntry

* re-add options property in SchemaOptionsFlowHandler

* Restore test

* Cleanup
2024-11-06 23:28:01 +01:00
epenet
79901cede9
Drop initialize_options helper from OptionsFlow () 2024-11-05 12:02:33 +01:00
epenet
d180ff417d
Cleanup deprecated OptionsFlowWithConfigEntry (part 3) () 2024-11-04 18:55:01 +01:00
Erik Montnemery
4ac35d40cd
Fix create flow logic for single config entry integrations ()
* Fix create flow logic for single config entry integrations

* Adjust MQTT test
2024-11-04 15:45:29 +01:00
Erik Montnemery
4784199038
Fix aborting flows for single config entry integrations () 2024-11-04 13:59:10 +01:00
epenet
89eb395e2d
Add OptionsFlow helper for a mutable copy of the config entry options ()
* Add OptionsFlow helper for a mutable copy of the config entry options

* Add tests

* Improve coverage

* error_if_core=False

* Adjust report

* Avoid mutli-line ternary
2024-11-03 20:37:58 +01:00
epenet
ab5b9dbdc9
Add OptionsFlow helpers to get the current config entry ()
* Add OptionsFlow helpers to get the current config entry

* Add tests

* Improve

* Add ValueError to indicate that the config entry is not available in `__init__` method

* Use a property

* Update config_entries.py

* Update config_entries.py

* Update config_entries.py

* Add a property setter for compatibility

* Add report

* Update config_flow.py

* Add tests

* Update test_config_entries.py
2024-11-01 12:54:35 +01:00
epenet
b626c9b450
Ensure entry_id is set on reauth/reconfigure flows ()
* Ensure entry_id is set on reauth/reconfigure flows

* Improve

* Improve

* Use report helper

* Adjust deprecation date

* Update config_entries.py

* Improve message and adjust tests

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-11-01 10:29:58 +01:00