Paulus Schoutsen
12de3f1e47
Clean up frontend services and events ( #31654 )
...
* Clean up frontend services and events
* Fix bug in core instead
* Add test that core works correctly with callback marked async funcs
2020-02-09 19:47:16 -08:00
Paulus Schoutsen
e970177eeb
Use entity.async_request_call in service helper ( #31454 )
...
* Use entity.async_request_call in service helper
* Clean up semaphore handling
* Address comments
* Simplify call entity service helper
* Fix stupid rflink test
2020-02-04 15:30:15 -08:00
Paulus Schoutsen
f41623ca64
Log warning when entities referenced in service call not found ( #31427 )
...
* Raise entities not found error
* Make it a warning, not an error
* Add support for MATCH_ENTITY_NONE
* Fix lint
* Fix tests
2020-02-04 14:42:07 -08:00
Paulus Schoutsen
7687ac8b91
Fix service annotations ( #31402 )
...
* Fix service annotations
* Filter area_id from service data
* Fix services not accepting entities
* Typo
2020-02-02 15:36:39 -08:00
Paulus Schoutsen
d405069406
Guard for callbacks in service helper ( #31339 )
2020-01-31 09:32:43 +01:00
Paulus Schoutsen
01dad31adc
Fix service helper not handling sync methods ( #31254 )
...
* Fix service helper not handling sync methods
* Add legacy support for returning coroutine objects
* Fix tests
* Fix tests
* Convert demo cover to async
2020-01-29 16:27:25 -08:00
Paulus Schoutsen
0c3ffbe282
Add foundation for integration services ( #30813 )
...
* Add foundation for integration services
* Fix tests
* Remove async_get_platform
* Migrate Sonos partially to EntityPlatform.async_register_entity_service
* Tweaks
* Move other Sonos services to media player domain
* Move other Sonos services to media player domain
* Address comments
* Remove lock
* Fix typos
* Use make_entity_service_schema
* Add area extraction to async_extract_entities
Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-01-19 17:55:18 -08:00
Ville Skyttä
fa4fa30461
Various string cleanups ( #30435 )
...
* Remove some unnecessary string concatenations
* Replace some simple str.formats with f-strings
* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Bas Nijholt
67c56c860d
Sort imports according to PEP8 for 'homeassistant' folder ( #29789 )
...
Components are already done
2019-12-09 16:42:10 +01:00
Paulus Schoutsen
02d9ed5e36
Do not select all entities when omitting entity ID in service call ( #29178 )
...
* Do not select all entities when omitting entity ID
* Address comments Matthew
* Require either area_id or entity_id
* Fix tests
* Fix test
2019-12-02 16:23:12 -08:00
Pascal Vizeli
c1851a2d94
Cleanup coroutine threadsafe ( #27080 )
...
* Cleanup coroutine threadsafe
* fix lint
* Fix typing
* Fix tests
* Fix black
2019-10-01 16:59:06 +02:00
Jeff Irion
7090970436
Add descriptive fields to script config ( #26056 )
...
* Add descriptive fields to script config
* Add script descriptions to hass.data["service_description_cache"]
* Import SERVICE_DESCRIPTION_CACHE
* Register script descriptions via async_set_service_schema
* Add scripts test for loading and reloading service descriptions
* Minor cleanup
* Clean up script schema
2019-08-21 14:08:46 -07:00
Ville Skyttä
aa508b5106
Complete some incomplete type hints in helpers ( #25953 )
2019-08-15 08:53:25 -07:00
Paulus Schoutsen
4de97abc3a
Black
2019-07-31 12:25:30 -07:00
Ville Skyttä
d64f1e767c
Type check all helpers ( #25373 )
...
* Type check all helpers, add inline exclusions for work in progress
* Remove unused Script._template_cache
* Add some missing type hints
* Remove unneeded type: ignore
* Type hint fixes
* Mypy assistance tweaks
* Don't look for None in deprecated config "at most once" check
* Avoid None name slugify attempt when generating entity id
* Avoid None state store attempt on entity remove
2019-07-21 09:59:02 -07:00
nierob
979f801488
Avoid creating temporary lists ( #25317 )
...
That gives nano performance improvements as *() is slightly faster
then *[].
2019-07-19 13:36:18 -07:00
Andrew Sayre
b5725f8f19
Fix supported features gates in media_player volume up/down services ( #23419 )
...
* Correct media player feature gates
* Fix failing test
* Lint...
2019-04-25 21:42:39 -07:00
Paulus Schoutsen
ce8ec3acb1
Don't warn for missing services ( #23182 )
2019-04-17 22:27:11 -07:00
Aaron Bach
46ee7d7b22
Fix test ( #23081 )
2019-04-13 14:32:07 -07:00
Aaron Bach
fc481133e7
Create decorator to check service permissions ( #22667 )
...
* Create decorator to check service permissions
* Typing
* Linting
* Member comments
* Linting
* Member comments
* Updated import
* Owner comments
* Linting
* Linting
* More work
* Fixed tests
* Removed service helper tests in RainMachine
* Linting
* Owner comments
* Linting
* Owner comments
Co-Authored-By: bachya <bachya1208@gmail.com>
2019-04-13 13:54:29 -06:00
Paulus Schoutsen
f7d4c48199
Convert service helper to use async_get_integration ( #23023 )
...
* Convert service helper to use async_get_integration
* Fix tests
2019-04-12 10:09:17 -07:00
Andrew Sayre
7624d0e79f
Check for supported features in media_player services ( #22878 )
...
* Add check for supported features
* Move logic to service helper
* Fix hacked in test for seek
* Test for service required features
2019-04-10 09:44:58 -07:00
Paulus Schoutsen
e00ae35e07
Admin service to automatically add empty schema ( #22637 )
...
* Admin service to automatically add empty schema
* Lint
2019-04-02 09:34:11 -07:00
Paulus Schoutsen
95a7077b41
Move core services.yaml file to Home Assistant integration ( #22489 )
...
* Move services.yaml to correct dir
* Remove special case for HA servicesgs
2019-03-29 20:48:45 -07:00
Paulus Schoutsen
c15f433c3e
Add a service require_admin wrapper ( #21953 )
...
* Add a service require_admin wrapper
* Allow it to be used as a decorator
* Lint
* Add comment
* Add docstring
* Update syntax
2019-03-12 22:09:50 -07:00
Paulus Schoutsen
8213016eaf
Allow targeting areas in service calls ( #21472 )
...
* Allow targeting areas in service calls
* Lint + Type
* Address comments
2019-03-04 09:51:12 -08:00
Jason Hu
f1b867dccb
Re-thrown exception occurred in the blocking service call ( #21573 )
...
* Rethrown exception occurred in the actual service call
* Fix lint and test
2019-03-01 23:09:31 -08:00
Anders Melchiorsen
70c5807976
Improve deprecation warnings ( #20391 )
2019-01-24 13:37:30 -08:00
Paulus Schoutsen
99c2e4ac44
Fix warning ( #19946 )
...
* Fix warning
* Update service.py
2019-01-11 11:52:07 -08:00
Paulus Schoutsen
9d9e11372b
Make automations log errors ( #18965 )
2018-12-13 12:21:16 +01:00
Paulus Schoutsen
8ea0a8d40b
RFC: Deprecate auto target all for services and introduce entity_id: * ( #19006 )
...
* Deprecate auto target all
* Match on word 'all'
2018-12-13 10:07:59 +01:00
Paulus Schoutsen
8b8629a5f4
Add permission checks to Rest API ( #18639 )
...
* Add permission checks to Rest API
* Clean up unnecessary method
* Remove all the tuple stuff from entity check
* Simplify perms
* Correct param name for owner permission
* Hass.io make/update user to be admin
* Types
2018-11-25 18:04:48 +01:00
Paulus Schoutsen
36c31a6293
Add permissions check in service helper ( #18596 )
...
* Add permissions check in service helper
* Lint
* Fix tests
* Lint
* Typing
* Fix unused impoert
2018-11-21 12:26:08 +01:00
Ville Skyttä
43048962f2
Upgrade flake8 to 3.6.0 ( #17770 )
...
* Upgrade flake8 to 3.6.0
* flake8/pylint comment tweaks
* flake8 F841 fixes
* flake8 W605 fix
* Ignore pyflakes bug #373 false positives
https://github.com/PyCQA/pyflakes/issues/373
* pycodestyle bug #811 workaround
https://github.com/PyCQA/pycodestyle/issues/811
2018-10-25 23:15:20 +03:00
Paulus Schoutsen
746f4ac158
Add context to scripts and automations ( #16415 )
...
* Add context to script helper
* Update script component
* Add context to automations
* Lint
2018-09-04 21:16:24 +02:00
Paulus Schoutsen
1be61df9c0
Add recent context ( #15989 )
...
* Add recent context
* Add async_set_context to components not using new services
2018-08-20 17:39:53 +02:00
Paulus Schoutsen
b682e48e12
Entity service ( #15991 )
...
* Add entity service helper
* Use entity service helper
* Context
2018-08-16 09:50:11 +02:00
Ville Skyttä
b7c336a687
Pylint cleanups ( #15626 )
...
* Pylint 2 no-else-return fixes
* Remove unneeded abstract-class-not-used pylint disable
2018-07-23 10:16:05 +02:00
Ville Skyttä
bf17ed0917
More pylint 2 fixes ( #15516 )
...
* Pylint 2 useless-import-alias fixes
* Pylint 2 chained-comparison fixes
* Pylint 2 consider-using-get fixes
* Pylint 2 len-as-condition fixes
2018-07-18 11:54:27 +02:00
Ville Skyttä
6f582dcf24
Lint cleanups ( #15243 )
...
* Remove some unused imports
* Fix a flake8 E271
2018-07-01 11:57:01 -04:00
Paulus Schoutsen
83d300fd11
Custom component loading cleanup ( #14211 )
...
* Clean up custom component loading
* Fix some tests
* Fix some stuff
* Make imports work again
* Fix tests
* Remove debug print
* Lint
2018-05-01 20:57:30 +02:00
Matthias Urlichs
f5cc40024d
Rename homeassistant.util.async to .async_ ( #13088 )
...
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
Julius Mittenzwei
16cb7388ee
Removing asyncio.coroutine syntax from HASS core ( #12509 )
...
* changed asyncio.coroutine syntax to new async def/await
* removed py34 from tox environment
* reverted some changes within entity.py
* -
* reverted changes within bootstrap.py
* reverted changes within discovery.py
* switched decorators
* Reverted change within aiohttp_client.py
* reverted change within logging.py
* switched decorators
* Await lock properly
* removed asyncio.coroutine from test
2018-02-25 03:38:46 -08:00
Tod Schmidt
f5030d9ebf
Services (small_pr)(fix): Added missing return on data template error ( #12184 )
...
* Added return on data template error
* Rebased so not sure why spelling errors returned...
2018-02-05 09:19:56 +01:00
tschmidty69
48619c9d7c
Implemented event_data_template (new) ( #11057 )
...
* Implemented event_data_template
* The hound does not like my indentation
* Added passed variables to tests for event and svc template calls
* Moved recursive function to template.py
* Update template.py
* Update template.py
* Cleaned up service.py and fixed unit tests
* Blank lines
* Removed stray logger statement
* Blank lines again
2018-01-18 22:13:14 -08:00
Anders Melchiorsen
ce9673b06d
Limit service description loading to a single thread ( #11733 )
2018-01-18 21:59:03 -08:00
Anders Melchiorsen
8267a21bfe
Lazy loading of service descriptions ( #11479 )
...
* Lazy loading of service descriptions
* Fix tests
* Load YAML in executor
* Return a copy of available services to allow mutations
* Remove lint
* Add zha/services.yaml
* Only cache descriptions for known services
* Remove lint
* Remove description loading during service registration
* Remove description parameter from async_register
* Test async_get_all_descriptions
* Remove lint
* Fix typos from multi-edit
* Remove unused arguments
* Remove unused import os
* Remove unused import os, part 2
* Remove unneeded coroutine decorator
* Only use executor for loading files
* Cleanups suggested in review
* Increase test coverage
* Fix races in existing tests
2018-01-07 14:54:16 -08:00
Paulus Schoutsen
ca54bbfcc9
RFC: Use bind_hass for helpers ( #9745 )
...
* Add Helpers bind_hass functionality
* Update other helpers
2017-10-08 08:17:54 -07:00
Fabian Affolter
a4f1f6e724
Update docstrings ( #7374 )
...
* Update docstrings
* Update docstrings
* Update docstrings
* Update docstrings
* Update docstrings
* Update docstrings
* Update docstring
* Update docstrings
* Update docstrings
* Fix lint issues
* Update docstrings
* Revert changes in dict
2017-05-02 09:18:47 -07:00
Paulus Schoutsen
96e22c7b41
Remove event decorators ( #6634 )
2017-03-15 14:46:57 +01:00