Commit Graph

134 Commits

Author SHA1 Message Date
Artur Pragacz
d7e6f84d28 Fix empty selector validation (#151340) 2025-09-01 16:22:41 +02:00
Paul Bottein
380c737901 Add reorder option to entity selector (#149002) 2025-07-18 19:41:59 +01:00
Artur Pragacz
9db5b0b3b7 Validate selectors in the service helper (#148857) 2025-07-16 08:51:16 +02:00
Abílio Costa
b71bcb002b Move target selector extractor method to common module (#148087) 2025-07-07 13:48:48 +01:00
Erik Montnemery
8d8ff011fc Minor improvements of service helper (#147079) 2025-06-19 00:17:12 +01:00
Erik Montnemery
058f860be7 Fix incorrect use of zip in service.async_get_all_descriptions (#147013)
* Fix incorrect use of zip in service.async_get_all_descriptions

* Fix lint errors in test
2025-06-17 14:24:31 +02:00
Abílio Costa
6d809b0b5a Add service response support to admin services (#144837) 2025-05-13 21:57:15 +01:00
Erik Montnemery
dc8e1773f1 Remove unused defaults from entity_registry.RegistryEntry (#143655) 2025-04-25 12:41:58 +02:00
Jan-Philipp Benecke
7b9ea63f17 Split out yaml loading into own package (#140683)
* Split out yaml loading into library

* Code review

* Code review

* Fix check config script
2025-03-15 22:26:18 -04:00
epenet
364556a7dd Prefer from...import...as over import...as in core tests (#136146) 2025-01-21 09:28:17 +01:00
Paulus Schoutsen
5cf56207fe Add temperature and humidity entities to area registry (#135423)
* Add temperature and humidity entities to area registry

* Fix service test

* Add validation

* ABC

* More ABC

* More ABC 2

* Fix tests

* ABC 3

* ABC 4
2025-01-16 08:25:26 -05:00
epenet
899fb091fc Simplify access to hass in service calls (#133062) 2024-12-13 09:31:21 +01:00
Jan Bouwhuis
3aae9b629f Add exception translation for entity action not supported (#131956) 2024-12-01 16:53:06 +01:00
Artur Pragacz
624834de9c Fix service target devices by label (#127229)
* Fix service target devices by label

* More explicit test
2024-10-25 21:30:04 +02:00
Artur Pragacz
98a86c7636 Improve code of normalized name registry (#125282) 2024-10-01 11:20:52 -05:00
Erik Montnemery
df4bd721b5 Deprecate template.attach (#124843) 2024-09-02 15:33:10 +02:00
Franck Nijhof
8b96c7873f Rename 'service' to 'action' in automations and scripts (#122845) 2024-07-31 14:36:53 +02:00
Joost Lekkerkerker
03c6e0c55f Fix SIM300 (#120725) 2024-06-28 10:46:02 +02:00
Erik Montnemery
75c7ae7c69 Support in service descriptions for input sections (#116100) 2024-06-25 20:00:48 +02:00
Erik Montnemery
6fb400f76b Add test of get_all_descriptions resolving features (#120384) 2024-06-25 09:47:43 +02:00
Erik Montnemery
8620bef5b0 Support shared keys starting with period in services.yaml (#118789) 2024-06-11 16:31:19 +02:00
Robert Resch
cb62f4242e Remove strict connection (#117933) 2024-05-24 15:50:22 +02:00
Robert Resch
630ddd6a8c Revert "Remove strict connection" (#116416) 2024-04-29 21:26:40 +02:00
Robert Resch
dfc198cae0 Remove strict connection (#116396) 2024-04-29 19:33:31 +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
Robert Resch
348e1df949 Add strict connection (#112387)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-12 14:47:46 +02:00
Joost Lekkerkerker
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Sid
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Franck Nijhof
167e66d45c Add labels to service target (#113753) 2024-03-18 22:32:23 +01:00
Franck Nijhof
2aadd643ed Add floors to service target (#110850) 2024-03-14 19:02:23 +01:00
Jan-Philipp Benecke
3b1ab6436d Remove deprecated hass.components usage in service tests (#111883) 2024-03-12 17:27:44 +01:00
Paulus Schoutsen
145657dc21 Only load services.yaml for integrations that have it (#112732)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-11 19:05:32 +01:00
Marc Mueller
a6b842f818 Add empty line after module docstring (2) [other] (#112738) 2024-03-08 19:16:38 +01:00
J. Nick Koston
ed726db974 Fix race in loading service descriptions (#109316) 2024-02-01 12:34:23 -06:00
J. Nick Koston
d260ed938a Reduce overhead to call entity services (#106908) 2024-01-08 09:30:52 +01:00
J. Nick Koston
09b65f14b9 Index entities by domain for entity services (#106759) 2024-01-02 15:28:58 +01:00
Erik Montnemery
03d3a87f23 Small cleanup of legacy groups (#102918)
* Small cleanup of legacy groups

* Update tests which create groups
2023-10-28 17:16:41 +02:00
J. Nick Koston
034fabe188 Use loop time to set context (#99701)
* Use loop time to set context

loop time is faster than utcnow, and since its only used internally it can
be switched without a breaking change

* fix mocking
2023-09-06 11:04:49 +02:00
Ville Skyttä
6399d74c15 Remove unnnecessary pylint configs from core (#98704) 2023-08-22 23:12:12 +02:00
Franck Nijhof
b655b9d530 Allow for translating service examples (#97141) 2023-07-24 15:57:02 +02:00
Erik Montnemery
df46179d26 Fix broken service test (#96943) 2023-07-20 13:11:55 +02:00
J. Nick Koston
08af42b00e Fix mixed case service schema registration (#96448) 2023-07-12 14:39:51 -10:00
Franck Nijhof
594d240a96 Migrate & fix logger services to support translations (#96393)
* Migrate logger services to support translations

* Fix tests and schema validation

* Apply suggestions from code review

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-07-12 10:37:18 -04:00
Franck Nijhof
f054de0ad5 Add support for service translations (#95984) 2023-07-11 15:52:12 +02:00
J. Nick Koston
b7b8afffd0 Handle integrations with empty services or failing to load during service description enumeration (#95911)
* wip

* tweaks

* tweaks

* add coverage

* complain loudly as we never execpt this to happen

* ensure not None

* comment it
2023-07-06 11:19:06 -04:00
Bram Kragten
342d07cb92 Set correct response value in service description when async_set_service_schema is used (#95985)
* Mark scripts as response optional, make it always return a response if return_response is set

* Update test_init.py

* Revert "Update test_init.py"

This reverts commit 8e113e54db.

* Split + add test
2023-07-06 10:24:34 -04:00
Paulus Schoutsen
e4f617e92e Update log message when referenced entity not found (#95577)
* Update log message when referenced entity not found

* Update homeassistant/helpers/service.py

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

* Update test

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-07-02 00:04:03 +02:00
Paulus Schoutsen
d95c241a1a Add service response values to service descriptions (#95262) 2023-06-26 12:57:43 -04:00
J. Nick Koston
68cf796be8 Speed up entity service calls (#94731)
* Speed up entity service calls

- Avoid permissions check if the caller is an admin
- Use set intersection instead of linear search of entity platforms to find entities

* tweak

* fix light test to not use an admin user
2023-06-16 21:07:57 -04:00
J. Nick Koston
b993fe1c9d Cache generation of the service descriptions (#93131) 2023-05-16 21:42:37 -05:00