Commit graph

46 commits

Author SHA1 Message Date
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
183e0543b4
Clean up entity component (#11691)
* Clean up entity component

* Lint

* List -> Tuple

* Add Entity.async_remove back

* Unflake setting up group test
2018-01-22 22:54:41 -08:00
Paulus Schoutsen
2dab239021 Add scripts editor backend (#8993)
* Add scripts editor backend

* Fix docstrings
2017-08-15 22:09:10 -07:00
Paulus Schoutsen
d29bdddaa7 Add bind_hass to components (#8502)
* Add bind_hass to components

* Add bind_hass to group
2017-07-16 10:14:46 -07:00
Pascal Vizeli
814834512a Group service / dynamic handling (#7971)
* Add Service to group

* Finish service

* Add service functions

* fix lint

* Address paulus comments

* fix lint & cleanup

* fix lint

* fix lint

* fix lint p3

* add test for check group

* add more tests

* fix lint

* Update service.yaml

* Fix order for tests

* Fix comment

* Fix test

* Fix tests

* Fix name in tests

* Fix view

* Fix default value

* Fix lint

* Fix key error

* add name

* migrate component entity

* fix tests

* fix import

* migrate device tracker

* fix lint

* fix bug

* fix logic

* fix lint

* fix tests

* fix generator

* fix group

* fix other tests.

* Not need to load group on first stage anymore.

* fix service

* add more group depency

* fix tests

* Revert "fix tests"

This reverts commit 35a922b3a8.

* Real fix

* fix test p2

* fix test p3

* fix test p4

* fix test p5

* fix test p6

* fix lint

* fix test p7

* Rename attribute

* fix group test

* fix bug

* fix flagy tests

* fix service.yaml

* fix lint
2017-06-16 00:52:28 +02:00
Fabian Affolter
3ee4d1060f Update docstrings (#7361)
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update tomato.py

* Update isy994.py

* Lint + fix tests

* Lint
2017-04-29 22:04:49 -07:00
Pascal Vizeli
c937a7bcb0 Add support for remove services / Reload script support (#6441)
* Add support for remove services / Reload script support

* Reload support for scripts

* Add more unittest for services

* Add unittest for script reload

* Address paulus comments
2017-03-07 22:51:34 -08:00
Pascal Vizeli
41f558b181 Bootstrap / Component setup async (#6264)
* Bootstrap / Entiy setup async

* Cleanup add_job stuff / return task/future object

* Address paulus comments / part 1

* fix install pip

* Cleanup bootstrap / move config stuff to config.py

* Make demo async

* Further bootstrap improvement

* Address Martin's comments

* Fix initial tests

* Fix final tests

* Fix bug with prepare loader

* Remove no longer needed things

* Log error when invalid config

* More cleanup

* Cleanups platform events & fix lint

* Use a non blocking add_entities callback for platform

* Fix Autoamtion is setup befor entity is ready

* Better automation fix

* Address paulus comments

* Typo

* fix lint

* rename functions

* fix tests

* fix test

* change exceptions

* fix spell
2017-02-28 20:33:19 -08:00
Johann Kellerman
9f765836f8 [core] Add 'packages' to the config (#5140)
* Initial

* Merge dicts and lists

* feedback

* Move to homeassistant

* feedback

* increase_coverage

* kick_the_hound
2017-01-13 22:01:47 -08:00
Daniel Høyer Iversen
467cb18625 Add last triggered to script (#5261)
* Add last triggered to script

* Add tests for script last_triggered
2017-01-11 16:23:05 +01:00
Paulus Schoutsen
23fb8c4cdd Convert script component to async (#4427) 2016-11-17 21:50:01 -08:00
Paulus Schoutsen
a343c20404 Async gather wait (#4247)
* Fix config validation for input_*, script

* Allow scheduling coroutines

* Validate entity ids when entity ids set by platform

* Async: gather -> wait

* Script/Group: use async_add_job instead of create_task
2016-11-06 09:26:40 -08:00
Fabian Affolter
be272ac64a Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Sean Dague
86b318e992 fix typos in script module strings
It looks like some copy / paste in docstrings, clean them up for
posterity.
2016-10-25 07:20:40 -04:00
Daniel Høyer Iversen
d2d393feb5 Add automations and scripts to group.all_automations and group.all_scripts (#3664)
* Add automations to group.all_automations

* Add scripts to group.all_scripts
2016-10-04 21:20:48 -07:00
Paulus Schoutsen
d58548dd1c Address asyncio comments (#3663)
* Template platforms: create_task instead of yield from

* Automation: less yielding, more create_tasking

* Helpers.script: less yielding, more create_tasking

* Deflake logbook test

* Deflake automation reload config test

* MQTT: Use async_add_job and threaded_listener_factory

* Deflake other logbook test

* lint

* Add test for automation trigger service

* MQTT client can be called from within async
2016-10-03 22:39:27 -07:00
Paulus Schoutsen
640a8b5a7f Limit dependencies of HA core (#2762) 2016-08-08 20:21:40 -07:00
Paulus Schoutsen
b8e4db9161 Script entities to allow passing in variables 2016-04-21 22:24:23 -04:00
Paulus Schoutsen
f76d545a08 Add script logic into helper. 2016-04-21 21:06:05 -04:00
Jan Harkes
567d1065b2 Service validation for script component. 2016-04-13 12:35:07 -04:00
Jan Harkes
29c30861bf Be flexible in what we accept for script.delay configuration. (#1738)
Accept delay configuration even when someone forgets to indent the time

specification.



Also removed 'weeks' and 'microseconds' from acceptable delay values.

There is a new homeassistant release every 2 weeks and running scripts

are not persisting across restarts. And there is still the option of

using (weeks*7) days if the long delay is really necessary.



And if someone really depends on microsecond delay precision we are

unlikely to be able to provide this accuracy, even milliseconds is

suspect for that matter but will at least allow us to specify some

subsecond delay.
2016-04-07 12:19:28 -07:00
Paulus Schoutsen
8ef542927f Add automation config validation
* Add automation config validation

* Remove unnecessary dict validator

* Downgrade voluptuous to 0.8.9

* Fix linting

* Address issues
2016-04-04 12:18:58 -07:00
Paulus Schoutsen
e140e9b8ab Add script + extra config validators
* Add config validation and extra validators

* Address PR comments
2016-04-03 10:19:09 -07:00
Paulus Schoutsen
61b387cd0b Script: fix template service calls and remove old config support 2016-03-13 22:29:36 -07:00
Fabian Affolter
b534244e40 Fix PEEP257 issues 2016-03-08 17:55:57 +01:00
Fabian Affolter
b8a40457ee Update docstrings to match PEP257 2016-03-07 18:50:30 +01:00
Paulus Schoutsen
f623a332cf Fix incorrectly setting can_cancel on scripts 2016-02-27 23:11:51 -08:00
Andrew Thigpen
7dd529356a Add toggle support for scripts. 2016-02-21 11:22:38 -06:00
Andrew Thigpen
b961b5037f Only turn on scripts that are not currently running.
Prevents an errant API call from advancing a currently executing delay
step before it should.
2016-02-21 11:11:35 -06:00
Paulus Schoutsen
e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen
bc19ef66bf Move split_entity_id to helpers 2016-01-23 22:49:49 -08:00
Paulus Schoutsen
a91163877f Script: use config service helper 2016-01-21 22:47:25 -08:00
Paulus Schoutsen
0a711922ef Remove unnecessary instance variable 2016-01-14 23:19:08 -08:00
Paulus Schoutsen
b2ae365558 Scripts call services in blocking manner 2015-12-06 11:03:31 -08:00
Paulus Schoutsen
a301d869d7 PyLint 1.5 fixes 2015-11-29 13:49:05 -08:00
Paulus Schoutsen
2861bbb02c Warn if config invalid shape for script 2015-11-26 13:08:13 -08:00
Paulus Schoutsen
e2c530b85d Script: new attribute if can cancel 2015-11-14 15:38:07 -08:00
Fabian Affolter
97f9f8aa49 Update link to docs (Jekyll 3 update) 2015-11-09 13:12:18 +01:00
Paulus Schoutsen
12495c717e Fix script regression 2015-10-28 12:24:33 -07:00
Fabian Affolter
415d650860 Add link to docs 2015-10-25 15:58:58 +01:00
Paulus Schoutsen
347597ebdc Base Script on entity 2015-10-14 23:15:48 -07:00
Stefan Jonasson
be9cfbdeb0 Fixed docblock 2015-09-19 14:45:56 +02:00
Paulus Schoutsen
13d40fe6ec Allow firing events in script 2015-09-13 23:54:48 -07:00
Paulus Schoutsen
382c1de981 Built-in components no longer use deprecated methods 2015-08-03 17:08:13 +02:00
Andrew Thigpen
ef138bb132 Fix utc issue with script component. 2015-05-14 18:54:13 -05:00
andythigpen
046efe3acb Adds script component.
A script is composed of a sequence of actions (currently service calls)
that are executed in order.  Individual actions can also be delayed by a
given timedelta.
2015-03-14 21:29:55 -05:00