Commit Graph

74 Commits (f7ac644c11557905ae7da7a2882ed5d792f8d2a0)

Author SHA1 Message Date
Johann Kellerman f0b1874d2d Fix up docstring for tests (#5090) 2016-12-28 20:04:59 +02:00
Paulus Schoutsen b2a15e17d3 MQTT Automation: parse payload as JSON (#4703) 2016-12-04 09:53:05 -08:00
Fabian Affolter 51e20c92f9 WIP Fix pylint and PEP257 issues (tests) (#4120)
* Fix pylint and PEP257 issues

* More PEP257 fixes
2016-12-01 21:45:19 -08:00
Lewis Juggins 66473120ab Add test for delay on automations (#4630) 2016-11-29 08:45:04 -08:00
Jon Caruana 2a6c0cfc17 LiteJet: Unit tests and new trigger options held_more_than and held_less_than. (#4473)
* LiteJet: Unit tests and new trigger options held_more_than and held_less_than.
* Unit tests for the LiteJet component and associated platforms. Coverage is almost 100% -- just misses one line.
* The automation LiteJet trigger returns an empty "removal" function to ensure the automation base is happy with it. The pylitejet library doesn't actually support a real removal.
* The automation LiteJet trigger can detect hold time and act appropriately to support things like short tap or long hold.

* LiteJet: Fix indent in unit test source code.

* LiteJet: Fix test_include_switches_* unit tests on Python 3.5

* LiteJet: Remove wait for state existence from unit tests. Recent fixes to discovery make this no longer necessary.
2016-11-24 09:52:15 -08:00
Paulus Schoutsen 62785c2431 More async tests (#4223)
* Annotate test callbacks to be async

* Convert device_sun_light_trigger to be async
2016-11-05 16:36:20 -07:00
Pascal Vizeli d5368f6f78 Async bootstrap / component init (#3991)
* Async bootstrap

* Adress comments

* Fix tests

* More fixes

* Tests fixes
2016-10-27 00:16:23 -07:00
Johann Kellerman 7b40a641ec Continue on invalid platforms and new setup_component unit tests (#3736) 2016-10-08 11:27:35 -07:00
Daniel Høyer Iversen b8beae9c6c Merge pull request #3651 from home-assistant/automation
Customize initial state of automation
2016-10-05 09:48:55 +02:00
Daniel 46f3337b07 Customize initial state of automation 2016-10-05 09:20:51 +02: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 7ab7edd81c Make automation async 2016-10-01 14:11:16 -07:00
Paulus Schoutsen 4076ccf639 Use setup_component in tests (#3414)
* Alarm Control Panel Manual - use setup_component

* Update automation - zone tests

* Update climate - demo tests

* Update climate - generic thermostat tests

* Update cover - command line tests

* Update cover - demo tests

* Update device tracker tests

* Update device tracker - owntracks tests

* Update fan - demo tests

* Update garage door - demo tests

* Update light tests

* Update lock - demo tests

* Update media player - demo tests

* Update notify - command line tests

* Update notify - demo tests

* Update notify - file tests

* Update notify - group tests

* Update sensor - mfi tests

* Update sensor - moldindicator tests

* Update sensor - mqtt room tests

* Update switch - command line

* Update switch - flux

* Update switch tests

* Update scene tests

* Fix wrong default port for mfi switch
2016-09-17 10:29:58 -07:00
Paulus Schoutsen 609d7ebea5 Migrate core from threads to async awesomeness (#3248)
* Add event loop to the core

* Add block_till_done to HA core object

* Fix some tests

* Linting core

* Fix statemachine tests

* Core test fixes

* fix block_till_done to wait for loop and queue to empty

* fix test_core for passing, and correct start/stop/block_till_done

* Fix remote tests

* Fix tests: block_till_done

* Fix linting

* Fix more tests

* Fix final linting

* Fix remote test

* remove unnecessary import

* reduce sleep to avoid slowing down the tests excessively

* fix remaining tests to wait for non-threadsafe operations

* Add async_ doc strings for event loop / coroutine info

* Fix command line test to block for the right timeout

* Fix py3.4.2 loop var access

* Fix SERVICE_CALL_LIMIT being in effect for other tests

* Fix lint errors

* Fix lint error with proper placement

* Fix slave start to not start a timer

* Add asyncio compatible listeners.

* Increase min Python version to 3.4.2

* Move async backports to util

* Add backported async tests

* Fix linting

* Simplify Python version check

* Fix lint

* Remove unneeded try/except and queue listener appproriately.

* Fix tuple vs. list unorderable error on version compare.

* Fix version tests
2016-09-12 19:16:14 -07:00
Paulus Schoutsen 35b388edce Reload groups (#3203)
* Allow reloading groups without restart

* Test to make sure automation listeners are removed.

* Remove unused imports for group tests

* Simplify group config validation

* Add prepare_reload function to entity component

* Migrate group to use entity_component.prepare_reload

* Migrate automation to use entity_component.prepare_reload

* Clean up group.get_entity_ids

* Use cv.boolean for group config validation
2016-09-07 06:59:16 -07:00
Paulus Schoutsen e9813b219e Allow reloading automation without restarting HA (#3002) 2016-09-04 17:15:52 +02:00
Paulus Schoutsen 7f27cc5468 Fix tests docstring 2016-08-27 07:45:46 +01:00
Paulus Schoutsen 3fa1963345 Convert automation to entities with services 2016-08-25 23:36:48 -07:00
Paulus Schoutsen 6354399d55 Initial script condition support (#1910) 2016-04-28 12:03:57 +02:00
Paulus Schoutsen 612a017bc6 Automation: Allow embedding script definition 2016-04-21 22:36:14 -04:00
Paulus Schoutsen 4e568f8b99 Automation: Add trigger context and expose to action 2016-04-21 13:59:42 -07:00
Paulus Schoutsen 68d92c3196 Use standardised datetime format 2016-04-16 01:46:50 -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 956f6056f9 Remove support for old deprecated automation config 2016-03-13 00:00:05 -08:00
Fabian Affolter 9838697d2b Fix PEP257 issues 2016-03-09 10:25:50 +01:00
Stefan Jonasson e4485dcf3d Updated structure, added more tests 2016-02-22 09:40:27 +01:00
Stefan Jonasson 6e7ca9505c Removed unused import 2016-02-20 22:25:41 +01:00
Stefan Jonasson f3c95adaca Fixed now => utcnow
Fixed added time patch to unittest
2016-02-20 22:15:49 +01:00
Stefan Jonasson ff6e071dff added the for param to the conditions as well 2016-02-20 12:52:42 +01:00
pavoni 9e48b88154 Add `for` delay to state automation. 2016-02-19 15:28:17 +00:00
Paulus Schoutsen 09ab3e95c0 Tests should all use test HA 2016-02-14 15:08:23 -08:00
Paulus Schoutsen bade0e0d71 Make tests pass flake8 2016-02-14 13:07:21 -08:00
Fabian Affolter 00afaac54c Update for file header, docstrings, and PEP8/PEP257 2016-02-13 14:19:11 +01:00
magnusknutas 0a4e857901 And a test just to see if nothing works if not providing any vars 2016-01-26 21:21:54 +01:00
magnusknutas d4b444823c Tests for time and a fix for wrong access of _LOGGER 2016-01-26 21:11:30 +01:00
Philip Lundrigan c9ff0ab7eb Fix for sun if condition 2016-01-03 01:03:53 -07:00
Paulus Schoutsen add24915a3 ps - clean up sun automation tests 2015-12-26 17:48:20 -08:00
Philip Lundrigan ff8f22854c Add test 2015-12-21 16:28:26 -07:00
Philip Lundrigan 110d721c76 Add tests 2015-12-21 16:09:51 -07:00
Philip Lundrigan 4c33eba378 Prevent triggering twice 2015-12-16 15:24:09 -07:00
Philip Lundrigan fe2ae16210 Add tests for template automation 2015-12-16 15:24:09 -07:00
Philip Lundrigan 9fa8b27d65 Change from `value` to `state` 2015-12-15 10:12:43 -07:00
Philip Lundrigan cec62bdf87 Add tests 2015-12-14 14:47:32 -07:00
pavoni cb0eb2df7d Add tests 2015-11-29 21:37:08 +00:00
Paulus Schoutsen b6d26597c0 Automation - state platfor: Flag if user makes config error 2015-10-11 18:30:25 -07:00
Paulus Schoutsen d35f5b9f97 Tests for MQTT sensor/switch 2015-10-02 23:57:26 -07:00
Paulus Schoutsen 1dc9bfdf73 Update config zones 2015-09-29 23:08:37 -07:00
Paulus Schoutsen 2eb36c18bd Add geofencing to automation 2015-09-29 00:18:52 -07:00
Paulus Schoutsen 720e5876a7 Fix broken automation test 2015-09-19 21:02:28 -07:00