J. Nick Koston
6113b58e9c
Speed up registry indices ( #117897 )
...
* Use defaultdict for registry indices
defaultdict is faster and does not have to create an empty
dict that gets throw away when the key is already present
* Use defaultdict for registry indices
defaultdict is faster and does not have to create an empty
dict that gets throw away when the key is already present
2024-05-22 14:07:39 -04: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
J. Nick Koston
7871e9279b
Adjust thread safety check messages to point to developer docs ( #117392 )
2024-05-14 15:20:31 +02:00
J. Nick Koston
26cc1cd3db
Use singleton helper for registries ( #117027 )
2024-05-07 21:04:01 +02:00
Marc Mueller
fd5885ec83
Use HassKey for registries ( #117000 )
2024-05-07 18:03:14 +02:00
J. Nick Koston
b403c9f92e
Move thread safety check in area_registry sooner ( #116265 )
...
It turns out we have custom components that are writing to the area registry using the async APIs from threads. We now catch it at the point async_fire is called. Instead we should check sooner and use async_fire_internal so we catch the unsafe operation before it can corrupt the registry.
2024-04-27 09:26:35 +02:00
J. Nick Koston
9ca24ab2a2
Avoid linear search to remove labels and floors from area registry ( #115675 )
...
* Avoid linear search to remove labels and floors from area registry
* simplify
2024-04-17 15:45:40 +02:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately ( #115169 )
2024-04-08 10:07:54 -10:00
Marc Mueller
0d18679c8f
Use EventType for remaining registry events ( #115189 )
2024-04-08 08:25:39 -10:00
Marc Mueller
cb9352110c
Improve registry store data typing ( #115066 )
2024-04-06 14:34:49 -10:00
J. Nick Koston
aedfd6c983
Add index for floor/label to the area registry ( #114777 )
2024-04-03 21:04:26 -10:00
Erik Montnemery
d31124d5d4
Avoid creating unneeded Context and Event objects when firing events ( #113798 )
...
* Avoid creating unneeded Context and Event objects when firing events
* Add test
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-20 09:40:06 +01:00
J. Nick Koston
68320b1278
Migrate registry for labels and categories to run_immediately ( #113645 )
2024-03-17 08:16:11 -10:00
Marc Mueller
de886d8c49
Update EventBus listen type signatures ( #112760 )
2024-03-08 21:57:23 +01:00
Marc Mueller
19ab3d6daf
Add empty line after module docstring [helpers + other] ( #112707 )
2024-03-08 10:36:11 -05:00
J. Nick Koston
caefdc6192
Avoid writing registries to disk during startup ( #112662 )
2024-03-07 19:14:42 -10:00
Jan-Philipp Benecke
f31244bac4
Add normalized name registry items base class ( #111666 )
...
* Add normalized name base registry items class
* Add tests
2024-02-29 01:31:33 +01:00
Franck Nijhof
e0a9dcd996
Add label registry ( #110821 )
2024-02-19 11:59:08 +01:00
Franck Nijhof
70d1bbb20d
Improve floor registry event typing ( #110844 )
2024-02-18 14:57:15 +01: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
Jan-Philipp Benecke
ddf02959f4
Bump area registry storage minor version to 4 ( #108798 )
2024-01-24 20:31:43 +01:00
Erik Montnemery
9c727e5ea8
Add icon to areas ( #108650 )
2024-01-24 19:11:03 +01:00
Erik Montnemery
329eca4918
Store area registry entries in a UserDict ( #108656 )
...
* Store area registry entries in a UserDict
* Address review comments
2024-01-23 08:14:28 +01:00
Erik Montnemery
ef5d46c79c
Convert AreaEntry to dataclass ( #108648 )
...
* Convert AreaEntry to dataclass
* Correct typing of AreaEntry.id
* Move responsibility for generating area id to AreaRegistry
2024-01-22 14:45:27 +01:00
Marc Mueller
833cddc8f5
Improve conversation typing ( #106905 )
2024-01-05 18:40:34 +01:00
J. Nick Koston
fba7c6cacd
Remove deprecated async_get_registry ( #91928 )
...
Deprecated in 2021 via #46265 , report was added a year ago in #72088
2023-04-23 23:02:21 -04:00
Marc Mueller
b2bcdf7c19
Update mypy to 1.2.0 ( #90947 )
...
* Update mypy to 1.2.0
* Add type ignore
2023-04-06 12:51:16 -04:00
Franck Nijhof
d4f69a3652
String formatting and max line length - Part 7 ( #84532 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-27 11:18:56 +01:00
Erik Montnemery
1a42bd5c4c
Add aliases to area registry items ( #84294 )
...
* Add aliases to area registry items
* Update test
* Fix WS API
2022-12-21 08:44:44 +01:00
Erik Montnemery
fd9124279b
Add minor version to area registry store ( #84280 )
2022-12-20 11:41:35 +01:00
epenet
16900dcef1
Make Store a generic class ( #74617 )
2022-07-09 22:32:57 +02:00
epenet
99941b1c32
Warn on use of deprecated async_get_registry ( #72088 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-05-18 12:04:06 -07:00
Franck Nijhof
5f44d0f8f9
Clean up accessing storage.Store helper via hass ( #72009 )
2022-05-17 18:45:57 +02:00
Franck Nijhof
287edf9ac0
Fix area name unchanged gets written ( #69813 )
2022-04-11 00:03:01 +03:00
Marc Mueller
240c9979c7
Move `disallow-any-generics` to mypy.ini ( #63917 )
2022-01-11 13:33:25 -08:00
Ruslan Sayfutdinov
55f4962c06
Fix pylint plugin which checks relative imports ( #62693 )
2021-12-23 11:14:47 -08:00
J. Nick Koston
96f7b0d910
Use atomicwrites for mission critical core files ( #59606 )
2021-11-15 11:19:31 +01:00
Marc Mueller
3f1b4906bf
Use assignment expressions 35 ( #58824 )
2021-10-31 18:32:17 +01:00
Paulus Schoutsen
6cd83d1f66
Allow storing picture in area registry ( #58539 )
2021-10-27 10:11:05 -07:00
Marc Mueller
c07646db5d
Update typing syntax ( #49480 )
...
* Update typing syntax
* Replace typing imports with ones from collections where possible
* Changes after review
2021-04-20 17:40:41 +02:00
Franck Nijhof
38d14702fa
Remove HomeAssistantType alias from helpers ( #48400 )
2021-03-27 12:55:24 +01:00
Franck Nijhof
45f77ccccf
Merge of nested IF-IF cases - Core ( #48364 )
2021-03-27 09:23:32 +01:00
Marc Mueller
6fb2e63e49
Update typing 02 ( #48014 )
2021-03-17 18:34:19 +01:00
J. Nick Koston
bb7e4d7daa
Implement suggested_area in the device registry ( #45940 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-02-19 19:34:33 -10:00
Erik Montnemery
f1714dd541
Make some Area and EntityRegistry member functions callbacks ( #46433 )
2021-02-12 17:00:35 +01:00
Erik Montnemery
ed31cc363b
Wait for registries to load at startup ( #46265 )
...
* Wait for registries to load at startup
* Don't decorate new functions with @bind_hass
* Fix typing errors in zwave_js
* Load registries in async_test_home_assistant
* Tweak
* Typo
* Tweak
* Explicitly silence mypy errors
* Fix tests
* Fix more tests
* Fix test
* Improve docstring
* Wait for registries to load
2021-02-11 17:36:19 +01:00
Ville Skyttä
82607977ef
Various type hint improvements ( #46144 )
2021-02-08 11:59:46 +01:00
Paulus Schoutsen
69710cb664
Base area IDs on initial name ( #43804 )
2020-12-01 12:45:56 +01:00
Robert Svensson
e06c8009e1
Add area id to entity registry ( #42221 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-24 21:25:28 +02:00
Philip Allgaier
dde6305549
Cleanup unused loggers (components N-Z + tests) ( #41982 )
2020-10-16 21:24:08 -05:00