Commit Graph

1643 Commits (274f585646f93b6f96aae7b693fda1fd1136d07f)

Author SHA1 Message Date
epenet a92105171c
Remove vizio from mypy ignore list (#73585)
* Remove vizio config_flow from mypy ignore list

* Fix mypy errors

* Adjust media_player

* Add space
2022-06-19 21:39:24 +02:00
Allen Porter b014d558ff
Add application credentials platform for nest and deprecate yaml for SDM API (#73050)
* Update the nest integration to be useable fully from the config flow

* Support discovery in nest config flow

* Remove configuration entries

* Remove unused import

* Remove dead code

* Update homeassistant/components/nest/strings.json

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

* Remove commented out code

* Use config flow for app auth reauthentication path

* Improves for re-auth for upgrading existing project and creds

* More dead code removal

* Apply suggestions from code review

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

* Remove outdated code

* Update homeassistant/components/nest/config_flow.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-15 07:15:53 -07:00
J. Nick Koston 9b157f974d
Reduce overhead to refire events from async_track_point_in_utc_time when an asyncio timer fires early (#73295)
* Reduce overhead to refire events

- asyncio timers can fire early for a varity of reasons including
  poor clock resolution and performance. To solve this problem
  we re-arm async_track_point_in_utc_time and try again later
  when this happens.

- On some platforms this means the async_track_point_in_utc_time can
  end up trying many times to prevent firing the timer early since as
  soon as it rearms it fires again and this repeats until we reach
  the appointed time. While there is not much we can do to prevent
  asyncio from firing the timer callback early, we can reduce the
  overhead when this happens by using avoiding creating datetime
  objects

* tweak mocking

* -vvv

* fix time freeze being too broad in litterrobot

* adjust
2022-06-14 07:46:00 -10:00
J. Nick Koston 034c0c0593
Improve YAML Dump times with C Dumper (#73424) 2022-06-13 13:14:30 -07:00
Erik Montnemery 4435c641de
Enforce RegistryEntryHider in entity registry (#73219) 2022-06-08 12:36:43 -07:00
Erik Montnemery 921245a490
Remove deprecated temperature conversion of non sensors (#73222) 2022-06-08 20:47:47 +02:00
Erik Montnemery 5987266e56
Refactor template entity to allow reuse (#72753)
* Refactor template entity to allow reuse

* Fix schema and default name

* Add tests

* Update requirements

* Improve test

* Tweak TemplateSensor initializer

* Drop attributes and availability from TemplateEntity

* Use rest sensor for proof of concept

* Revert changes in SNMP sensor

* Don't set _attr_should_poll in mixin class

* Update requirements
2022-06-08 15:55:49 +02:00
epenet f91aa33c5f
Add FlowResultType enum to data entry flow (#72955) 2022-06-07 22:02:44 -07:00
Marc Mueller 983a76a91c
Update pylint to 2.14.0 (#73119) 2022-06-06 21:43:47 +02:00
Raphaël Beamonte 88129dbe91
Allow `log` template function to return specified `default` on math domain error (#72960)
Fix regression for logarithm template
2022-06-03 15:27:10 +02:00
Joakim Plate 8910d265d6
Keep track of a context for each listener (#72702)
* Remove async_remove_listener

This avoids the ambuigity as to what happens if same callback is added multiple times.

* Keep track of a context for each listener

This allow a update coordinator to adapt what data to request on update from the backing service based on which entities are enabled.

* Clone list before calling callbacks

The callbacks can end up unregistering and modifying the dict while iterating.

* Only yield actual values

* Add a test for update context

* Factor out iteration of _listeners to helper

* Verify context is passed to coordinator

* Switch to Any as type instead of object

* Remove function which use was dropped earliers

The use was removed in 8bee25c938
2022-06-03 13:55:57 +02:00
J. Nick Koston c365454afb
Revert "Initial orjson support (#72754)" (#72789)
This was causing the wheels to fail to build. We need
to workout why when we don't have release pressure

This reverts commit d9d22a9556.
2022-05-31 13:51:55 -07:00
Joakim Plate 84779482b8
Don't set headers kwargs multiple times (#72779) 2022-05-31 13:08:50 -07:00
J. Nick Koston d9d22a9556
Initial orjson support (#72754) 2022-05-31 12:18:11 -07:00
Malte Franken 638992f9c4
Make zone condition more robust by ignoring unavailable and unknown entities (#72751)
* ignore entities with state unavailable or unknown

* test for unavailable entity
2022-05-31 11:34:52 -07:00
Marc Mueller b417ae72e5
Add generic parameters to HassJob (#70973) 2022-05-30 09:22:37 +02:00
Paulus Schoutsen 6a3d2e54a2
Handle OAuth2 rejection (#72040) 2022-05-28 20:23:16 -07:00
Paulus Schoutsen d59258bd25
Revert "Add service entity context (#71558)" (#72610) 2022-05-27 10:30:40 -07:00
Franck Nijhof 38ad1ef233
Use My Home Assistant for OAuth2 redirect callbacks (#72449)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-05-24 19:00:36 -07:00
Kevin Stillhammer 90e5d69184
Add template as_timedelta (#71801) 2022-05-23 19:32:22 +02:00
Erik Montnemery deedbca46c
Mark unused sync toggle method from ToggleEntity as final (#72370) 2022-05-23 17:52:21 +02:00
epenet 5cfb31d28a
Adjust device_automation type hints in core components (#72207) 2022-05-23 16:07:34 +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
epenet 50ca14538a
Cleanup deprecated async_get_registry in core (#72087) 2022-05-18 17:58:28 +02:00
Allen Porter 26ee289be3
Add return code to integration application credentials in config flow (#71986)
* Add return code to integration application credentials in config flow

* Update google tests to use new return code

* Update spotify test for no auth configured

* Add translation for oauth2_missing_credentials

* Add new return code to yolink

* Update homeassistant/strings.json

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

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-05-18 06:30:57 -07:00
Franck Nijhof bfb47eb212
Final clean up of helpers accessed via hass (#72032)
* Final clean up of helpers accessed via hass

* Fix circular dep

* Fix import
2022-05-17 23:42:37 +03:00
Franck Nijhof 5f44d0f8f9
Clean up accessing storage.Store helper via hass (#72009) 2022-05-17 18:45:57 +02:00
Franck Nijhof 69cc6ab5f1
Clean up accessing entity_registry.async_get_registry helper via hass (#72005) 2022-05-17 16:40:45 +02:00
Franck Nijhof 7d2deae592
Clean up use of deprecated async_get_registry methods (#72001) 2022-05-17 13:40:19 +02:00
J. Nick Koston a614ddca28
Support requesting translations for multiple integrations in a single request (#71979) 2022-05-17 01:23:11 -05:00
Paulus Schoutsen 3b88c6c012
Inverse parallel updates default check, follow sync "update" method (#71720) 2022-05-16 17:10:34 -07:00
Erik Montnemery 4885331509
Fail template functions when no default specified (#71687) 2022-05-13 09:46:49 -07:00
Paulus Schoutsen 64636a4310
Add service entity context (#71558)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-05-09 14:45:53 -07:00
J. Nick Koston 30fdfc454f
Avoid lowercasing entities after template ratelimit recovery (#71415) 2022-05-09 12:48:38 +02:00
Joakim Plate 2dbe910e31
Adjust warning for missing entites (#71343) 2022-05-09 12:37:24 +02:00
Paulus Schoutsen e35a5a1a28
Fix other enums in helpers (#71505) 2022-05-07 20:57:48 -07:00
Paulus Schoutsen b1a04302b5
Stringify enums in selectors (#71441) 2022-05-06 11:25:01 -07:00
Paulus Schoutsen c8f95b7dfc
Ignore loading system entity category (#71361) 2022-05-05 14:33:37 -07:00
Paulus Schoutsen 353cc0b8c2
Fix importing blueprints (#71365)
Co-authored-by: Shay Levy <levyshay1@gmail.com>
2022-05-05 14:33:17 -07:00
Erik Montnemery eba125b093
Ensure 'this' variable is always defined for template entities (#70911) 2022-05-03 07:43:44 -07:00
Franck Nijhof 99360ad7f4
Indicate disabled steps in script trace (#71237) 2022-05-03 13:04:59 +02:00
Erik Montnemery 92f1855bcf
Fix script conditions (#71235) 2022-05-03 11:28:08 +02:00
Erik Montnemery 1931600eac
Isolate parallel subscripts (#71233) 2022-05-03 10:36:58 +02:00
Erik Montnemery 1aaf78ef99
Remove entity category system in favor of hidden_by (#68550) 2022-05-02 09:33:16 -07:00
Franck Nijhof a4682ae6e1
Adjust version number in template default deprecation warning (#71203) 2022-05-02 18:35:37 +03:00
Erik Montnemery f35e7d1129
Allow cancelling async_at_start helper (#71196) 2022-05-02 07:41:14 -07:00
Erik Montnemery f6c2fb088c
Stop script if sub-script stops or aborts (#71195) 2022-05-02 14:59:58 +02:00
Allen Porter 00b5d30e24
Add application credentials platform (#69148)
* Initial developer credentials scaffolding
- Support websocket list/add/delete
- Add developer credentials protocol from yaml config
- Handle OAuth credential registration and de-registration
- Tests for websocket and integration based registration

* Fix pydoc text

* Remove translations and update owners

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/developer_credentials/__init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Remove _async_get_developer_credential

* Rename to application credentials platform

* Fix race condition and add import support

* Increase code coverage (92%)

* Increase test coverage 93%

* Increase test coverage (94%)

* Increase test coverage (97%)

* Increase test covearge (98%)

* Increase test coverage (99%)

* Increase test coverage (100%)

* Remove http router frozen comment

* Remove auth domain override on import

* Remove debug statement

* Don't import the same client id multiple times

* Add auth dependency for local oauth implementation

* Revert older oauth2 changes from merge

* Update homeassistant/components/application_credentials/__init__.py

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

* Move config credential import to its own fixture

* Override the mock_application_credentials_integration fixture instead per test

* Update application credentials

* Add dictionary typing

* Use f-strings as per feedback

* Add additional structure needed for an MVP application credential

Add additional structure needed for an MVP, including a target
component Xbox

* Add websocket to list supported integrations for frontend selector

* Application credentials config

* Import xbox credentials

* Remove unnecessary async calls

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Update script/hassfest/application_credentials.py

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

* Import credentials with a fixed auth domain

Resolve an issue with compatibility of exisiting config entries when importing
client credentials

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-04-30 08:06:43 -07:00
Franck Nijhof 682ac52a20
Support shorthand logical operators in script sequences (#71022) 2022-04-29 18:06:21 +02:00
Marc Mueller 283c04e424
Improve typing [helpers.entity] (#70890) 2022-04-28 10:52:42 +02:00