Marc Mueller
42008c50f3
Enable error-code `truthy-iterable` [mypy 1.0] ( #87596 )
2023-02-07 11:16:22 +01:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 ( #87188 )
2023-02-02 18:35:24 +01:00
Franck Nijhof
06a35fb7db
Code styling tweaks to core helpers ( #85441 )
2023-01-08 13:44:09 -10: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
8e617bbc1d
Add `translation_key` property to entites ( #82701 )
...
* Add translation_key attribute to entity state
* Update accuweather test
* Index entity translation keys by platform
* Store translation key in entity registry
2022-12-01 09:34:09 +01:00
Erik Montnemery
6979cd95b0
Add suggested_unit_of_measurement attribute to sensors ( #80638 )
...
* Add suggested_unit_of_measurement attribute to sensors
* Lazy calculation of initial entity options
* Add type alias for entity options
* Small tweak
* Add tests
* Store suggested_unit_of_measurement in its own option key
* Adapt to renaming of IMPERIAL_SYSTEM
* Fix rebase mistakes
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-10-24 16:08:02 +02:00
Erik Montnemery
e332091d76
Improve unique_id collision checks in entity_platform ( #78132 )
2022-09-09 14:35:23 +02:00
Marc Mueller
8a48d54951
Improve entity_platform helper typing ( #75464 )
...
* Improve entity_platform helper typing
* Add protocol class
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-07-20 05:45:57 +02:00
Erik Montnemery
2e228b2608
Tweak handling of entities with `has_entity_name` set ( #74948 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-07-11 15:10:53 -07:00
Erik Montnemery
00810235c9
Track tasks adding entities ( #73828 )
...
* Track tasks adding entities
* Update homeassistant/config_entries.py
* fix cast tests
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-06-29 09:38:35 +02:00
Erik Montnemery
26a85c6644
Add Entity.has_entity_name attribute ( #73217 )
2022-06-28 09:38:05 -07:00
Paulus Schoutsen
3b88c6c012
Inverse parallel updates default check, follow sync "update" method ( #71720 )
2022-05-16 17:10:34 -07:00
Erik Montnemery
1aaf78ef99
Remove entity category system in favor of hidden_by ( #68550 )
2022-05-02 09:33:16 -07:00
Erik Montnemery
c5d69ab1b2
Handle removed entites in collection.sync_entity_lifecycle ( #70759 )
...
* Handle removed entites in collection.sync_entity_lifecycle
* Add comment
2022-04-27 08:05:00 -07:00
Franck Nijhof
7b75a16745
Add visible by default property to base Entity ( #70370 )
2022-04-21 22:06:34 -07:00
Marc Mueller
41df798375
Bump mypy to 0.940 ( #68007 )
2022-03-11 15:57:38 -08:00
Marc Mueller
30e2411761
Add type ignore error codes [last ones] ( #66816 )
2022-02-18 18:15:57 +01:00
J. Nick Koston
a40549c1b9
Fix hw_version not updating from an entity device_info ( #62254 )
2021-12-18 21:53:49 -08:00
Marvin Wichmann
707fe67c00
Move StrEnum to homeassistant.backports and move Platform to homeassistant.const ( #60880 )
...
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-12-03 09:31:17 +01:00
Franck Nijhof
c8b0a3b667
Revert "Move Platform StrEnum to const" ( #60875 )
2021-12-02 14:19:08 -08:00
Franck Nijhof
6e220d5d17
Move Platform StrEnum to const ( #60857 )
2021-12-02 22:30:52 +01:00
Franck Nijhof
7d3fcfbd30
Add Platform StrEnum to entity_platform ( #60818 )
2021-12-02 09:07:09 -08:00
Ville Skyttä
4107063a5a
Make entity registry disabled_by an enum ( #60424 )
2021-12-02 18:02:29 +01:00
Joakim Plate
c54ca7941f
Make sure entity inherit disabled device ( #60469 )
2021-12-01 13:59:57 -08:00
Erik Montnemery
49a27e12ad
Add support to entity registry for overriding device_class ( #59985 )
2021-11-22 08:38:06 -08:00
Erik Montnemery
1609c0cc2c
Sort some entity_registry code ( #59876 )
...
* Sort some entity_registry code
* Sort some more entity_registry code
* Tweak
2021-11-18 11:51:32 +01:00
Jesse Hills
ea028e38d5
Allow configuration_url to be removed/nullified from device registry ( #58564 )
...
* Allow configuration_url to be removed from device registry
* Add test
* Check for None before stringifying and url parsing
* Add type to dict to remove mypy error on assigning None
2021-10-28 12:11:54 +02:00
Joakim Sørensen
d16304a201
Allow homeassistant prefix for device info configuration url ( #58414 )
...
* Allow panel prefix for device info configuration url
* Add to add-ons
* Use homeassistant as the prefix
* Update homeassistant/components/hassio/__init__.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-26 10:34:02 +02:00
Marc Mueller
238b488642
Use assignment expressions 03 ( #57710 )
2021-10-17 20:08:11 +02:00
Paulus Schoutsen
7546c766dd
Fix lint issue ( #57694 )
2021-10-14 12:03:39 -07:00
Erik Montnemery
e27e4c3561
Add support for device configuration URL ( #57539 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-14 11:16:56 -07:00
Robert Hillis
488a636aec
Clean up unused loggers ( #57662 )
2021-10-14 10:03:38 -07:00
Erik Montnemery
4b3d423767
Add config and diagnostic entities ( #57528 )
...
* Add config entity concept
* Rename is_config_entity to entity_category
* Add test
* Add 'diagnostic' entity category
2021-10-14 10:04:26 +02:00
Erik Montnemery
bdbedd0f06
Alphabetize parts of device registry code ( #57532 )
2021-10-12 12:08:59 +02:00
Marc Mueller
77ee72cbb9
Import Callable from collections.abc (1) ( #56775 )
2021-09-29 16:32:11 +02:00
Marc Mueller
5d2e5d2612
Import Protocol from typing ( #52848 )
2021-07-12 10:35:17 +02:00
Shay Levy
ab73ce00a0
Change "Not adding entity" log level to debug ( #52240 )
2021-06-28 11:22:10 +02:00
Paulus Schoutsen
ee2c950716
Merge system options into pref properties ( #51347 )
...
* Make system options future proof
* Update tests
* Add types
2021-06-01 22:34:31 +02:00
Paulus Schoutsen
4821484d2c
Add system option to disable polling ( #51299 )
2021-05-31 15:36:40 -07:00
Ruslan Sayfutdinov
391b2f8ccd
Add missing return type in Core constructors ( #50884 )
2021-05-20 18:53:29 +03:00
Ruslan Sayfutdinov
0cb08f9516
Add missing type hints in entity_platform ( #50453 )
2021-05-12 16:28:44 +02:00
Franck Nijhof
efb1bb08a4
Add small async_get_current_platform helper method ( #50014 )
2021-05-03 16:46:42 +02:00
Franck Nijhof
378cee01b4
Add typing to async_register_entity_service ( #50015 )
2021-05-03 14:22:38 +02:00
Ruslan Sayfutdinov
0301706fc6
Define AddEntitiesCallback type ( #49812 )
2021-04-29 12:28:14 +02:00
J. Nick Koston
3fa8ffa731
Enable mccabe complexity checks in flake8 ( #49616 )
...
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-04-25 12:38:40 +02: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
J. Nick Koston
44beff31c2
Cancel config entry retry, platform retry, and polling at the stop event ( #49138 )
2021-04-13 16:16:26 -10:00
Raman Gupta
769923e8dd
Raise exception for invalid call to DeviceRegistry.async_get_or_create ( #49038 )
...
* Raise exception instead of returning None for DeviceRegistry.async_get_or_create
* fix entity_platform logic
2021-04-13 14:18:51 +02:00
J. Nick Koston
4cd7f9bd8b
Raise ConfigEntryAuthFailed during setup or coordinator update to start reauth ( #48962 )
2021-04-09 19:41:29 -10:00
J. Nick Koston
12e3bc8101
Provide api to see which integrations are being loaded ( #48274 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-04 22:11:44 -10:00