Commit Graph

53 Commits (b4159c7dc9af2cfff3a855b5f634829b829b68b8)

Author SHA1 Message Date
Paulus Schoutsen 519d9f2fd0 async HTTP component (#3914)
* Migrate WSGI to asyncio

* Rename wsgi -> http

* Python 3.4 compat

* Move linting to Python 3.4

* lint

* Lint

* Fix Python 3.4 mock_open + binary data

* Surpress logging aiohttp.access

* Spelling

* Sending files is a coroutine

* More callback annotations and naming fixes

* Fix ios
2016-10-23 23:48:01 -07:00
Paulus Schoutsen 00e298206e Optimize template 2 (#3521)
* Enforce compiling templates

* Refactor templates

* Add template validator to Logbook service

* Some more fixes

* Lint

* Allow easy skipping of rfxtrx tests

* Fix template bug in AND & OR conditions

* add entities extractor

Conflicts:
	tests/helpers/test_template.py

* fix unittest

* Convert template to be async

* Fix Farcy

* Lint fix

* Limit template updates to related entities

* Make template automation async
2016-09-27 21:29:55 -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 5995f2438e fix remove listener (#3196) 2016-09-07 06:59:59 -07:00
Paulus Schoutsen d1f4901d53 Migrate to cherrypy wsgi from eventlet (#2387) 2016-06-30 09:02:12 -07:00
Philip Lundrigan d13cc227cc Push State (#2365)
* Add ability to push state changes

* Add tests for push state changes

* Fix style issues

* Use better name to force an update
2016-06-26 00:33:23 -07:00
Robbie Trencheny f522d95328 Revert "Report whether SSL is required in discovery" 2016-06-01 22:37:16 -07:00
Robbie Trencheny c856c67790 Report whether SSL is required in discoverables, like /api/discovery_info and ZeroConf (#2192) 2016-06-01 19:45:19 -07:00
Paulus Schoutsen 98de7c9287 Upgrade eventlet to 0.19 2016-05-22 20:14:46 -07:00
Paulus Schoutsen c7cc045acd Use only 1 event listener for event stream. 2016-05-21 18:24:03 -07:00
Paulus Schoutsen 4d5eb0e3fc EventStream to sent ping on start to notify browser 2016-05-21 16:31:22 -07:00
Paulus Schoutsen 548d415f94 Clean up EventStream 2016-05-21 15:01:35 -07:00
Paulus Schoutsen 9aa9e57890 Cleanup 2016-05-21 15:01:35 -07:00
Paulus Schoutsen 794ff20987 Get EventStream working 2016-05-21 15:01:34 -07:00
Paulus Schoutsen 5aa0158761 Add url validators 2016-05-21 15:01:34 -07:00
Paulus Schoutsen 1096232e17 More WIP 2016-05-21 15:01:34 -07:00
Paulus Schoutsen 15e329a588 Tons of fixes - WIP 2016-05-21 15:01:33 -07:00
Paulus Schoutsen 768c98d359 Fix import issues 2016-05-21 15:01:02 -07:00
Josh Wright 6490378de3 Add some missing view registrations 2016-05-21 15:01:01 -07:00
Josh Wright d0320a9099 WIP: Add WSGI stack
This is a fair chunk of the way towards adding a WSGI compatible stack
for Home Assistant. The majot missing piece is auth/sessions. I was
undecided on implementing the current auth mechanism, or adding a new
mechanism (likely based on Werkzeug's signed cookies).

Plenty of TODOs...
2016-05-21 15:01:01 -07:00
Robbie Trencheny a1480582d9 Add /api/discovery_info (#1791)
* Allow /api/ and /api/config to be accessed without auth. If config is accessed without auth, only show minimal information. Also improves comments

* Re-enable auth on /api/ since a lot of tests get broken if it does not require auth

* Move the discovery info from /api/config to /api/discovery_info

* Flake8 fixes
2016-05-06 22:11:35 -07:00
Fabian Affolter 1f7e0936fa Add missing comments 2016-03-15 19:22:21 +01:00
Fabian Affolter b534244e40 Fix PEEP257 issues 2016-03-08 17:55:57 +01:00
Fabian Affolter 582394bc3b Modify import of template and PEP257 2016-02-23 21:19:22 +01:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen dabb8d5bbc Merge pull request #1246 from balloob/feature/remove-state-fire-event
Have remove state fire state_changed event
2016-02-14 10:33:59 -08:00
Paulus Schoutsen cafa4043b3 Move bootstrap endpoint from api to frontend 2016-02-14 00:04:08 -08:00
Paulus Schoutsen 06de73ff80 Allow removing a state via API + remote StateMachine 2016-02-13 23:00:38 -08:00
Paulus Schoutsen 80d3552960 Add template editor 2015-12-17 23:33:09 -08:00
Paulus Schoutsen 027b891052 Add tests for API.stream 2015-12-14 23:20:43 -08:00
Paulus Schoutsen 0b325b2b7d API.stream - catch more errors 2015-12-11 18:43:00 -08:00
Paulus Schoutsen 47b5fbfaf3 Add template API endpoint 2015-12-10 20:47:06 -08:00
Paulus Schoutsen 733de6b357 Streaming API will keep session alive 2015-11-28 22:14:40 -08:00
Paulus Schoutsen 78cfed1fb0 Clean up HTTP sessions and allow log out 2015-11-28 17:18:35 -08:00
Paulus Schoutsen e84ef2d2d7 API to fetch Error log is no longer cached. 2015-11-28 14:08:01 -08:00
Fabian Affolter 97f9f8aa49 Update link to docs (Jekyll 3 update) 2015-11-09 13:12:18 +01:00
Paulus Schoutsen e4c3d47dbf Expose API to view error log 2015-11-07 01:44:02 -08:00
Fabian Affolter 77ba0c0393 Add link to docs 2015-10-25 15:58:58 +01:00
Paulus Schoutsen 4b6878f91c Restrict data from stream API 2015-09-23 21:35:23 -07:00
Paulus Schoutsen 1b89a502c4 Extract core into own submodule 2015-08-16 20:44:46 -07:00
Paulus Schoutsen 972743cb63 Fix style issue 2015-05-01 20:56:10 -07:00
Paulus Schoutsen 30f78f7fa6 Add API endpoint to bootstrap frontend 2015-05-01 19:02:29 -07:00
Paulus Schoutsen ca8be5015a Add config API endpoint 2015-05-01 18:24:32 -07:00
Paulus Schoutsen 58812b326c Move hass.local_api and hass.components to config object 2015-03-21 22:06:59 -07:00
Paulus Schoutsen 19a43cea26 Add scene component 2015-03-15 23:36:42 -07:00
Paulus Schoutsen 89f59a758d Frontend: stream fires ping on connect
This is needed for Safari/Firefox to call onOpen
2015-02-19 23:31:06 -08:00
Paulus Schoutsen f46e0408b3 Add ping to streaming events API 2015-02-19 00:15:27 -08:00
Paulus Schoutsen 3ee2c6e210 Write to log if an event stream is closed 2015-02-15 16:44:25 -08:00
Paulus Schoutsen 846e11d6b8 Frontend streams events from HA 2015-02-13 18:59:42 -08:00
Paulus Schoutsen 3f26fc3b06 Move more HTTP stuff into constant file 2015-02-13 18:27:13 -08:00