Commit Graph

206 Commits (895306f8228f58cab49c83a87db7077978c9dfa0)

Author SHA1 Message Date
Paulus Schoutsen e014a84215
Nest config flow (#14921)
* Move nest to dir based component

* Add config flow for Nest

* Load Nest platforms via config entry

* Add tests for Nest config flow

* Import existing access tokens as config entries

* Lint

* Update coverage

* Update translation

* Fix tests

* Address strings

* Use python-nest token resolution

* Lint

* Do not do I/O inside constructor

* Lint

* Update test requirements
2018-06-13 11:14:52 -04:00
Hate-Usernames a373793029 pytradfri 5.5.1: Improved 3rd party bulb support (#14887)
* Bump pytradfri version

* Update light component

* Add tests

* lint

* Docstring typos

* Blank line

* lint

* 5.5.1

* Fix tests on py3.5
2018-06-13 07:17:52 +02:00
Paulus Schoutsen 6b9addfeea Update release script 2018-05-26 11:54:50 -04:00
cdce8p 8d017b7678 script/lint: Ensure there are files to test with pylint (#14363) 2018-05-10 12:47:04 +02:00
koolsb 37cd63ea5a Add blackbird media player component (#13549) 2018-04-19 11:35:38 +02:00
Adam Mills ccba858ae1 Fix for Lokalise backend misinterpretation of keys (#13986)
The Lokalise server has a bug that the internal portion of key
references was misinterpreted as a symfony key, and was getting auto
converted by the convert placeholders feature. Since we don't use this
we're turning it off to work around the bug.
2018-04-18 15:58:47 -04:00
Matthew Garrett ac2298189e Add support for controlling homekit lights and switches (#13346)
* Add support for controlling homekit lights and switches

This adds support for controlling lights and switches that expose a HomeKit
control interface, avoiding the requirement to implement protocol-specific
components.

* Comment out the homekit requirement

This needs to build native code, so leave it commented for now

* Review updates

* Make HomeKit auto-discovery optional

Add an "enable" argument to the discovery component and add a list of
optional devices types (currently just HomeKit) to discover

* Further review comments

* Update requirements_all.txt

* Fix houndci complaints

* Further review updates

* Final review fixup

* Lint fixups

* Fix discovery tests

* Further review updates
2018-04-13 19:25:35 +02:00
Diogo Gomes 22a1b99e57 UPnP async (#13666)
* moved from miniupnpc to pyupnp-async

* update requirements

* Tests added

* hound

* update requirements_test_all.txt

* update gen_requirements_all.py

* addresses @pvizeli requested changes

* address review comments
2018-04-13 00:22:52 +02:00
Johann Kellerman bd93f10d3c script/lazytox: Ensure Flake8 passes for tests/ (#13794) 2018-04-09 21:24:50 -04:00
Johann Kellerman b01dceaff2
Qwikswitch sensors (#13622) 2018-04-08 21:59:19 +02:00
Paulus Schoutsen ff9f500c51
Unflake folder watcher test (#13569)
* Unflake folder watcher test

* Fix tests

* Lint
2018-04-01 08:30:14 -07:00
Paulus Schoutsen 0cfc7256ac Merge branch 'rc' into dev 2018-03-30 14:47:39 -07:00
Kane610 931bceefd9 deCONZ config entry (#13402)
* Try config entries

* Testing

* Working flow

* Config entry text strings

* Removed manual inputs for config flow

* Support unloading of config entry

* Bump requirement to v33

* Fix comments from test

* Make sure that only one deCONZ instance can be set up

* Hass doesn't support unloading platforms yet

* Modify get_api_key to be testable

* Fix hound comments

* Add test dependency

* Add test for no key

* Bump requirement to v35
Add pydeconz to list of test components

* Don't have a check in async_setup that domain exists in hass.data
2018-03-30 00:34:26 -07:00
Paulus Schoutsen 78f3e01854 Fix version bump script 2018-03-30 00:25:47 -07:00
Robin df78eecc1b Adds folder_watcher component (#12918)
* Create watchdog_file_watcher.py

* Rename watchdog_file_watcher.py to folder_watcher.py

* Address a number of issues

* Adds filter

* Adds pattern matching

* Adds create_event_handler()

* Update folder_watcher.py

* Adds run_setup()

* Remove stop_watching()

* Adds shutdown()

* Update config to allow patterns on each folder

* Update to patterns from filters

* Adds watchdog

* Fix indents on schema

* Update folder_watcher.py

* Create test_file_watcher.py

* Fix lints

* Add test_invalid_path()

* Adds folder_watcher

* Update test_file_watcher.py

* Update folder_watcher.py

* Simplify config

* Adapt for new config

* Run observer.schedule() on EVENT_HOMEASSISTANT_START

* Amend Watcher removing entity and tidying startup

* Tidy config

* Rename process to on_any_event for consistency

* Rename on_any_event back to process

Using `on_any_event` resulted in 2 events being fired

* Update folder_watcher.py

* Fix return False on setup

* Update test_file_watcher.py

* Update folder_watcher.py

* Adds watchdog

* Undo adding watchdog

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Update test_file_watcher.py

* Add event

* Update test_file_watcher.py

* Update .coveragerc

* Update test_file_watcher.py

* Update test_file_watcher.py

* debug + join

* test event

* lint

* lint

* Rename test_file_watcher.py to test_folder_watcher.py

* hound

* Tidy test

* Further refine test

* Adds to test_all

* Fix test for py35

* Change test again

* Update test_folder_watcher.py

* Fix test

* Add watchdog to test

* Update folder_watcher.py

* add watchdog

* Update folder_watcher.py
2018-03-29 18:10:20 -07:00
Paulus Schoutsen 3639a4470c Use twine for release 2018-03-26 16:16:42 -07:00
Paulus Schoutsen a06eea444a version should contain just 'b' not 'beta' (#13476) 2018-03-26 16:09:18 -07:00
Paulus Schoutsen 93b9ec0b0f Add version bump script (#13447)
* Add version bump script

* Lint
2018-03-25 18:23:31 -07:00
Paulus Schoutsen 8e14e803cb Fix release script 2018-03-23 14:27:21 -07:00
Fabien Piuzzi 0deef34881 Adding Foobot device sensor (#12417)
* Added Foobot device sensor

* Added error handling tests

* Corrections after PR review.

* Migrated to async/await syntax

 * lint fixes
 * stop raising HomeAssistantError
 * debug log for number of requests

* Moved shared data between sensors from a class attribute to a separate class

* Made test more async-aware

disabled setup error test for now as it's not working

* Working failure scenarios tests
2018-03-15 19:50:58 -07:00
Adam Mills 14aa4e7694
Lint script tweaks (#13093)
* Also lint working tree files

When performing a git diff of upstream/dev..., git is diffing against
the current HEAD, but does not include working tree files. By manually
calculating a merge-base SHA to diff against, git will still diff those
files.

* Don't pylint tests files, since we don't in CI

* Use merge base for lazytox

* Simplify files changed header
2018-03-11 16:15:09 -04:00
Adam Mills 26960283a0 Config flow translations (#13066)
* Development script for testing translation strings

* Localize backend of config flow

* Fix hue tests

* Update hue.en.json

* Move components to individual directories

* Bridge -> bridge
2018-03-11 12:04:34 -07:00
cdce8p 7ea7fc8d38 Script/lint, Lazytox: Fix issue to ignore delete files (#13051)
* Fix issue to ignore delete files

* Updated lazytox
2018-03-10 09:12:23 -08:00
Otto Winter 2fae86bbd3
Make lazytox script executable (#13040) 2018-03-10 08:39:49 +01:00
Johann Kellerman 37d8cd7b75
New lazytox.py script (#12862) 2018-03-09 22:27:39 +02:00
cdce8p eaf525d41d
Script/gen_requirements: Ignore package families (#12963)
* Added fnmatch for IGNORE_PACKAGE_FAMILIES
2018-03-09 00:28:49 +01:00
Adam Mills a99c8eb6c6
Pin lokalise script to working version (#12965) 2018-03-07 09:46:21 -05:00
maxclaey 4218b31e7b Add support for alarm system, switch and thermostat to homekit (#12819)
* Added support for security system, switch and thermostat
* Processing review
* Only perform set call when the call didn't come from HomeKit
* Added support for alarm_code
* Take into account review remarks
* Provide tests for HomeKit security systems, switches and thermostats
* Support STATE_AUTO
* Guard if state exists
* Improve support for thermostat auto mode
* Provide both high and low at the same time for home assistant
* Set default values within accepted ranges
* Added tests for auto mode
* Fix thermostat test error
* Use attributes.get instead of indexing for safety
* Avoid hardcoded attributes in tests
2018-03-07 13:17:52 +01:00
Paulus Schoutsen 67c49a7662
Add config flow for Hue (#12830)
* Add config flow for Hue

* Upgrade to aiohue 0.2

* Fix tests

* Add tests

* Add aiohue to test requirements

* Bump aiohue dependency

* Lint

* Lint

* Fix aiohttp mock

* Lint

* Fix tests
2018-03-03 21:28:04 -08:00
cdce8p 17ba813a6d
Changed default from `all` to `changed` (#12660)
* Default option now '--changed'
* to check all files, use: '--all' or 'tox -e lint'
2018-03-01 18:02:19 +01:00
Adam Mills 9f35d4dfca Translation cleanup (#12804)
* Inline load/save JSON

* Skip cleanup on travis deploy
2018-02-28 20:04:20 -08:00
Adam Mills b434ffba2d Support serving of backend translations (#12453)
* Add view to support backend translation fetching

* Load backend translations from component json

* Translations for season sensor

* Scripts to merge and unpack Lokalise translations

* Fix copy paste error

* Serve post-lokalise translations to frontend

* Linting

* Auto-deploy translations with Travis

* Commit post-lokalise translation files

* Split logic into more helper functions

* Fall back to English for missing keys

* Move local translation copies to `.translations`

* Linting

* Initial tests

* Remove unnecessary file check

* Convert translation helper to async/await

* Convert translation helper tests to async/await

* Use set subtraction to find missing_components

* load_translation_files use component->file mapping

* Remove duplicated resources fetching

Get to take advantage of the slick Python 3.5 dict merging here.

* Switch to live project ID
2018-02-28 19:31:38 -08:00
Pascal Vizeli 9751fed493 Don't allow to use a old unsecure library (#12715)
* Don't allow to use a old unsecury library

* Update gen_requirements_all.py

* Cryptodome fix for python-broadlink

* Coinbase cryptodome fix
2018-02-27 01:58:45 -08:00
Lewis Juggins e8173fbc16
Enable pytradfri during build, and include in Docker (#12662) 2018-02-25 18:20:43 +00: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
Adam Mills f51a3738aa
Check if $files is empty, don't try to execute it (#12651) 2018-02-24 22:11:49 -05:00
cdce8p ffd3889271 Updated script/lint (#12600)
* Compare to common ancestor
* Check if no file was changed
2018-02-22 15:22:59 -08:00
Paulus Schoutsen e37974c5fc Lint 2018-02-19 23:10:44 -08:00
cdce8p eec3bad94f Add support for HomeKit (#12488)
* Basic Homekit support

* Added Temperatur Sensor
* Added Window Cover

* Code refactored

* Added class HomeAccessory(Accessory)
* Added class HomeBridge(Bridge)
* Changed homekit imports to relative, to enable use in custom_components
* Updated requirements
* Added docs
* Other smaller changes

* Changed Homekit from entity to class

* Changes based on feedback
* Updated config schema
* Add only covers that support set_cover_position

* Addressed comments, updated to pyhap==1.1.5

* For lint: added files to gen_requirements_all
* Added codeowner

* Small change to Wrapper classes

* Moved imports to import_types, small changes

* Small changes, added tests

* Homekit class: removed add_accessory since it's already covered by pyhap
* Added test requirement: HAP-python
* Added test suit for homekit setup and interaction between HA and pyhap
* Added test suit for get_accessories function

* Test bugfix

* Added validate pincode, tests for cover and sensor types
2018-02-19 14:46:22 -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
cdce8p 7e2e82d956 Print every changed file on new line (#12412) 2018-02-14 22:01:30 -08:00
Tod Schmidt 26209de2f2 Move HassIntent handler code into helpers/intent (#12181)
* Moved TurnOn/Off Intents to component

* Removed unused import

* Lint fix which my local runs dont catch apparently...

* Moved hass intent code into intent

* Added test for toggle to conversation.

* Fixed toggle tests

* Update intent.py

* Added homeassistant.helpers to gen_requirements script.

* Update intent.py

* Update intent.py

* Changed return value for _match_entity

* Moved consts and requirements

* Removed unused import

* Removed http view

* Removed http import

* Removed fuzzywuzzy dependency

* woof

* A few cleanups

* Added domain filtering to entities

* Clarified class doc string

* Added doc string

* Added test in test_init

* woof

* Cleanup entity matching

* Update intent.py

* removed uneeded setup from tests
2018-02-11 09:33:19 -08:00
tschmidty69 ffe832763d Pushbullet (fix) invalid keyword, added unittests (#11804)
* Fixed unittests

* revert requirements

* added pushbullet.py to requirements

* updated requirements
2018-01-24 21:06:35 +01:00
arcsur 09e3bf94eb BME680 Sensor Component (#11695)
* Adding BME680 Sensor Component

* Flake8 lint fixes

* PyLint fixes

* Fix for log line

* Updating requirements for testing

* Fix PyLint Log format errors and add to coveragerc ommisions as requires sensor connected

* Regenerated requirements_all.txt

* Added Pylint exception for import error of system specific library

* Refactored async_add_platform to move IO out to avoid heavy yield usage
2018-01-22 23:51:52 -08:00
Egor Tsinko eeb309aea1 Functinality to save/restore snapshots for monoprice platform (#10296)
* added functionality to save/restore snapshots to monoprice platform

* renamed monoprice_snapshot, monoprice_restore to snapshot, restore

This is to simplify refactoring of snapshot/restore functionality for monoprice, snapcast and sonos in the future
2017-12-22 10:26:34 +01:00
maxlaverse 04cb893d10 Add a caldav calendar component (#10842)
* Add caldav component

* Code review - 1

* Code review - 2

* Sort imports
2017-12-10 17:44:28 +01:00
Joe Lu f892c3394b Add support for Canary component and platforms (#10306)
* Add Canary component

* Made some change to how canary data is updated and stored

* Updated to use py-canary:0.1.2

* Addressed flake8 warnings

* Import canary API locally

* Import canary API locally again

* Addressed pylint errors

* Updated requirements_all.txt

* Fixed incorrect unit of measurement for air quality sensor

* Added tests for Canary component and sensors

* Updated canary component to handle exception better when initializing

* Fixed tests

* Fixed tests again

* Addressed review comments

* Fixed houndci error

* Addressed comment about camera force update

* Addressed comment regarding timeout when fetching camera image

* Updated to use py-canary==0.2.2

* Increased update frequency to 30 seconds

* Added support for Canary alarm control panel

* Address review comments

* Fixed houndci error

* Fixed lint errors

* Updated test to only test setup component / platform

* Fixed flake error

* Fixed failing test

* Uptake py-canary:0.2.3

* canary.alarm_control_panel DISARM is now mapped to canary PRIVACY mode

* Fixed failing tests

* Removed unnecessary methods

* Removed polling in canary camera component and update camera info when getting camera image

* Added more tests to cover Canary sensors

* Address review comments

* Addressed review comment in tests

* Fixed pylint errors

* Excluded canary alarm_control_panel and camera from coverage calculation
2017-12-08 10:40:45 +01:00
Lewis Juggins cfb1853bbd
Update pytradfri to 4.1.0 (#10521) 2017-11-22 09:37:20 +00:00
Paulus Schoutsen 3f5c748560
Reorganize lint travis builds (#10670)
* tox cleanup

* 1 tox step

* Revert pytest sugar changes

* Tox: make pylint its own task

* Bump Travis to 30 minutes timeout
2017-11-19 17:39:24 -08:00
Adam Cooper 72ce9ec321 Add platform and sensors for Vultr VPS (#9928)
* Initial commit of Vultr components

Have a working Vultr hub and binary sensor which pulls down the
following attributes of your VPS:
 - Date created
 - Subscription id (server id)
 - Cost per month (in US$)
 - Operating System installed
 - IPv4 address
 - label (human readable name)
 - region
 - number of vcpus
 - which storage package chosen
 - IPV6 address (if applicable)
 - RAM amount

Working next on sensor and then testing / coverage.

* Added Vultr sensor for pending charges and current bandwidth. Refactored binary_sensor and hub too

* Corrected is_on bases

* Added basic tests for Vultr binary & platform

* Updated require files

* Changing test fixture to highlight different cases

* Written basic test for sensor.vultr

* Resolved linting errors and broken test

* Increase test coverage and corrected docs

* Resolved hound issues

* Revert back negative binary test

* Another hound resolve

* Refactoring and adding is switch, moving over to vultr branch

* Made Vultr components more resiliant to invalid configs

* Added negetive test for vultr binary sensor

* Added better testing of vultr sensor

* Resolved vultr platform test affecting subsequent vultr tests

* Moving VULTR components to single use design

* Added in sensor name config

* Added missing sensors var

* Resolved init data setting of sensors, added in name conf to switch

* Made the Vultr component more resiliant to startup failure with better alerting

* Various Vultr component changes

- Refactored sensor, binary_sensor, and switch to reference one subscription
- Renamed CURRENT_BANDWIDTH_GB monitored condition to CURRENT_BANDWIDTH_USED
- Improved test coverage

* Resolved local tox linting issue

* Added more testing for Vultr switch

* Improved test coverage for Vultr components

* Made PR comment changes to vultr binary sensor

* Made PR comment changes to Vultr sensor

* resolved PR comments for Vultr Switch

* Resolved vultr sensor name and improved tests

* Improved Vultr switch testing (default name formatting)

* Removed vultr hub failure checking
2017-11-05 14:10:14 +01:00