Commit Graph

92 Commits (e31dd4404ed9167bb1ef209c93f80bd998c6e9bc)

Author SHA1 Message Date
Andrey e60f9ca392
More typing (#15449)
## Description:

More typing improvements.

Switch to using `mypy.ini` for flexibility

Add `warn_return_any` check except in `homeassistant.util.yaml` that does typing hacks. Fix some type annotations as resulting from this check and ignore others were fixing is hard.

## 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 20:14:45 +03:00
Paulus Schoutsen b6ca03ce47
Reorg auth (#15443) 2018-07-13 11:43:08 +02:00
Ville Skyttä 6f582dcf24 Lint cleanups (#15243)
* Remove some unused imports

* Fix a flake8 E271
2018-07-01 11:57:01 -04:00
cdce8p 7d9bce2153 Fix extended package support (#14980)
* Fix package recurive merge bug

* Fixed extended package support
2018-06-16 06:55:32 -04:00
cdce8p 6ceafabd78 Extend package support (#14611) 2018-05-25 16:41:50 -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
Boyi C c80b752d0e fix check config not working after #14211 (#14259) 2018-05-04 12:29:07 +02: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
Paulus Schoutsen cdd45e7878 Foundation for users (#13968)
* Add initial user foundation to Home Assistant

* Address comments

* Address comments

* Allow non-ascii passwords

* One more utf-8 hmac compare digest

* Add new line
2018-05-01 18:20:41 +02:00
Johann Kellerman a6b63b669e Don't add Falsy items to list #13412 (#13536) 2018-03-29 17:13:08 -07:00
cdce8p 8a0facb747 Validate basic customize entries (#13478)
* Added schema to validate customize dictionary

* Added test
2018-03-26 19:50:29 -07:00
Johann Kellerman 4270bc7abb Perform check_config service in current process (#13017)
* Perform check_config service in current process

* feedback
2018-03-19 14:20:04 -07: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 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
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
Anders Melchiorsen 247edf1b69 Purge recorder data by default (#12271) 2018-02-11 13:22:59 -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
Anders Melchiorsen acb521330c Add explicit first-time config for new purge_keep_days default (#12246) 2018-02-08 09:44:19 -08:00
Pascal Vizeli dacd7cd8a4
Core support for hass.io calls & Bugfix check_config (#11571)
* Initial overwrites

* Add check_config function.

* Update hassio.py

* Address comments

* add hassio support

* add more tests

* revert core changes

* Address check_config

* Address comment with api_bool

* Bugfix check_config

* Update core.py

* Update test_core.py

* Update config.py

* Update hassio.py

* Update config.py

* Update test_config.py
2018-01-12 15:29:58 +01:00
Pascal Vizeli 9e0a765801
Revert "Backup configuration files before overwriting" (#11269)
* Revert "Adding MotionIP to BinarySensors for HMIP-SMI (#11268)"

This reverts commit c94cc34a8f.

* Revert "Bugfix: 10509 - http is hard coded in plex sensor (#11072)"

This reverts commit 901d4b5489.

* Revert "Fix handling zero values for state_on/state_off (#11264)"

This reverts commit 2e4e3a42cc.

* Revert "Fix inverted sensors on the concord232 binary sensor component (#11261)"

This reverts commit b866687cd7.

* Revert "Proper Steam game names and small fixes (#11182)"

This reverts commit 7faa94046c.

* Revert "Bugfix homematic available modus (#11256)"

This reverts commit 1d579587c1.

* Revert "Fix detection of if a negative node is in use (#11255)"

This reverts commit b28bfad496.

* Revert "added myself to become code owner for miflora and plant (#11251)"

This reverts commit e0682044f0.

* Revert "Add workaround for running tox on Windows platforms (#11188)"

This reverts commit 81f1a65fae.

* Revert "Upgrade to new miflora version 0.2.0 (#11250)"

This reverts commit 8efc4b5ba9.

* Revert "homematic: add username and password to interface config schema (#11214)"

This reverts commit b4e2537de3.

* Revert "Backup configuration files before overwriting (#11216)"

This reverts commit 90e25a6dfb.
2017-12-21 22:33:37 +01:00
Charles Garwood 90e25a6dfb Backup configuration files before overwriting (#11216)
* Backup configuration files before overwriting

* Changed timestamp format from epoch to iso8601 (minus punctuation)
2017-12-19 17:55:24 +01:00
Paulus Schoutsen b56675a7bb
Don't connect to cloud if subscription expired (#11163)
* Final touch for cloud component

* Fix test
2017-12-16 00:42:25 -08:00
Paulus Schoutsen 0877ea07b3 Fix formatting invalid config text (#10319) 2017-11-03 18:12:45 +01:00
Eugenio Panadero 875edef3f0 Fix load of components without any config from packages (#9901)
* Fix load of components without any config from packages

- Add 'None' to the packages config schema validation, to be able to
load components without any more configuration from yaml package files,
like `wake_on_lan`, `media_extractor` and so on.

* test the ability to load components without configuration from packages
2017-10-17 09:59:33 +02:00
Charles Garwood fa37d9800e File permissions fix (#9847)
* Fixing file permissions

* Fixing file permissions
2017-10-13 14:22:41 +02:00
Charles Garwood f837302194 Split map panel out into its own component (#9814) 2017-10-11 17:45:55 +02:00
Paulus Schoutsen 75f902f57e RFC: Create a secrets file and enable HTTP password by default (#9685)
* Create a secret and enable password by default

* Comment out api password secret

* Lint/fix tests
2017-10-05 09:10:29 -07:00
Andrey c73338bf3e Backend changes for customize config panel. (#9134)
* Backend changes for customize config panel.

* Backend changes for customize config panel.

* Add customize.yaml to default config

* Precreate customize.yaml

* Add tests
2017-08-26 10:02:32 -07: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 49c399c358 Update persistent deps dir version in config.py (#8479)
* Update persistent deps dir version in config.py

* Update last version to remove deps dir in tests
2017-07-19 22:59:21 -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
Pascal Vizeli 2dd7f0616e Add security layer to send file output things (#8189)
* Add security layer to send file output things

* Make telegram secure

* fix lint

* fix handling

* invert check

* resolve relative paths

* add test for relative paths

* fix lint

* fix tests

* Address paulus comments

* fix style

* fix tests

* Add more tests

* fix tests

* fix tests

* fix test p2

* fix lint

* fix tests

* Make it available for windows

* Change name / address comments

* fix set

* fix test

* fix tests

* fix test

* fix lint
2017-06-26 00:10:30 +02:00
Paulus Schoutsen 9b640f6a81 Add comment to default config 2017-06-15 22:31:22 -07:00
Alex Harvey 78887c5d5c Start of migration framework, to allow moving of files in the config … (#7740)
* Start of migration framework, to allow moving of files in the config directory to be hidden, ios.conf used as the first one to undergo this change.

* Update const.py

* Update test_config.py

* improvement to syntax
2017-06-01 23:50:04 -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
Paulus Schoutsen 5d820ec188 Add support for automation config panel (#7509)
* Add support for automation config

* Build fromtend

* Lint
2017-05-09 18:44:00 -07:00
Paulus Schoutsen 9afbbbf3fe Remove ordered_dict validator (#7375)
* Remove ordered_dict validator

* Lint

* Update test_config_validation.py
2017-04-30 10:55:03 -07:00
Fabian Affolter 1f4f2d7086 Upgrade voluptuous to 0.10.5 (#7107)
* Upgrade voluptuous to 0.10.5

* Fix tests
2017-04-30 00:42:19 -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
clayton craft 48eeb55198 Add notice regarding submission of analytics (#7263) 2017-04-23 19:59:26 -07:00
Andrey f96e06a2c2 Preserve customize glob order. (#6963)
* Preserve customize glob order.

* add tests
2017-04-06 22:39:35 -07: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
Andrey 85d0f2e861 Make glob preserve order (#6224) 2017-02-25 12:54:04 -08:00
Paulus Schoutsen e2e8b43902 Default config to setup group editor (#6198) 2017-02-23 22:53:16 -08:00
Paulus Schoutsen 235d0057b1 Simplify customize (#6007)
* Simplify customize

* Maintain glob order

* Have glob overrule domain
2017-02-15 19:47:30 -08:00
Paulus Schoutsen dab6d011ca Add check_config API (#5898)
* Add check_config API

* Add config panel to default config

* Add tests

* Lint

* lint
2017-02-12 11:31:46 -08:00
Pascal Vizeli 3f82ef64a1 Move core service from core to components (#5787)
* Move core servcie from core to components

* add new handler for signals/exception

* Static persistent id

* Move unittest

* fix coro/callback

* Add more unittest for new services

* Address comments

* Update __init__.py
2017-02-08 09:17:52 -08:00
Johann Kellerman b48a7e4007 Bugfix customize (#5613) 2017-01-28 23:52:30 +01:00