Commit Graph

251 Commits (127eca3c35f07fa9732cf5525092d1491a44393f)

Author SHA1 Message Date
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
Bram Kragten 573320a0b4
Add country to detect location info (#82941) 2022-11-29 13:52:49 -05:00
Erik Montnemery e1338adf1a
Allow configuring country and language in core config (#81734)
* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-11-24 23:25:50 +01:00
Erik Montnemery 25d54f407e
Fix race when deleting a scene (#81896) 2022-11-10 17:27:26 +01:00
Erik Montnemery 2f9982d1c7
Fix race when deleting a script (#81897) 2022-11-10 17:27:14 +01:00
epenet 2c43606922
Add websocket type hints in components (#80654)
* Add websocket type hints in components

* Adjust

* Apply suggestion

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2022-10-20 13:41:14 +02:00
epenet b23a66d776
Add websocket type hints in entity_registry (#80657)
* Add websocket type hints in entity_registry

* Adjust websocket_list_entities

* Fix update

* Fix websocket_update_entity

* Apply suggestion

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

* Apply suggestion

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-10-20 12:20:39 +02:00
epenet 67d1dde69f
Rename IMPERIAL_SYSTEM to US_CUSTOMARY_SYSTEM (#80253)
* Rename IMPERIAL_SYSTEM

* Deprecate is_metric property and adjust tests

* Adjust unit_system config validation

* Add yaml tests

* Add tests for private name

* Fix incorrect rebase

* Adjust docstring

* Add store migration

* Update unit_system.py

* Minimise test tweaks

* Fix tests

* Add conversion to migration

* Rename new key and adjust tests

* Adjust websocket_detect_config

* Move original_unit_system tracking to subclass
2022-10-19 13:31:08 +02:00
Franck Nijhof c4bbc439a5
Integrations v2.1: Differentiating hubs, devices and services (#80524)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-10-19 12:41:43 +02:00
epenet 971ac015e7
Add websocket type hints in config (#80532) 2022-10-18 22:15:55 -04:00
epenet 5442d6af01
Improve msg type hint in websocket commands (#80530) 2022-10-18 16:41:17 +02:00
epenet bff5d1123f
Deprecate CONF_UNIT_SYSTEM_*** constants (#80320)
* Deprecate CONF_UNIT_SYSTEM_*** constants

* Adjust pylint plugin

* Add tests

* Remove single-use function

* Revert logic change

* Revert "Revert logic change"

This reverts commit 60959a0050.

* Tweak again
2022-10-14 16:50:04 +02:00
Franck Nijhof 2b27cfdabb
Set system & entity integration types (#79593) 2022-10-04 10:36:42 -04:00
Erik Montnemery c38b1e7727
Improve check of new_entity_id in entity_registry.async_update_entity (#78276)
* Improve check of new_entity_id in entity_registry.async_update_entity

* Fix race in rfxtrx config flow

* Make sure Event is created on time

* Rename poorly named variable

* Fix typing

* Correct typing of _handle_state_change
2022-09-28 08:43:58 +02:00
Erik Montnemery 53263ea9bc
Revert "Add serial_number to device registry entries" (#79139) 2022-09-27 16:36:38 +02:00
Erik Montnemery cba3b6ad94
Add serial_number to device registry entries (#77713) 2022-09-27 09:08:54 +02:00
Bram Kragten 7e9be812ca
Add unique id to entity reg list response (#78945)
* Add unique id to entity reg list response

* Update test_entity_registry.py
2022-09-27 08:25:56 +02:00
epenet 13f250319d
Import websocket api constants from root (#78250) 2022-09-12 22:07:58 -04:00
J. Nick Koston 016a59ac94
Add support for subscribing to config entry changes (#77803) 2022-09-04 22:57:43 -05:00
Erik Montnemery 8924725d69
Improve some device registry tests (#77659) 2022-09-02 08:54:02 +02:00
Erik Montnemery d65eaf11f4
Include entity registry id in entity registry WS API (#77668) 2022-09-01 11:51:27 -04:00
Paulus Schoutsen 14f68ec1a9
Store redirect URI in context instead of asking each time (#77380)
* Store redirect URI in context instead of asking each time

* Fix tests
2022-08-29 19:28:42 -04: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
J. Nick Koston ce35324e73
Cache the response from config/entity_registry/list (#74443) 2022-07-05 21:11:51 -07:00
J. Nick Koston 3875fc5953
Cache the response from config/device_registry/list (#74483) 2022-07-05 21:08:39 -07:00
J. Nick Koston 810b2a2bd6
Inline building entity registry dict (#74378) 2022-07-04 00:36:42 -05:00
Erik Montnemery 26a85c6644
Add Entity.has_entity_name attribute (#73217) 2022-06-28 09:38:05 -07:00
J. Nick Koston adf0f62963
Add websocket api to fetch config entries (#73570)
* Add websocket api to fetch config entries

* add coverage for failure case
2022-06-21 20:09:22 +02:00
epenet f91aa33c5f
Add FlowResultType enum to data entry flow (#72955) 2022-06-07 22:02:44 -07:00
Erik Montnemery 546ba8169d
Remove entity registry entries when script is removed (#71193) 2022-05-02 13:15:19 +02:00
Marc Mueller 9b9b553521
Disable no-self-use [pylint] (#70641)
* Disable no-self-use

* Remove disable comments
2022-04-25 07:41:01 -07:00
Bram Kragten 89daf4f96b
Handle config entries of integrations that are removed (#68928) 2022-03-30 14:35:12 -07:00
Erik Montnemery 91f6e58e9a
Allow customizing unit for temperature and pressure sensors (#64366)
* Allow customizing unit for temperature and pressure sensors

* pylint

* Adjust google_wifi tests

* Address review comments and add tests

* Improve rounding when scaling

* Tweak rounding

* Further tweak rounding

* Allow setting entity options with config/entity_registry/update

* Address review comments

* Tweak tests

* Load custom unit when sensor is added

* Override async_internal_added_to_hass

* Adjust tests after rebase

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Address review comments

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-30 15:43:04 +02:00
Paulus Schoutsen 3213091b8d
Add integration type (#68349) 2022-03-20 20:38:13 -07:00
Franck Nijhof 2686be921c
Remove deprecated (old) Z-Wave integration (#67221)
* Remove deprecated (old) Z-Wave integration

* Mark migration tests as skip, for later cleanup
2022-03-18 13:09:10 +01:00
Erik Montnemery 314175135f
Hide switch_as_x tracked entity (#67949)
* Hide switch_as_x tracked entity

* Hide wrapped switch during config flow

* Allow setting/getting entity disabled by via WS

* Adjust tests

* Improve test coverage

* Improve tests
2022-03-14 19:39:07 +01:00
J. Nick Koston 9a5eec561a
Only set require_restart on config entry reload if its not recoverable (#66994) 2022-02-21 10:27:23 -08:00
Erik Montnemery c496748125
Add WS API for removing a config entry from a device (#66188)
* Add WS API for removing a config entry from a device

* Address review comments

* Address review comments

* Remove entity cleanup from ConfigEntries

* Update + add tests

* Improve comments in test

* Add negative test

* Refactor according to review comments

* Add back async_remove_config_entry_device

* Remove unnecessary error handling

* Simplify error handling
2022-02-21 10:11:18 +01:00
Marc Mueller 45d8d04c40
Use assignment expressions [other] (#66882) 2022-02-19 17:22:51 +01:00
Erik Montnemery 83a10cca53
Enable basic type checking for config (#66197) 2022-02-09 19:09:55 +01:00
Joakim Sørensen 63d3a47599
disabled_by can be None when updating devices (#65934) 2022-02-06 20:23:31 +01:00
Paulus Schoutsen 8574ee04ba
Fix passing a string to device registry disabled_by (#65701) 2022-02-04 10:55:45 -08:00
Erik Montnemery 0eb2caabcf
Report unmet dependencies for failing config flows (#65061)
* Report unmet dependencies for failing config flows

* Apply suggestions from code review

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

* Update homeassistant/setup.py

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

* Modify error message

* Add test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-02-02 15:06:27 +01:00
Bram Kragten c82aa1606a
Allow removing keys from automation (#65374) 2022-02-01 09:45:08 -08:00
Erik Montnemery 55ff1e9c1d
Revert "Allow setting entity options with config/entity_registry/update" (#64693) 2022-01-23 21:07:12 -08:00
Erik Montnemery 3575009330
Store remote domain in Cloud preferences (#64532) 2022-01-21 09:42:34 -08:00
epenet 946238fb02
Import frontend (#64104)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-14 10:01:12 +01:00
Erik Montnemery 9c9dc4cb8c
Import websocket_api (part 1) (#63905) 2022-01-11 18:24:08 +01:00
Franck Nijhof 20bdcc7fff
Replace hass.helpers: async_get_clientsession() (#63910) 2022-01-11 17:33:50 +01:00
Erik Montnemery 3b7448bb1c
Import websocket_api (part 2) (#63906) 2022-01-11 17:26:25 +01:00