Commit Graph

551 Commits (c51e644203a0c93a791bc0d342d14a56728078fc)

Author SHA1 Message Date
epenet d5568ff955
Standardize homeassistant imports in full-CI components (#136731)
Standardize homeassistant imports in components
2025-01-28 13:11:19 -05:00
Ville Skyttä 40eb8b91cc
Adjust to recommended propcache.api import paths (#136150) 2025-01-21 10:58:22 +01:00
epenet 24c70caf33
Improve formatting in component files (#135261)
* Improve formatting in component files

* Apply suggestions from code review
2025-01-10 11:46:15 +01:00
Robert Resch fb152c7d22
Remove deprecated automation constants (#131792) 2024-11-28 11:07:00 +01:00
Olaf van Zandwijk b07682e43c Update terminology for built-in blueprints (#128383) 2024-10-16 19:14:09 +02:00
J. Nick Koston 0f29fd3e10
Switch to using fast cached_property implementation in propcache (#127339) 2024-10-03 13:11:02 -05:00
epenet 2699eb62bd
Rename DOMAIN_DATA HassKey constants to DATA_COMPONENT (#126746)
* Rename DOMAIN_DATA HassKey constant to DATA

* DATA -> DATA_COMPONENT
2024-09-25 15:53:58 +02:00
c0ffeeca7 866ffcf639
Use bold to markup UI strings (#126748)
* Use bold to markup UI strings

* Use bold to markup UI strings
2024-09-25 15:33:23 +02:00
Franck Nijhof 9dfabc3fb7
Adjust automation to plural triggers/conditions/actions keys (#123823)
* Adjust automation to plural triggers/conditions/actions keys

* Fix some tests

* Adjust websocket tests

* Fix search tests

* Convert blueprint and blueprint inputs to modern schema

* Pass schema when creating Blueprint object

* Update tests

* Adjust websocket api

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
Co-authored-by: Erik <erik@montnemery.com>
2024-09-24 20:03:23 +02:00
epenet 8b44c16b57
Use HassKey in core components (a-c) (#126258)
* Use HassKey in conversation

* Use HassKey in assist_satellite

* automation

* More

* Unrelated

* Improve
2024-09-20 12:07:15 +02:00
chammp b3377fe5fb
Add condition to trigger template entities (#119689)
* Add conditions to trigger template entities

* Add tests

* Fix ruff error

* Ruff

* Apply suggestions from code review

* Deduplicate

* Tweak name used in debug message

* Add and improve type annotations of modified code

* Adjust typing

* Adjust typing

* Add typing and remove unused parameter

* Adjust typing

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

* Adjust return type

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-09-11 09:36:49 +02:00
Erik Montnemery 354f4491c8
Avoid unnecessary copying of variables when setting up automations (#124844) 2024-08-29 13:03:47 +02:00
Erik Montnemery fce2e21c9f
Update icons.json to new service schema part 1 (#124768) 2024-08-28 13:47:02 +02:00
WebSpider 657ff58500
Fix device class for motion_light blueprint (#124495)
* Fix device class for motion_light blueprint.
Fixes #124353

* Update to accept both motion and occupancy
2024-08-26 17:39:27 +02:00
Erik Montnemery ea7e88d000
Pass None instead of empty dict when registering entity services (#123878) 2024-08-14 07:04:29 -05:00
Franck Nijhof 2f0870a063
Adjust issue description in automations fix flow (#122007) 2024-07-16 09:27:54 +02:00
Franck Nijhof a9bf12f102
Rename Services to Actions in translation strings (#121777) 2024-07-15 21:19:25 +02:00
Marc Mueller 0e52d149e4
Update voluptuous to 0.15.2 (#120631)
* Update voluptuous to 0.15.1

* Fix typing issues

* Add type ignores for json result type

* Update voluptuous to 0.15.2

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-02 12:57:09 -07:00
Marc Mueller ca55986057
Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
Joost Lekkerkerker 6ef8e87f88
Fix ruff redefined-argument-from-local PLR1704 (#120729)
* Fix PLR1704

* Fix
2024-06-28 12:31:07 +02:00
Erik Montnemery d2a5683fa0
Raise repair issues when automations can't be set up (#120010) 2024-06-21 11:07:30 +02:00
epenet 960d1289ef
Avoid references to websocket_api.const in core and other components (#119285) 2024-06-10 13:49:44 +02:00
Marc Mueller fe21e2b8ba
Import Generator from typing_extensions (1) (#118986) 2024-06-06 17:02:13 +02:00
Sid 2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
J. Nick Koston a22c221722
Rename bus._async_fire to bus.async_fire_internal (#116027) 2024-04-23 22:28:31 +02:00
Marc Mueller 14e19c6d9c
Remove unnecessary type ignores (#116036) 2024-04-23 17:32:21 +02:00
Erik Montnemery 7cd0fe3c5f
Don't reload other automations when saving an automation (#80254)
* Only reload modified automation

* Correct check for existing automation

* Add tests

* Remove the new service, improve ReloadServiceHelper

* Revert unneeded changes

* Update tests

* Address review comments

* Improve test coverage

* Address review comments

* Tweak reloader code + add a targetted test

* Apply suggestions from code review

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

* Explain the tests + add more variations

* Fix copy-paste mistake in test

* Rephrase explanation of expected test outcome

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-16 15:58:57 +02:00
J. Nick Koston 288f3d84ba
Fix duplicate automation entity state writes (#115386)
_async_attach_triggers was writing state, async_enable was
writing state, and all of them were called async_added_to_hass

After entity calls async_added_to_hass via add_to_platform_finish
it will also write state so there were some paths that
did it 3x

async_disable was also writing state when the entity was
removed
2024-04-10 21:15:21 -04:00
J. Nick Koston 63545ceaa4
Ensure automations do not execute from a trigger if they are disabled (#115305)
* Ensure automations are stopped as soon as the stop future is set

* revert script changes and move them to #115325
2024-04-10 08:42:18 -04:00
J. Nick Koston 59d92f16bd
Use shorthand attributes in automation for name (#115246) 2024-04-09 07:04:12 -10: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 816ce116bf
Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
Sid f7b7f74d10
Enable Ruff TRY201 (#114269)
* Enable Ruff TRY201

* remove redundant rules
2024-03-28 10:18:07 +01:00
J. Nick Koston 13d6ebaabf
Avoid delaying automation/script startup for sample blueprints (#114277)
Avoid delaying automation/script startup to check if the blueprint folder exists

automations and script both populate sample blueprints if none exist

The check to see if the blueprint folder exists always had to create
an executor job which would delay startup a bit if the executor was
busy. Since we do not need the sample blueprints to be populated
until the start event, we can run this in a task.
2024-03-27 09:55:59 +01:00
Marc Mueller 81c34ac952
Fix spelling [docstrings + comments] (#114168) 2024-03-25 11:33:00 +01:00
Franck Nijhof 670bd97777
Find referenced labels in automations & scripts (#113812) 2024-03-19 16:28:37 +01:00
Franck Nijhof 38d0854b70
Find referenced floors in automations & scripts (#113802) 2024-03-19 14:18:53 +01:00
J. Nick Koston 1949b9936b
Simplify automation startup logic (#113122) 2024-03-11 15:41:05 -10:00
Marc Mueller 2c06d4fcb9
Add empty line after module docstring (2) [components] (#112736) 2024-03-08 19:15:59 +01:00
Marc Mueller ff3a801936
Add empty line after module docstring [a-d] (#112697) 2024-03-08 14:51:32 +01:00
J. Nick Koston 6a62a39456
Start automations with eager tasks (#111568) 2024-02-26 16:30:00 -10:00
J. Nick Koston 3877a56d23
Avoid creating tasks for automation and script validation (#111181)
These functions created tasks to run small validators, and the cost of
creating all the tasks was more expensive than running the validators
themselves. Since the code is unlikely to suspend its more efficient to
await them in series.
2024-02-23 13:41:36 -05:00
Paul Bottein 2b534af960
Update reload icons for automation and person service (#109147) 2024-01-30 19:36:57 +01:00
Paul Bottein 4170a447fc
Allow system and helper integrations to provide entity_component icons (#109045) 2024-01-29 19:26:55 +01:00
J. Nick Koston f96f4d31f7
Convert referenced registry functions to use cached_property (#108895)
* Convert referenced registry functions to use cached_property

These already implemented caching, but now that we can use cached_property
because the lock problem is solved, we can make the code simplier and faster

* missed one

* make them the same
2024-01-26 23:02:42 -05:00
Erik Montnemery 9bff039d17
Add set_conversation_response script action (#108233)
* Add set_conversation_response script action

* Update homeassistant/components/conversation/trigger.py

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

* Revert accidental change

* Add test

* Ignore mypy

* Remove incorrect callback decorator

* Update homeassistant/helpers/script.py

* Add test with templated set_conversation_response

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-01-23 09:13:42 -05:00
J. Nick Koston 4b7a313ece
Use identity checks for CoreState (#107846)
Some of the checks used ==, and some used is. Switch
everything to is as its faster
2024-01-12 10:21:26 +01:00
Erik Montnemery c805ea7b4f
Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
Robert Resch db985925c4
Deprecate deprecated automation constants (#106067) 2023-12-19 19:22:13 +01:00
Erik Montnemery 95f7db1970
Move config_per_platform and extract_domain_configs to config.py (#104989) 2023-12-04 12:48:49 +01:00