Commit Graph

334 Commits (fe010289b4687b4b45dd51ffe43b045a85dca3c1)

Author SHA1 Message Date
Joost Lekkerkerker b4f4b06f29
Enable RUF021 (#135832) 2025-01-17 10:20:45 +01:00
Paulus Schoutsen 5cf56207fe
Add temperature and humidity entities to area registry (#135423)
* Add temperature and humidity entities to area registry

* Fix service test

* Add validation

* ABC

* More ABC

* More ABC 2

* Fix tests

* ABC 3

* ABC 4
2025-01-16 08:25:26 -05:00
Erik Montnemery ecb3bf79f3
Revert "Add support for subentries to config entries" (#133470)
Revert "Add support for subentries to config entries (#117355)"

This reverts commit ad15786115.
2024-12-18 13:51:05 +01:00
Erik Montnemery ad15786115
Add support for subentries to config entries (#117355)
* 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
Erik Montnemery d6ee10a543
Make FlowHandler.context a typed dict (#126291)
* Make FlowHandler.context a typed dict

* Adjust typing

* Adjust typing

* Avoid calling ConfigFlowContext constructor in hot path
2024-10-08 12:18:45 +02:00
Erik Montnemery c5b4892596
Adjust BaseEditConfigView.__init__ (#126729) 2024-09-27 19:08:12 +02:00
Franck Nijhof 9dfabc3fb7
Adjust automation to plural triggers/conditions/actions keys (#123823)
* Adjust automation to plural triggers/conditions/actions keys

* Fix some tests

* Adjust websocket tests

* Fix search tests

* Convert blueprint and blueprint inputs to modern schema

* Pass schema when creating Blueprint object

* Update tests

* Adjust websocket api

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-09-24 20:03:23 +02:00
Erik Montnemery b2982c18bb
Reinitialize zeroconf discovery flow on unignore (#125753)
* 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
epenet 2c210e4b58
Use root import for websocket_api (#125834) 2024-09-12 19:31:57 +02:00
epenet 2fa0f283ea
Add alias to DOMAIN import in config and demo (#125570) 2024-09-10 08:41:47 +02:00
epenet 07c7bb8b2a
Use HOMEASSISTANT_DOMAIN alias for core DOMAIN (#122760) 2024-07-29 13:35:36 +02:00
Robert Resch 545514c5cd
Add created_at/modified_at to category registry (#122454) 2024-07-23 14:39:38 +02:00
Robert Resch 243a68fb1f
Frontend wants a timestamp for the created_at/modified_at attributes (#122377) 2024-07-22 14:10:16 +02:00
Stefan Agner 7b5b6c7b85
Tolerate integration removed device (#120722) 2024-07-19 19:00:31 +02:00
Robert Resch a0b604f98c
Improve add user error messages (#120909) 2024-07-01 18:27:40 +02:00
epenet fd67fe417e
Use ruff to force alias when importing PLATFORM_SCHEMA (#120539) 2024-06-26 14:22:52 +02:00
epenet be7a2c2cc2
Revert "Force alias when importing scene PLATFORM_SCHEMA" (#120540)
Revert "Force alias when importing scene PLATFORM_SCHEMA (#120534)"

This reverts commit 348ceca19f.
2024-06-26 12:40:41 +02:00
epenet 348ceca19f
Force alias when importing scene PLATFORM_SCHEMA (#120534) 2024-06-26 12:11:22 +02:00
Robert Resch 641507a45a
Add change username endpoint (#109057) 2024-06-24 18:51:19 +02:00
Erik Montnemery 7e61ec96e7
Make the radius of the home zone configurable (#119385) 2024-06-15 13:22:01 +02:00
epenet 960d1289ef
Avoid references to websocket_api.const in core and other components (#119285) 2024-06-10 13:49:44 +02:00
epenet 97f6b578c8
Enforce namespace import in core (#118235) 2024-05-27 14:03:00 +02:00
J. Nick Koston 266ce9e268
Cache area registry JSON serialize (#117847)
We already cache the entity and device registry, but since I never
used area until recently I did not have enough to notice that they
were not cached
2024-05-21 09:03:31 -04:00
Marc Mueller b93312b62c
Use PEP 695 for class annotations (1) (#117775) 2024-05-20 10:42:57 +02:00
Sid b456d97e65
Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
Erik Montnemery 7cd0fe3c5f
Don't reload other automations when saving an automation (#80254)
* Only reload modified automation

* Correct check for existing automation

* Add tests

* Remove the new service, improve ReloadServiceHelper

* Revert unneeded changes

* Update tests

* Address review comments

* Improve test coverage

* Address review comments

* Tweak reloader code + add a targetted test

* Apply suggestions from code review

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

* Explain the tests + add more variations

* Fix copy-paste mistake in test

* Rephrase explanation of expected test outcome

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-16 15:58:57 +02:00
Marc Mueller e0f5559c8f
Improve generic event typing [EventComponentLoaded] (#114739) 2024-04-06 14:18:03 +02:00
Franck Nijhof c247534731
Default floor level to None (and allow unsetting it) (#114249) 2024-03-26 18:58:25 +01:00
Marc Mueller efc54971d3
Update empty line formatting after module docstring (#114040) 2024-03-23 00:27:57 +01:00
Franck Nijhof 541d4b78ac
Add WebSocket support for handling labels on areas registry (#113755) 2024-03-18 22:17:13 +01:00
Franck Nijhof e20cc4f8b9
Add WebSocket support for assigning labels to entities (#113757) 2024-03-18 22:03:37 +01:00
Franck Nijhof 51b8ffc69d
Add WebSocket support for handling labels on device registry (#113758) 2024-03-18 21:19:27 +01:00
Franck Nijhof 0e2775667d
Add category registry (#110897)
* Add category registry

* Add entity registry support

* Update homeassistant/components/config/entity_registry.py

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

* Use ulid instead

* Add tests for adding same name in different scopes

* Handle keyerror on update

* Lookup tweak

* Omit categories from entity registry snapshots

* Use base registry

* Update snapshots

* Update snapshots

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-15 13:25:16 +01:00
Franck Nijhof 436c83e8a7
Add theme color support to labels (#113404) 2024-03-15 13:22:06 +01:00
Franck Nijhof 221893c1d7
Add aliases support to floor registry WebSocket API (#113401) 2024-03-14 23:07:07 +01:00
Franck Nijhof 064f96f8fa
Add floor support to areas WebSocket API (#113402) 2024-03-14 12:55:31 +01:00
Marc Mueller ff3a801936
Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +01:00
Marc Mueller f3594c543d
Use KEY_HASS [a-g] (#112609) 2024-03-07 18:09:20 +01:00
J. Nick Koston 3f9dbd3e25
Fix config modules being imported in the event loop (#112462)
* Fix config modules being imported in the event loop

There was a late import in this integration because of the circular import.

The code has been rearranged to avoid the circular imports

* fixes

* fixes

* fix patching

* make eager

* remove unrelated change from this branch
2024-03-05 21:18:57 -05:00
Erik Montnemery 3d3e9900c3
Add TypeVar default for FlowResult (#112345)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-03-05 22:52:11 +01:00
J. Nick Koston 9d7c947d19
Migrate config to use async_get_component (#112160)
The component should always be loaded here but in the rare
case it might not be, we should not block the loop when it
loads
2024-03-04 06:10:44 -05:00
G Johansson 9989a63cdf
Add reconfigure step to config flow (#108794)
* Initial commit reconfigure

* test config config_entries

* Fix reconfigure

* test_config_entries

* review comment

* No reconfigure if reauth ongoing

* Fix tests

* Fix tests

* handle source creating flows

* combine

* No black

* Also check reconfigure in reauth flow

* Fix support

* Add entry id

* reset data entry flow

* Mods

* context data

* reset formatting

* Fix config flow platforms

* Fix tests

* Fix step message

* Handling reconfigure step

* Fix more tests

* Config entries tests

* entry_id always means reconfigure

* Mods

* Remove no longer valid exception

* Fixes

* reset silabs test

* dev reg

* resets

* assist pipeline

* Adjust config_entries

* Fix

* Fixes

* docstrings

* Review comment

* docstring
2024-03-01 12:29:35 +01:00
Franck Nijhof e0a9dcd996
Add label registry (#110821) 2024-02-19 11:59:08 +01:00
J. Nick Koston aab21105da
Convert config entry subscriptions to callback (#110900) 2024-02-18 19:36:53 -06:00
J. Nick Koston 0a01161cdd
Cache JSON representation of ConfigEntry objects (#110823)
* Cache JSON representation of ConfigEntry objects

* fix recursive set

* tweak

* adjust

* order
2024-02-17 20:52:39 -05:00
Franck Nijhof 4570eed6f6
Add floor registry (#110741)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-17 21:21:15 +01:00
J. Nick Koston 0bf95df4d6
Avoid creating tasks to setup ignored and disabled config entries (#110756)
* Avoid creating tasks to setup ignored and disabled config entries

* lint
2024-02-17 10:34:03 +01:00
J. Nick Koston 50770ce436
Refactor config integration to use normal functions for setup (#110750)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-16 18:12:33 -06:00
G Johansson cb776593cf
Make context in data entry flow possible to modify for subclasses (#110561)
* Make context in data entry flow possible to modify for subclasses

* mypy

* Make get_context

* base view

* Review comments

* Remove context from options flow
2024-02-16 15:51:51 +01:00
J. Nick Koston 1608e05be6
Speed up registry config websocket api calls with list comps (#110693)
* Speed up registry config websocket api calls with list comps

list comps are faster than generator expressions, even more so in
python 3.12 since https://peps.python.org/pep-0709/

https://stackoverflow.com/questions/47789/generator-expressions-vs-list-comprehensions/62709748#62709748

* more readable
2024-02-16 07:41:55 +01:00