Erik Montnemery
d1afcd773f
Revert "Cache entity properties that are never expected to change in the base class" ( #100422 )
...
Revert "Cache entity properties that are never expected to change in the base class (#95315 )"
This reverts commit 042776ebb8
.
2023-09-15 11:25:24 +02:00
J. Nick Koston
042776ebb8
Cache entity properties that are never expected to change in the base class ( #95315 )
2023-09-14 17:48:48 -05:00
Erik Montnemery
bbcbb2e322
Improve Entity._suggest_report_issue ( #100204 )
2023-09-12 21:07:32 +02:00
Erik Montnemery
51576b7214
Improve typing of entity.entity_sources ( #99407 )
...
* Improve typing of entity.entity_sources
* Calculate entity info source when generating WS response
* Adjust typing
* Update tests
2023-09-12 20:41:26 +02:00
Erik Montnemery
709ce7e0af
Set state of entity with invalid state to unknown ( #99452 )
...
* Set state of entity with invalid state to unknown
* Add test
* Apply suggestions from code review
Co-authored-by: Robert Resch <robert@resch.dev>
* Update test_entity.py
---------
Co-authored-by: Robert Resch <robert@resch.dev>
2023-09-04 14:09:51 +02:00
Erik Montnemery
c7b4d4f361
Adjust helpers tests which create devices ( #98214 )
2023-08-10 19:28:16 +02:00
Erik Montnemery
614f3c6a15
Move device info validation to device registry ( #96465 )
...
* Move device info validation to device registry
* Don't move DeviceInfo
* Fix type annotation
* Don't block adding device for unknown config entry
* Fix test
* Remove use of locals()
* Improve error message
2023-07-14 08:55:17 -04:00
Jan Bouwhuis
b9c7e7c15e
Fix not including device_name in friendly name if it is None ( #95485 )
...
* Omit device_name in friendly name if it is None
* Fix test
2023-07-06 11:14:09 -04:00
J. Nick Koston
9051750add
Cache entity translation lookups and keys ( #95180 )
2023-06-25 08:50:48 -05:00
Franck Nijhof
e2f5a707ce
Fix use_device_name in case device device class translations are used ( #95010 )
...
Co-authored-by: Erik <erik@montnemery.com>
2023-06-22 11:30:19 +02:00
Erik Montnemery
334dacc322
Change Entity.name default to UNDEFINED ( #94574 )
...
* Change Entity.name default to UNDEFINED
* Update typing
* Update Pylint plugin
* Update TTS test
2023-06-15 11:09:53 +02:00
Erik Montnemery
d51982f12f
Add missing assert to test_async_remove_ignores_in_flight_polling ( #94487 )
2023-06-12 21:48:12 +02:00
Erik Montnemery
59f5b8f2d6
Remove unneeded checks for Entity.platform ( #94321 )
...
* Remove unneeded checks for Entity.platform
* Update tests
* Prevent breaking integrations without an EntityComponent
* Warn when entity has no platform
2023-06-09 15:17:41 +02:00
Erik Montnemery
59c6220b7c
Subscribe to device registry changes from entities ( #93601 )
...
* Subscribe to device registry changes from entities
* Use async_track_device_registry_updated_event
* Fix unsubscribe
* Fix logic, add tests
2023-05-31 11:01:55 +02:00
J. Nick Koston
4c3e98b77c
Fix parallel_updates being acquired too late for entity executor jobs ( #92681 )
...
* Fix parallel_updates being acquired too late for entity executor jobs
* tweak
2023-05-06 16:46:00 +02:00
Franck Nijhof
32344a8488
Fix incorrect warn of async_update_ha_state use ( #91387 )
2023-04-13 22:39:03 +02:00
Franck Nijhof
22a1a6846d
Warn for unneeded use of async_update_ha_state ( #91372 )
2023-04-13 13:49:56 -04:00
Franck Nijhof
d320c73fb7
Use async_write_ha_state in tests ( #91333 )
2023-04-13 12:36:36 +02:00
epenet
46a5aa71ec
Add type hints to helper tests ( #89784 )
2023-03-16 11:10:56 +01:00
epenet
5f25b71df7
Add type hints to core tests ( #88478 )
2023-02-20 11:42:56 +01:00
Franck Nijhof
ed79265843
Enable Ruff PT006 ( #88165 )
...
* Enable Ruff PT006
* Adjust existing cases
* Fix tests
* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Franck Nijhof
80bf632e2d
Clean up unnecessary registry mocks from helpers ( #87734 )
2023-02-08 20:15:29 -05:00
epenet
c98b4e3204
Add typing to tests with single hass argument (2) ( #87675 )
...
* Add typing to tests with single hass argument (2)
* a few more
2023-02-08 08:51:43 +01:00
epenet
4142f0d15d
Add return type to tests without arguments ( #87613 )
...
* Add return type to tests without arguments
* Black
* Cancel fixture amends
2023-02-07 14:20:06 +01:00
epenet
aa00114c2f
Add return type to async tests without arguments ( #87612 )
2023-02-07 10:26:56 +01:00
Paulus Schoutsen
a090652560
Use correct state in Entity repr and output similar value to State class ( #87519 )
...
* Use correct state in Entity repr
* Test Entity.__repr__
* Align with State class
2023-02-06 13:35:36 -05:00
Franck Nijhof
5e81d28116
Update black to 23.1.0 ( #87188 )
2023-02-02 18:35:24 +01:00
epenet
30bf0634fe
Add per-file-ignore to pylint ( #86289 )
2023-01-22 17:26:24 +01:00
Paulus Schoutsen
9ed629d838
Fix some pytest warning for helpers ( #85283 )
2023-01-06 09:21:46 +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
Franck Nijhof
7adb0f0ef5
Custom component -> Custom integration ( #75404 )
2022-07-18 22:10:22 +02:00
Erik Montnemery
26a85c6644
Add Entity.has_entity_name attribute ( #73217 )
2022-06-28 09:38:05 -07:00
Erik Montnemery
921245a490
Remove deprecated temperature conversion of non sensors ( #73222 )
2022-06-08 20:47:47 +02:00
Erik Montnemery
1aaf78ef99
Remove entity category system in favor of hidden_by ( #68550 )
2022-05-02 09:33:16 -07:00
Paulus Schoutsen
5317bf02e6
Fix hidden default ( #70699 )
2022-04-25 10:10:42 -07:00
epenet
4c7e1fe060
Cleanup ENTITY_CATEGORIES_SCHEMA ( #66549 )
...
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-04-01 09:40:43 -07:00
Erik Montnemery
69ee4cd978
Deprecate temperature conversion in base entity class ( #68978 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-31 14:29:44 -07:00
J. Nick Koston
a75bbc79a2
Prevent polling from recreating an entity after removal ( #67750 )
2022-03-07 20:42:16 -08:00
Erik Montnemery
911e488d48
Fix ENTITY_CATEGORIES_SCHEMA ( #66108 )
...
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-08 14:00:53 -08:00
Ville Skyttä
5bf67cac66
Use RegistryEntryDisabler ( #60436 )
2021-12-15 23:25:40 +02:00
Franck Nijhof
c28b45cd83
Migrate entity categories to StrEnum ( #60720 )
2021-12-01 13:54:36 +01: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
Franck Nijhof
13db867c1d
Move attribution attribute to Entity base class ( #57492 )
2021-10-11 23:15:32 +02:00
Erik Montnemery
6954614e62
Warn if total_increasing sensor has negative states ( #56564 )
2021-09-30 07:49:16 -07:00
Erik Montnemery
d2fd504442
Limit precision when stringifying float states ( #48822 )
...
* Limit precision when stringifying float states
* Add test
* Fix typing
* Move StateType
* Update
* Move conversion to entity helper
* Address review comments
* Tweak precision
* Tweak
* Make _stringify_state an instance method
2021-04-27 21:48:24 +02:00
Ville Skyttä
a396619251
Use disabled_by constants ( #49584 )
...
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-23 09:56:42 +02:00
Erik Montnemery
7e4be921a8
Add helper to get an entity's supported features ( #48825 )
...
* Add helper to check entity's supported features
* Move get_supported_features to helpers/entity.py, add tests
* Fix error handling and improve tests
2021-04-10 08:19:16 +02:00
Paulus Schoutsen
9e07910ab0
Mark entities as unavailable when they are removed but are still registered ( #45528 )
...
* Mark entities as unavailable when they are removed but are still registered
* Add sync_entity_lifecycle to collection helper
* Remove debug print
* Lint
* Fix tests
* Fix tests
* Update zha
* Update zone
* Fix tests
* Update hyperion
* Update rfxtrx
* Fix tests
* Pass force_remove=True from integrations
Co-authored-by: Erik <erik@montnemery.com>
2021-02-08 10:45:46 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest ( #44746 )
2021-01-01 22:31:56 +01:00
J. Nick Koston
f50976a0b3
Switch to asyncio.wait for slow update warning implementation ( #41184 )
2020-10-05 15:28:15 +02:00