Commit Graph

300 Commits (65deaa1daf7bb913aeb63800bdd9ba0d3919bc25)

Author SHA1 Message Date
Andrey c2fe0d0120
Make typing checks more strict (#14429)
## Description:

Make typing checks more strict: add `--strict-optional` flag that forbids implicit None return type. This flag will become default in the next version of mypy (0.600)

Add `homeassistant/util/` to checked dirs.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-13 13:24:51 +03:00
Ville Skyttä b92350fb55 Lint cleanup (#15103)
* Remove unneeded inline pylint disables

* Remove unneeded noqa's

* Use symbol names instead of message ids in inline pylint disables
2018-06-25 13:05:07 -04:00
Paulus Schoutsen 0b114f0755
Do not mount deps folder when running in virtual env (#14993)
* Do not mount deps folder when inside virtual env

* Add tests

* Fix package test
2018-06-16 10:48:41 -04:00
Andrey 7aec098a05 Bring back typing check. Meanwhile just for homeassistant/*.py (#14410)
* Bring back typing check. Meanwhile just for homeassistant/.py

* Change follow-imports to silent. Add a few more checks.
2018-05-12 17:44:53 -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
Otto Winter a4bf421044 Convert more files to async/await syntax (#14142)
* Move more files to async/await syntax

* Attempt Work around pylint bug

Using lazytox :P
2018-04-28 19:26:20 -04:00
Ben Randall 7d43ad6a37 Colorlog windows fix (#13929)
* Fix colorlog on windows

Modified the way logging is initialized to fix two things.
1. If the import of `colorlog` fails the logs will still be formatted
   using the expected HASS log format.
2. Ensure that `logging.basicConfig` is called AFTER `colorlog` is
   imported so that the default handler generated will be writing to the
   wrapped stream generated when `colorama` is initialized.  This allows
   colored logging to work on Windows.

Added support for a `--log-no-color` command line switch in the event
that someone just wants to disable colored log output entirely.

* Fix line lengths

* Switch default value
2018-04-18 10:18:44 -04:00
Otto Winter 27c1806897 Python 3.5 adjustments (#13173) 2018-03-15 13:10:54 +02:00
Johann Kellerman 40485a6e89 Ensure we have valid config AFTER merging packages #13015 (#13038)
* Ensure we have valid config AFTER merging packages #13015

* also fix packages
2018-03-10 10:02:04 -08:00
Johann Kellerman 05255b9c3f Safe fix for #13015 (#13024) 2018-03-09 15:52:21 -08:00
Johann Kellerman 6734c966b3 check_config script evolution (#12792)
* Initial async_check_ha_config_file

* check_ha_config_file

* Various fixes

* feedback - return the config

* move_to_check_config
2018-03-08 19:34:24 -08:00
Paulus Schoutsen b3a47722f0
Initial support for Config Entries (#12079)
* Introduce Config Entries

* Rebase fail

* Address comments

* Address more comments

* RequestDataValidator moved
2018-02-16 14:07:38 -08:00
Otto Winter 678f284015 Upgrade pylint to 1.8.2 (#12274)
* Upgrade pylint to 1.8.1

* Fix no-else-return

* Fix bad-whitespace

* Fix too-many-nested-blocks

* Fix raising-format-tuple

See https://github.com/PyCQA/pylint/blob/master/doc/whatsnew/1.8.rst

* Fix len-as-condition

* Fix logging-not-lazy

Not sure about that TEMP_CELSIUS though, but internally it's probably just like if you concatenated any other (variable) string

* Fix stop-iteration-return

* Fix useless-super-delegation

* Fix trailing-comma-tuple

Both of these seem to simply be bugs:
 * Nest: The value of self._humidity never seems to be used anywhere
 * Dovado: The called API method seems to expect a "normal" number

* Fix redefined-argument-from-local

* Fix consider-using-enumerate

* Fix wrong-import-order

* Fix arguments-differ

* Fix missed no-else-return

* Fix no-member and related

* Fix signatures-differ

* Revert "Upgrade pylint to 1.8.1"

This reverts commit af78aa00f125a7d34add97b9d50c14db48412211.

* Fix arguments-differ

* except for device_tracker

* Cleanup

* Fix test using positional argument

* Fix line too long

I forgot to run flake8 - shame on me... 🙃

* Fix bad-option-value for 1.6.5

* Fix arguments-differ for device_tracker

* Upgrade pylint to 1.8.2

* 👕 Fix missed no-member
2018-02-11 09:20:28 -08:00
Pierre Ståhl 8111e3944c Add basic backend support for a system log (#10492)
Everything logged with "warning" or "error" is stored and exposed via
the HTTP API, that can be used by the frontend.
2017-11-14 20:35:56 -08:00
Adam 3ea4691fce Fix spelling error (#10009) 2017-10-21 21:56:19 +02: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
Paulus Schoutsen ffb19381f1 Deprecate Python 3.4 support (#9684)
* Deprecate Python 3.4 support

* Update text
2017-10-05 21:47:51 -07:00
Ted Drain 26c98512c8 Polymer access to log file broken when using new log file command line (#9437)
* Changed api.py to use new log file name

* Only serve log file if logs are active

* Changed log file location to be in hass.data
2017-09-15 22:25:32 -07:00
Ted Drain 411c9620c1 Added log-file command line flag (#9422) 2017-09-13 21:22:42 -07:00
Fabian Affolter 879c816f5c Update docstrings (#8536) 2017-07-18 16:23:57 +02:00
Martin Hjelmare ba019c799a Make deps directory persistent over upgrades (#7801)
* Use pip install --user if venv not active

* Set PYTHONUSERBASE to deps directory, when installing with --user
  option.
* Reset --prefix option to workaround incompatability when installing
  with --user option. This requires pip version 8.0.0 or greater.
* Require pip version 8.0.3.
* Do not delete deps directory on home assistant upgrade.
* Fix local lib mount and check package exist.

* Update and add tests

* Fix upgrade from before version 0.46

* Extract function to get user site

* Add function(s) to package util to get user site.
* Use async subprocess for one of the functions to get user site.
* Add function to package util to check if virtual environment is
  active.
* Add and update tests.

* Update version for last removal of deps dir

* Address comments

* Rewrite package util tests with pytest

* Rewrite all existing unittest class based tests for package util as
  test functions, and capitalize pytest fixtures.
* Add test for installing with target inside venv.
2017-07-13 19:26:21 -07:00
Paulus Schoutsen f43db3c615 Replace executor with async_add_job (#7658)
* Remove executor

* Lint

* Lint

* Fix tests
2017-05-26 08:28:07 -07: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
Fabian Affolter 0298522fd5 Use four-digits year (#7336) 2017-04-27 09:30:34 -07:00
Paulus Schoutsen 90baa2ce4d Add history to component priority list (#7173) 2017-04-19 09:15:18 -07:00
Paulus Schoutsen a1208261a8 Load zwave panel (#7127)
* Load Z-Wave panel when component loads

* Update frontend

* Fix tests
2017-04-16 11:10:55 -07:00
Paulus Schoutsen 29f385ea76 Fix automations listening to HOMEASSISTANT_START (#6936)
* Fire EVENT_HOMEASSISTANT_START automations off right away while starting

* Actually have core state be set to 'starting' during boot

* Fix correct start implementation

* Test and deprecate event automation platform on start

* Fix doc strings

* Remove shutting down exception

* More strict when to mark an instance as finished

* Add automation platform to listen for start/shutdown

* When we stop we should wait till it's all done

* Fix testing

* Fix async bugs in tests

* Only set UVLOOP when hass starts from CLI

* This hangs normal asyncio event loop

* Clean up Z-Wave node entity test
2017-04-05 23:23:02 -07:00
Paulus Schoutsen 96e22c7b41 Remove event decorators (#6634) 2017-03-15 14:46:57 +01:00
Paulus Schoutsen 2650c73a89 Split bootstrap into bs + setup (#6416)
* Split bootstrap into bs + setup

* Lint
2017-03-05 10:41:54 +01:00
Pascal Vizeli 8232f1ef65 Cleanup async handling (#6388)
* Cleanups unneeded blocks

* Cleanup bootstrap

* dedicated update_ha_state

* Fix imap_email_content

* fx tests

* Fix lint & spell
2017-03-04 15:10:36 -08:00
Paulus Schoutsen 84f30d9ef8 Bootstrap tweaks tests (#6326)
* Update strings/fix component not found message.

* Fix tests

* More tweak text
2017-02-28 23:42:31 -08:00
Johann Kellerman ac49298c8d Log errors when loading yaml (#6257) 2017-03-01 06:56:23 +02: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
Paulus Schoutsen 58eb32bce4 Random test fixes (#6195)
* Store persistent errors in hass (speeds up tests)

* Fix sleepiq test dependency on test order

* Fix sleepiq validation
2017-02-23 21:44:47 -08:00
Paulus Schoutsen f29ee24b72 Do not allow config dependency (#6036)
* Do not allow config dependency

* Prevent config in discovery

* Migrate to blacklist
2017-02-18 11:31:37 -08:00
Pascal Vizeli 41849eab06 Core cleanup: two stage shutdown (#5876)
* Core cleanup: two stage shutdown

* fix spell

* fix

* add async logger to close

* change aiohttp to use CLOSE

* address paulus comments

* Fix tests

* Add unittest
2017-02-13 06:24:07 +01:00
Paulus Schoutsen c54517de90 Convert config.components to a set (#5824) 2017-02-09 20:21:57 +02:00
Pascal Vizeli 2cbed9cd96 Move signal handling out of core to bootstrap (#5815)
* Move signal handling out of core to bootstrap

* Fix tests
2017-02-08 21:58:45 -08:00
happyleavesaoc f17efc2168 log formats match (#5456) 2017-01-19 21:31:44 -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
Johann Kellerman b67cce7215 Add correct line numbers for yaml include directives (#5303) 2017-01-13 21:13:17 -08:00
Pascal Vizeli 50c8224365 Bugfix async log handler (#4954)
* Bugfix async log handler

* fix boostrap test

* Use hass.data for store handler and cleanup on async_stop

* Update bootstrap.py
2016-12-17 12:21:52 -08:00
Pascal Vizeli 6d6abab358 Async logging file handler (#4901)
* Async logging file handler

* add time rotation handle

* new layout

* address paulus comments

* fix lint
2016-12-16 15:51:06 -08:00
Paulus Schoutsen b35fa4f1c1 Finish all tasks before setup phase is done (#4606) 2016-11-30 13:02:45 -08:00
Paulus Schoutsen d930c399fe Better locking while setting up components + discovery (#4463) 2016-11-19 08:18:33 -08:00
Pascal Vizeli ba2ea35089 Add logging to platform/component setup (#4300)
* Add timeout to platform/component

* Revert "Add timeout to platform/component"

This reverts commit 280a311e48.

* Add logging data

* Change log message with paulus comments
2016-11-10 18:46:31 +01:00
Pascal Vizeli ece58ce78f Remove ThreadPool with async executor (#4154)
* Remove ThreadPool with async executor

* Fix zigbee

* update unittest

* fix remote api

* add pending task to remote

* fix lint

* remove unused import

* remove old stuff for lazy tests

* fix bug and add a exception handler to executor

* change executor handling

* change to wait from gather

* fix unittest
2016-11-05 09:27:55 -07:00
Pascal Vizeli fcf318cf53 Bugfix windows have a other default loop now (#4195)
* Bugfix windows have a other default loop now

* fix handling with 3.4.2 that not support ensure_future

* make the same as ensure_future does

* fix spell

* fix lazy test
2016-11-03 11:07:47 +01:00
Johann Kellerman 0d14920758 Component setup error messages with markdown (#3919)
* Remove_dev_link_async

* callback
2016-11-02 19:31:09 -07:00
Paulus Schoutsen 7f699b4261 Lazy initialise the worker pool (#4110)
* Lazy initialise the worker pool

* Minimize pool initialization in core tests

* Fix tests on Python 3.4

* Remove passing in thread count to mock HASS

* Tests: Allow pool by default for threaded, disable for async

* Remove JobPriority for thread pool

* Fix wrong block_till_done

* EmulatedHue: Remove unused test code

* Zigbee: do not touch hass.pool

* Init loop in add_job

* Fix core test

* Fix random sensor test
2016-10-31 08:47:29 -07: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
Paulus Schoutsen 4163e55dbd Introducing hass.data (#4121)
* Hello hass.data

* Migrate setup_component to hass.data
2016-10-29 14:51:17 -07:00
Paulus Schoutsen 9ea1101aba Fix bootstrap circular imports (#4108)
* Fix bootstrap circular imports

* fix test

* Lint
2016-10-29 12:54:47 -07:00
Pascal Vizeli 825ee3612d fix some comments spell (#4082)
* fix some comments

* fix in an executor

* address paulus comments
2016-10-28 21:26:52 +02: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
Per Sandström 0dfcf40d37 [WIP] Config validation error line numbers (#3976)
Config validation error line numbers
2016-10-25 20:13:32 +02:00
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
Sean Dague daea93d9f9 Suppress requests/urllib3 connection pool log messages (#3854)
requests/urllib3 is notorious for using the INFO log level for very
DEBUG kinds of information. Given the configurability of python
logging it's actually pretty easy to just set requests to WARN by
default. This cleans out a bunch of largely unuseful log lines from
home assistant output.
2016-10-17 21:14:10 +02:00
Johann Kellerman cb322f72db Add persistent notifications to bootstrap (#3738)
* Add persistent notifications to bootstrap

* Rebase, Fix test
2016-10-13 09:09:07 -07:00
Johann Kellerman 7b40a641ec Continue on invalid platforms and new setup_component unit tests (#3736) 2016-10-08 11:27:35 -07:00
Paulus Schoutsen 4b8bc90d16 Limit worker pool to 10 threads (#3560)
* Limit worker pool to 10 threads

* Comment evdev in requirements

* Allow skipping RFXtrx tests locally

* Fix worker pool size tests

* lol whut
2016-09-28 00:05:38 -07:00
Fabian Affolter a084232cf5 Add link to error message (#3530) 2016-09-27 23:59:34 -07:00
Johann Kellerman 9631179126 Use voluptuous for input_slider, input_boolean, input_select (#3256)
* Use voluptuous for input slider

* floats

* _setup_component

* Imperative mood

* CONFIG_SCHEMA

* None returns empty ensure_list

* allow_extra

* bool

* restore ensure_list behaviour
2016-09-23 00:12:11 -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
Johann Kellerman 14b034f452 Check config script (#2657)
* Add check_config, yaml linting script

* WIP: Start reusing some bootstrap methods for validation

* Start outputs

* Secrets, files and failed config

* requirements_all

* Fixes

* formatting

* Fix unit test after formatting
2016-08-22 21:42:05 -07:00
Teagan Glenn 8d1a9d86ea Yaml secret fallback to parent folders (#2878)
* Move secret cache out of loader so it can be referenced by other folders
* Unit test to verify secrets from another folder work & see if it overrides parent secret
* Clear secret cache after load
2016-08-20 21:39:56 +02:00
Johann Kellerman aadf6a7750 Handle requirements for scripts (#2765) 2016-08-09 23:54:34 -07:00
Paulus Schoutsen 9fa1328111 Move config validation exception logging to bootstrap + humanize 2016-08-09 21:38:44 -07:00
Paulus Schoutsen 0b7b0e54ba Move unit system to util (#2763) 2016-08-08 20:42:25 -07:00
Fabian Heredia Montiel 0377338a81 Improvement typing (#2735)
* Fix: Circular dependencies of internal files

* Change: dt.date for Date and dt.datetime for DateTime

* Use NewType if available

* FIX: Wrong version test

* Remove: Date and DateTime types due to error

* Change to HomeAssistantType

* General Improvement of Typing

* Improve typing config_validation

* Improve typing script

* General Typing Improvements

* Improve NewType check

* Improve typing db_migrator

* Improve util/__init__ typing

* Improve helpers/location typing

* Regroup imports and remove pylint: disable=ungrouped-imports

* General typing improvements
2016-08-07 16:26:35 -07:00
Fabian Heredia Montiel ae97218582 Improvement typing core (#2624)
* Add package typing

* Add util/location typing

* FIX: lint wrong order of imports

* Fix sometyping and add helpers/entity typing

* Mypy import trick

* Add asteroid to test requiremts to fix pylint issue

* Fix deprecated function isSet for is_set

* Add loader.py typing

* Improve typing bootstrap
2016-07-27 20:33:49 -07:00
Paulus Schoutsen f1632496f0 Allow circular dependency with discovery (#2616) 2016-07-25 22:49:10 -07:00
Fabian Heredia Montiel 08226a4864 Type Hints - __main__ (#2574)
* Add __main__ type hints

* Fix most errors of __main__

* Add ignore for script.run()

* Add type annotations for from_config_dict and from_config_file

* Fix errors

* Fix requirement error

* Add mypy type check to tests

* Enable travis typing check

* Messed up the tox deps

* Laxer type checker
2016-07-20 22:38:52 -07:00
Paulus Schoutsen 6714392e9c Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers

* Move elevation to core config

* Migrate forecast test to requests-mock

* Migrate YR tests to requests-mock

* Add requests_mock to requirements_test.txt

* Move conf code from bootstrap to config

* More config fixes

* Fix some more issues

* Add test for set config and failing auto detect
2016-06-27 09:02:45 -07:00
Paulus Schoutsen 206e7d7a67 Extend persistent notification support (#2371) 2016-06-25 16:40:33 -07:00
Paulus Schoutsen a70f922a71 ps - add reload core config service (#2350) 2016-06-22 09:13:18 -07:00
Per Sandström f0f1fadee1 redirect daemon file descriptors (#2103) 2016-05-19 23:20:07 -07:00
Paulus Schoutsen e40908d67c Improve config validation error message 2016-05-07 22:31:22 -07:00
Daniel Høyer Iversen 21dd8162b3 Improve error message for invalid key in config (#1975)
* Improve error message for invalid key in config

* Refactor log exception in config validation
2016-05-07 07:35:42 -07:00
Paulus Schoutsen 2e79e9d5bb Correct celcius to celsius (#1860) 2016-04-19 20:30:44 -07:00
Jan Harkes 241735c924 Change local library path from {config_dir}/lib to {config_dir}/deps. (#1799)
Just on the off chance that someone who happens to run as root and also
doesn't correctly parse "just remove config /lib and restart".
2016-04-11 20:07:50 -07:00
Jan Harkes 73859f59f0 Make yaml config parser errors look less like bugs. (#1776)
Instead of nested tracebacks, show a simpler error message.

    Config directory: /home/user/.homeassistant
    ERROR:homeassistant.util.yaml:duplicate key: "script"
      in "/home/user/.homeassistant/configuration.yaml", line 95, column 0
      in "/home/user/.homeassistant/configuration.yaml", line 108, column 0
2016-04-09 15:25:01 -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 f6d584af09 Allow platforms to specify PLATFORM_SCHEMA 2016-04-02 20:10:57 -07:00
Paulus Schoutsen 489c5b8188 bootstrap platform components: adjust instead of replace config 2016-03-31 21:11:14 -07:00
Paulus Schoutsen ac28228e6b Either validate component config or platform config 2016-03-29 22:51:33 -07:00
Paulus Schoutsen a35173a5ff Surpress silly warnings 2016-03-28 23:46:19 -07:00
Paulus Schoutsen 5baa98b79f Add initial config validation 2016-03-28 23:46:12 -07:00
Fabian Affolter 897b5c668f Fix PEP257 issues 2016-03-08 00:06:04 +01:00
Paulus Schoutsen 1bfea626ff Handle circular setup dependency 2016-02-19 23:20:14 -08:00
Paulus Schoutsen e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Ryan Kraus 60dd2d441d Merge remote-tracking branch 'balloob/dev' into automation-decorator
# Conflicts:
#	homeassistant/helpers/service.py
#	tests/helpers/test_service.py
2016-01-24 22:51:00 -05:00
Ryan Kraus 5830da63b1 Moved service decorator to service helpers
Moved the service decorator to the service helpers module and moved the
associated tests.
2016-01-24 22:46:30 -05:00
Ryan Kraus 40dbeb0b60 Another revision on event decorators
This revision of event decorators removes much of the complexity. The
decorated functions are no longer wrapped with a class that tracks
last_run, etc. Bootstrap now gives hass to the event_decorators module
before initializing components so the decorators no longer require
activation.
2016-01-24 17:46:05 -05:00
Ryan Kraus 02e634c6a2 Fixed bugs to allow HA to boot again
1) helpers/event should not import the sun component unless it is
requested. This prevents circular import.
2) fixed import typo in bootstrap
2) bootstrap cannot import event_decorators until it is needed because
this leads to a circular import.
2016-01-24 15:55:47 -05:00
Ryan Kraus 0f937cad74 Initial pass at event decorators
Created event decorators for custom components. Decorators were created
for the events: track_state_change, track_sunrise, track_sunset, and
track_time_change.
2016-01-24 15:28:09 -05:00
Paulus Schoutsen de08f0afaa Load YAML config into an ordered dict 2016-01-23 22:41:01 -08:00
Paulus Schoutsen bdd945c1c4 Set default log level to INFO 2015-12-22 18:39:46 -08:00
MartinHjelmare 5ff6eb8b9c Fix logging lowest level
* Set lowest logging level to NOTSET in enable_logging(), bootstrap.py,
	to enable setting a lower logging level than INFO in the logger
	component.
2015-12-10 02:56:05 +01:00
Paulus Schoutsen fabd0ced3f Make DEPENDENCIES optional for components 2015-11-26 13:11:59 -08:00
Paulus Schoutsen 295f27d259 Only delete lib dir in config upgrade if exists 2015-11-15 02:16:52 -08:00
Paulus Schoutsen 71e4283a2e Remove lib directory in version upgrade 2015-11-15 02:05:46 -08:00
Paulus Schoutsen e4c3d47dbf Expose API to view error log 2015-11-07 01:44:02 -08:00
Paulus Schoutsen 68c2b539ee More flexible domain config extraction 2015-09-28 23:09:05 -07:00
Paulus Schoutsen 19d40612e6 Add home_range to device tracker 2015-09-20 09:35:03 -07:00
Paulus Schoutsen f9b17ab026 Device tracker rewrite 2015-09-09 23:37:15 -07:00
Andrew Thigpen 2e636f598e Add option to rotate log file daily.
Adds a command line option to rotate the log daily at midnight and
retain up to the specified amount of days.
2015-09-04 19:52:59 -05:00
Andrew Thigpen 6519e589b5 Add option to skip pip install on startup.
Since the requirements only change when the software is updated,
this adds a command line switch to disable pip installs on
startup.  The default behavior is maintained when the switch is
not specified.  Skipping pip helps a lot with startup on older RPi
hardware.
2015-09-04 16:50:57 -05:00
Ryan Kraus 5b06e8d25e Daemon handling cleanup.
More cleanly handling whether a PID file should be checked.
Fatal Error on PID file IOError.
Pylint fix to bootstrap.
2015-09-01 02:37:52 -04:00
Ryan Kraus ff470c8ffe Added core daemon function as flags.
Created three additional flags for the hass command:
-v -  Toggle verbose log file output
—pid-file -  Specify PID file path
—daemon -  Launch as daemon (nix only)

The core now binds to SIGQUIT on nix systems to trigger a clean
shutdown.

Modified HTTP server to write logging messages through the logging
module.
2015-09-01 02:12:00 -04:00
Paulus Schoutsen fb4121d4b4 Fix components being loaded twice 2015-08-30 15:08:03 -07:00
Paulus Schoutsen a5a1f30798 Make launch more smooth 2015-08-29 23:02:07 -07:00
Ryan Kraus f5b98c86f0 Mostly PyLint and Flake8 updates.
Rewrote imports of exceptions to be from the exceptions module.
Made nmap scanner check for libnmap dependency without crashing.
Various flake8 and pylint updates.
2015-08-29 22:34:35 -04:00
Ryan Kraus 0b6358e759 Implemented comments from Paulus.
Revised main to use frontend and demo strings rather than importing
their domains.
Removed submodule validation.
Moved local library mounting to the bootstrap module and out of core.
Added requirements_all.txt for all dependencies.
Made core dependencies looser.
Small updates to setup.py.
2015-08-29 22:19:52 -04:00
Ryan Kraus 6fdf9b8d7c Many changes to cleanup config directory and lib installations.
Cleaned up default config directory determination.
Made bootstrap creators for HA always set config directory.
Made bootstrap creators set the local library in the Python Path.
Moved all exceptions to their own file to make imports easier.
Moved default configuration directory be in the users’ profile.
Moved pip installs to be done to a lib folder in the config directory.
Reduced requirements.txt to only the barebones reqs.
2015-08-29 21:11:24 -04:00
Paulus Schoutsen 1b89a502c4 Extract core into own submodule 2015-08-16 20:44:46 -07:00
Paulus Schoutsen d2b5f429fe Remove deprecated code 2015-08-04 16:21:09 -04:00
Paulus Schoutsen 7870e9a5e2 Minor cleanup core 2015-08-03 17:05:33 +02:00
Paulus Schoutsen b346f6e8ad Allow installing component dependencies on the fly 2015-07-07 00:00:21 -07:00
eagleamon bcb4766f95 adds a coloourful log output 2015-06-11 15:01:11 +02:00
Paulus Schoutsen 73dab5a398 Make customize parsing more robust 2015-06-02 21:31:50 -07:00
Paulus Schoutsen a4e0a7f235 Fix platform discovery not working 2015-05-14 21:36:12 -07:00
Paulus Schoutsen c523a0b509 Improve error message when prepare_setup_platform fails. 2015-05-11 22:29:53 -07:00
Paulus Schoutsen 4eeaa16f16 Convert some double to single quotes. 2015-05-11 22:23:38 -07:00
Paulus Schoutsen e630476f9f Allow platforms to specify dependencies 2015-05-11 22:23:20 -07:00
Paulus Schoutsen e0ecb64a10 Use UTC as the internal datetime format 2015-04-28 19:12:05 -07:00
Paulus Schoutsen ad016de653 Move config code to separate module + test cover it 2015-04-26 10:05:01 -07:00
Ryan Kraus 8255164eda Rearranged visibility control and image control in the configuration file. Now a single generic clause can be used to customize any attribute. 2015-04-25 14:47:15 -04:00
Ryan Kraus f77b3dbd0a Added decorate option to configuration file to allow a user to set custom images for different entities. 2015-04-25 00:39:35 -04:00
Paulus Schoutsen b855f422ef Tweak visibility config 2015-04-23 06:41:41 -07:00
Ryan Kraus ff3dacedc0 Moved card visibility logic out of the Entity class and into a VisibilityABC. Then made the Group class inherit the VisibilityABC. No duplication of code now. This is definitely better. 2015-04-22 21:21:50 -04:00
Ryan Kraus 8fcf814eb6 Changed visbility property in configuration.yaml to a hash instead of a list of a single hash. 2015-04-22 21:07:23 -04:00
Ryan Kraus b20424261c 1) Performed many pylint and flake8 fixes to clean up isy994 integration and hidden entities addition. 2) Added necessary code to allow groups to also be hidden. 3) Made most of the weather data from the isy994 component be hidden by default. 2015-04-15 02:05:34 -04:00
Ryan Kraus a3d6972268 1) Added basic back-end framework for supporting hidden entities. 2) Enabled hidden suggestions in the isy994 component entities. 2015-04-14 22:57:32 -04:00
Paulus Schoutsen 2863c2d593 Made bootstrap.setup_component more robust 2015-03-21 22:06:59 -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 7a7f486cb2 Rename config.get_config_path to config.path 2015-03-19 12:27:56 -07:00
Paulus Schoutsen 9b643d57f0 ps: Add a global config object to Home Assistant 2015-03-18 23:02:58 -07:00
Paulus Schoutsen a2558972b9 Empty configuration.yaml no longer crashes setup 2015-03-16 22:20:35 -07:00
theolind 1206c2113c Fixed style error, a line was too long 2015-02-28 20:31:26 +01:00
theolind 461e0d0314 Now converting config values to dictionaries if they are None 2015-02-28 20:17:50 +01:00
theolind 8da1fb1d74 Added example yaml config file, removed old example config, fixed style violation in bootstrap.py 2015-02-28 18:59:45 +01:00
theolind f2b602c7ec Added logic to main that prefers .yaml-config over .conf 2015-02-28 17:42:23 +01:00
theolind 223d2c2c3f Added support for YAML files, now with included python modules 2015-02-28 17:05:38 +01:00
theolind 356732189c Added support for YAML configuration files 2015-02-28 16:56:58 +01:00
Paulus Schoutsen 7dd7c489e8 Fire event for loading component/adding service 2015-02-13 22:49:56 -08:00
Paulus Schoutsen 13ac71bdf0 Clean up http related components 2015-01-30 08:26:06 -08:00
Paulus Schoutsen 8feeafd8a3 Refactor http into frontend and api component 2015-01-29 23:56:21 -08:00