Commit Graph

2086 Commits (9fb2bf72f9c969defbafcfb92b3207ff807a2a91)

Author SHA1 Message Date
Otto Winter 27c1806897 Python 3.5 adjustments (#13173) 2018-03-15 13:10:54 +02:00
cdce8p d348f09d3d
HomeKit Restructure (new config options) (#12997)
* Restructure
* Pincode will now be autogenerated and display using a persistence notification
* Added 'homekit.start' service
* Added config options
* Renamed files for types
* Improved tests
* Changes (based on feedback)
* Removed CONF_PIN_CODE
* Added services.yaml
* Service will only be registered if auto_start=False
* Bugfix names, changed default port
* Generate aids with zlib.adler32
* Added entity filter, minor changes
* Small changes
2018-03-15 02:48:21 +01:00
Paulus Schoutsen 25fe6ec536 Fix input_boolean Google Assistant serialize error (#13220) 2018-03-14 15:08:23 -07:00
Paulus Schoutsen e1a5e5a8ba
Fix input_boolean Google Assistant serialize error (#13220) 2018-03-14 15:07:37 -07:00
Paulus Schoutsen a9917e7a56 Fix history API (#13214) 2018-03-14 22:29:51 +01:00
Paulus Schoutsen 0a2e949e0a Remove crazy JSON encoding things that are no longer used (#13029)
Catch JSON encoding errors in HTTP view
2018-03-12 23:22:08 +01:00
Otto Winter a34786fb2d Revert "Cast automatically drop connection (#12635)" (#13094)
This reverts commit e14893416f.
2018-03-11 12:52:00 -07:00
Paulus Schoutsen 7018806802 Run asyncio event loop in debug mode during tests (#13058)
* Run asyncio event loop in debug mode during tests

* Remove debug mode again
2018-03-11 12:51:57 -07:00
Paulus Schoutsen a7f34bbce9 Implement Hue available property (#12939) 2018-03-11 12:51:57 -07:00
Otto Winter 1dc5fa145f Revert "Cast automatically drop connection (#12635)" (#13094)
This reverts commit e14893416f.
2018-03-11 12:42:58 -07:00
Paulus Schoutsen d0f089975d
Run asyncio event loop in debug mode during tests (#13058)
* Run asyncio event loop in debug mode during tests

* Remove debug mode again
2018-03-11 12:32:12 -07: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
Matthias Urlichs f5cc40024d Rename homeassistant.util.async to .async_ (#13088)
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
Paulus Schoutsen d42b5a93dd
Implement Hue available property (#12939) 2018-03-11 09:49:28 -07:00
Adam Mills dc8424032b
Remove Z-Wave old/new entity_id attributes (#12652) 2018-03-11 10:30:03 -04:00
Otto Winter d74a2b68c1 Sensor template don't exit early on TemplateError (#13041)
* Sensor template don't exit early on TemplateError

* Add friendly name unknown state test

* Also track entites from attribute templates

* Use set instead of list
2018-03-10 20:45:32 -08:00
Paulus Schoutsen 42359b3b48 Convert decimals from SQL results (#13059) 2018-03-10 10:41:41 -08:00
Paulus Schoutsen 0e00de8a33
Convert decimals from SQL results (#13059) 2018-03-10 10:40:28 -08:00
cdce8p a58d8fc68b HomeKit Bugfix: names (#13031)
* Fix display_names, changed default port (+1)

* Revert port change
2018-03-09 19:42:36 -08:00
Paulus Schoutsen 3c41c0c46e Add support for input boolean to Google Assistant (#13030) 2018-03-09 19:42:36 -08:00
Paulus Schoutsen 6ffc53b290 Make Throttle async aware (#13027)
* Make Throttle async aware

* Lint
2018-03-09 19:42:35 -08:00
Paulus Schoutsen 34c694c20e allow ios device tracker see calls to go through (#13020) 2018-03-09 19:42:35 -08:00
cdce8p 3ca139e21e HomeKit Bugfix: names (#13031)
* Fix display_names, changed default port (+1)

* Revert port change
2018-03-09 19:41:59 -08:00
Paulus Schoutsen a8a895a61b
allow ios device tracker see calls to go through (#13020) 2018-03-09 19:39:50 -08:00
Paulus Schoutsen 36361d623d
Make Throttle async aware (#13027)
* Make Throttle async aware

* Lint
2018-03-09 19:38:51 -08:00
Paulus Schoutsen 652e0d45a9
Add support for input boolean to Google Assistant (#13030) 2018-03-09 19:38:33 -08:00
Otto Winter 4152ac4aa2 Clean up Light Groups (#12962)
* Clean up Light Groups

* Fix tests

* Remove light group from .coveragerc

* async_schedule_update_ha_state called anyway
2018-03-09 09:31:14 -08:00
Johann Kellerman 16d72d2351 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-09 09:31:13 -08:00
Otto Winter ca5f470956 Clean up Light Groups (#12962)
* Clean up Light Groups

* Fix tests

* Remove light group from .coveragerc

* async_schedule_update_ha_state called anyway
2018-03-09 06:15:39 -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
Boyi C 321eb2ec6f Move HomeAssistantView to separate file. Convert http to async syntax. [skip ci] (#12982)
* Move HomeAssistantView to separate file. Convert http to async syntax.

* pylint

* websocket api

* update emulated_hue for async/await

* Lint
2018-03-08 17:51:49 -08:00
corneyl 2ee73ca911 Fixes notify.html5 for notifications on FireFox (#12993)
* Only pass the gcm_key when using Google Cloud Messaging as endpoint.

* Test if the gcm_key is only included for GCM endpoints.
2018-03-08 17:50:17 -08:00
Paulus Schoutsen 7f065e38a7
Check color temp range for google assistant (#12994) 2018-03-08 17:43:41 -08:00
Anders Melchiorsen 44e4f8d1ba Fix Sonos group discovery (#12970)
* Avoid iterating sonos devices that are not yet added

* Rebuild zone topology for each new device
2018-03-08 15:39:31 -08:00
Paulus Schoutsen 9b1a75a74b
Refactor Google Assistant (#12959)
* Refactor Google Assistant

* Fix cloud test

* Fix supported features media player demo

* Fix query

* Fix execute

* Fix demo media player tests

* Add tests for traits

* Lint

* Lint

* Add integration tests

* Add more tests

* update logging

* Catch out of range temp errrors

* Fix cloud error

* Lint
2018-03-08 14:39:10 -08: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 36b9c0a946 Remove weird tests (#12936)
* Remove mediaroom test
* Fix meraki test doing mac lookups
* Fix flaky unknown device config
* Move more device tracker I/O testing into memory
2018-03-06 21:53:02 +02:00
Diogo Gomes 5063464d5e Support for queries with no results (fix for #12856) (#12888)
* Addresses issue #12856

* error -> warning

* added edge case and test

* uff uff

* Added SELECT validation

* Improved tests
2018-03-05 19:44:04 -08:00
Paulus Schoutsen 38af04c6ce
Reinstate our old virtual env check in favor of pip (#12932) 2018-03-05 15:51:37 -08:00
Nicko van Someren 03225cf20f Added checks for empty replies from REST calls and supporting tests (#12904) 2018-03-05 15:30:28 -08:00
Paulus Schoutsen 60d7e32f81
Flaky tests (#12931)
* Skip flaky DDWRT tests

* Import APNS before running tests
2018-03-05 14:13:18 -08:00
Paulus Schoutsen 6a5c7ef43f
Upgrade to aiohttp 3 (#12921)
* Upgrade aiohttp to 3.0.6

* Fix tests

* Fix aiohttp client stream test

* Lint

* Remove drain
2018-03-05 13:28:41 -08:00
Paulus Schoutsen e5c4bba906 Remove unused cloud APIs (#12913) 2018-03-05 22:28:15 +01:00
Per Osbäck f00d5cb8ca update html5 to async/await tests (#12896)
* update html5 to async/await tests

* removed paranthesis
2018-03-04 18:35:07 -08:00
Anders Melchiorsen d418355d4d InfluxDB cleanups (#12903)
* Close influxdb on shutdown

* Ignore inf as an influxdb value

* Remove deprecated CONF_RETRY_QUEUE
2018-03-04 21:01:16 +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
Anders Melchiorsen d06807c634 Improve influxdb throughput (#12882)
* Batch influxdb events for writing

* Name constants
2018-03-03 21:22:31 -08:00
Boris K 95176b0666 Fix 0 value when home-assistant restarts (#12874) 2018-03-03 22:59:25 +01:00
Otto Winter 99eeb01525 Fix light group update before add (#12844)
* Fix light group update before add.

* Revert pytest skip
2018-03-02 15:04:32 -08:00
Anders Melchiorsen dd67192057 Keep auto groups during group reload (#12841)
* Keep auto groups during group reload

* Make protected member public

* Add test
2018-03-02 11:29:49 -08:00
Paulus Schoutsen 4e03176634
Skip flaky light.group test [skipci] (#12847) 2018-03-02 11:19:19 -08:00
Paulus Schoutsen 228b030c82
Cloud unauth (#12840)
* Handle expired refresh token better

* Retry less aggressive

* Newline
2018-03-02 10:33:05 -08:00
Otto Winter 03970764d8 Add light.group platform (#12229)
* Add grouped_light platform

* 📝 Fix Lint issues

* 🎨 Reformat code with yapf

* A Few changes

*  Python 3.5 magic

* Improvements

Included the comments from #11323

* Fixes

* Updates

* Fixes & Tests

* Fix bad-whitespace

* Domain Config Validation

... by rebasing onto #12592

* Style changes & Improvements

* Lint

* Changes according to Review Comments

* Use blocking light.async_turn_*

* Revert "Use blocking light.async_turn_*"

This reverts commit 9e83198552.

* Update service calls and state reporting

* Add group service call tests

* Remove unused constant.
2018-03-01 17:14:26 -08:00
cdce8p 168e1f0e2d Improved Homekit tests (#12800)
* Added test for temperature fahrenheit

* Restructured tests to use more mocks

* Rearanged homekit constants

* Improved 'test_homekit_class'

* Added import statements

* Fix Pylint Test errors
2018-03-01 15:20:02 -08:00
Otto Winter d3386907a4 MQTT Python 3.5 Async Await Syntax (#12815)
* MQTT Async Await

* Remove unused decorator.
2018-03-01 15:06:26 -08:00
Diogo Gomes de3c76983a Filter Sensor (#12650)
* filter sensor platform implementation

* added tests

* default arguments

* Fix for unavailable units during initial startup

* unused variable

* Addresses code review by @MartinHjelmare

* fix

* don't need hass in this test

* Various Improvements

* Added Throttle Filter

* hound fixes

* test throttle filter

* fix

* Address comments by @balloob

* added test, reformulated filter tests

* Precision handling

* address comments from @balloob

* Revert "Precision handling"

This reverts commit f4abdd3702.

* removed stats

* only round floats

* Registry decorator usage

* Tries to address remaining comments
2018-03-01 15:03:01 -08:00
Paulus Schoutsen 23c39ebefd
Fix flakiness in tests (#12806) 2018-03-01 11:47:56 -08:00
Johann Kellerman ff83efe376 is_allowed_path: Also unit test folder #12788 #12807 (#12810) 2018-03-01 18:55:58 +01:00
Paulus Schoutsen 491b3d707c
Add optional words to conversation utterances (#12772)
* Add optional words to conversation utterances

* Conversation to handle singular/plural

* Remove print

* Add pronounce detection to shopping list

* Lint

* fix tests

* Add optional 2 words

* Fix tests

* Conversation: coroutine -> async/await

* Replace \s with space
2018-03-01 07:35:12 -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
Mike O'Driscoll 3416d3f5f1 TekSavvy Sensor unlimited bandwidth support (#12325)
* Support TekSavvy Unlimited Plans

Support TekSavvy account usage for unlimited plans.
Seeing cap limit to 0 will now provide unlimited behaviour on usage calculations.

* Add unit tests to sensor.teksavvy

Add coverage unit tests to TekSavvy Sensor component, none existing previously.
2018-02-28 16:21:10 -08:00
Maximilian Früh 001515bdc4 Add "headers" config parameter to rest switch (#12706)
* Add "headers" config parameter to rest switch

* Minor fix: line length
2018-02-28 14:00:51 -08:00
Paulus Schoutsen f7e9215f5e
Fix when 2 states match with same name (#12771) 2018-02-28 13:39:01 -08:00
Sebastian Muszynski 222748dfbf Xiaomi MiIO Vacuum: Use a unique data key per domain (#12743)
* Use a unique data key per domain.

* Tests fixed.
2018-02-28 13:15:45 -08:00
James Marsh f6c504610b Add custom header support for rest_command (#12646)
* Add support for specifying custom headers for rest_command.
* Added headers configuration to behave similarly to the rest sensor.
* Replaced test_rest_command_content_type which only validated the
  configuration with test_rest_command_headers which tests several
  combinations of parameters that affect the request headers.
2018-02-28 08:16:31 +02:00
Paulus Schoutsen efd155dd3c
Intent: Set light color (#12633)
* Make color_name_to_rgb raise

* Add Light Set Color intent

* Move some methods around

* Cleanup

* Prevent 1 more func call

* Make a generic Set intent for light

* Lint

* lint
2018-02-27 18:02:21 -08:00
Adam Mills 4242411089 Disable asuswrt tests (#12663) 2018-02-26 22:53:54 -08:00
Anders Melchiorsen c1c23bb4b6 Remove automatic sqlite vacuum (#12728) 2018-02-26 22:41:37 -08:00
Adam Mills c1a6131aa8
Update core HSV color scaling to standard scales: (#12649)
Hue is scaled 0-360
Sat is scaled 0-100
Val is scaled 0-100
2018-02-26 22:20:24 -05:00
Johann Kellerman 4821858afb Homekit schema gracefully fail with integer (#12725)
* Homekit schema gracefully fail with integer
* Fix return value
* Added test
* Fix 2
2018-02-27 01:09:49 +01:00
Johann Kellerman 446390a8d1 AsusWRT log exceptions (#12668)
* logexception

* Improve err message #2978

* not quiet

* tests
2018-02-26 16:08:37 -08:00
cdce8p 6a665ffb84 Fix homekit: temperature calculation (#12720) 2018-02-26 22:29:52 +01:00
Paulus Schoutsen a8c9303892
Add history_graph component to demo (#12681) 2018-02-26 00:28:25 -08:00
Robin bf41674e06 Adds simulated sensor (#12539)
* Create simulated.py

* Create test_simulated.py

* Update .coveragerc

* Drop numpy and fix attributes

Drop numpy and fix attributes to be machine readble

* Update test_simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Update simulated.py

* Update test_simulated.py

* Update simulated.py

* Fix default random seed error

* Update simulated.py

* Addresses balloob comments

* Update simulated.py
2018-02-26 00:01:01 -08:00
cdce8p 6e6ae173fd Added config validator for future group platforms (#12592)
* Added cv.EntitiesDoamin(domain) validator

* Check if all entities in string or list belong to domain
* Added tests

* Use factory function and entity_ids

* Different error message

* Typo

* Added entity_domain validator for a single entity_id

* Image_processing platform now uses cv.entity_domain for source validation
2018-02-25 23:48:21 -08:00
cdce8p 27b1d448a3 Homekit Update, Support for TempSensor (°F) (#12676)
* Changed version of "HAP-python" to "v1.1.7"

* Updated acc file to simplify init calls

* Code refactored and '°F' temp Sensors added

* Changed call to 'HomeAccessory' and 'HomeBridge'
* Extended function of 'add_preload_service' to add additional characteristics
* Added function to override characteristic property values

* TemperatureSensor
  * Added unit
  * Added calc_temperature

* Updated tests
2018-02-25 19:27:40 -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
cdce8p eacfbc048a
Improved Homekit tests (#12647)
* Spelling and typos
* Updated 'test_homekit_pyhap_interaction'
* Patch ip_address
2018-02-25 10:58:13 +01:00
Paulus Schoutsen 6d431c3fc3
Allow renaming entities in entity registry (#12636)
* Allow renaming entities in entity registry

* Lint
2018-02-24 10:53:59 -08:00
Otto Winter 2821820281 Cast automatically drop connection (#12635) 2018-02-24 10:27:44 -08:00
kennedyshead 7a44eee093 Fix mclimate accounts with not only melissa components (#12427)
* Fixes for mclimate accounts with not only melissa components

* Fixes melissa sensor to only use HVAC

* Bumping version to 1.0.3 and remove OP_MODE that is not supported

* Removes STATE_AUTO from translation and tests
2018-02-23 23:33:12 +01:00
Otto Winter 230b73d14a Cast unique_id and async discovery (#12474)
* Cast unique_id and async discovery

* Lazily load chromecasts

* Lint

* Fixes & Improvements

* Fixes

* Improve disconnects

cast.disconnect with blocking=False does **not** do I/O; it simply sets an event for the socket client looper

* Add tests

* Remove unnecessary calls

* Lint

* Fix use of hass object
2018-02-23 09:31:22 -08:00
Paulus Schoutsen 1e672b93e7
Fix voluptuous breaking change things (#12611)
* Fix voluptuous breaking change things

* Change xiaomi aqara back
2018-02-22 23:29:42 -08:00
Paulus Schoutsen 6ee3c1b3e5
Hello Python 3.5 (#12610)
* Hello Python 3.5

* Fix test

* Fix tests

* Fix never awaited block till done warnings
2018-02-22 23:22:27 -08:00
Mike Megally f0a1beac5d Allow ignoring call service events in mqtt_eventstream (#12519)
* [WIP] Allow ignoring call service events

This allows a setting a configuration value (False by default to continue the current behavior) which will ignore call service events.

* extra spaces

removed them

* updates from PR review

* removed print

* update spacing

* updated allowed events to allow for custom events, and included some tests

* hound fixes

* Remove unused constant

* Lint
2018-02-22 11:19:18 +01:00
Paulus Schoutsen de72eb8fe9
Make groups entities again (#12574) 2018-02-21 23:42:23 -08:00
Robin 4d7fb2c7de Adds folder sensor (#12208)
* Adds folder sensor

The state of the sensor is the time that the most recently modified
file in a folder was modified.

* Address lint errors

* Edit docstrings

Makes the recommended edits to docstrings

* Update .coveragerc

Add sensor/folder.py

* Update folder.py

* Address requests

Address requests changes

* Adds folder

* Adds test, tidy up

* Tidy

* Update test_folder.py

* Update folder.py

* Fix setup

Fix setup with else statement

* Update folder.py

* Update folder.py

* Remove list of files from attributes

* Update test_folder.py

* Update folder.py

* Update test_folder.py

* Update folder.py

* Update folder.py
2018-02-21 23:21:07 -08:00
Pascal Vizeli b228695907
Hassio cleanup part2 (#12588)
* Update handler.py

* Update handler.py

* Update __init__.py

* Update handler.py

* Update handler.py

* Update __init__.py

* Update tests
2018-02-21 22:42:55 +01:00
Paulus Schoutsen 51c06e35cf
Cloud reconnect tweaks (#12586) 2018-02-21 12:55:33 -08:00
Anders Melchiorsen 2d36d4d9f3 Set event_id foreign key in recorded states (#12580) 2018-02-21 12:51:20 -08:00
Anders Melchiorsen f9ee29a5cd Logbook speedup (#12566)
* Optimize logbook filtering

* Avoid State construction during Events filtering

* Move tuple creation out of loop

* Add benchmark
2018-02-21 10:35:55 -08:00
bottomquark 722926b315 Fix caldav component handling missing dtend (#12562) 2018-02-20 15:37:34 -08:00
Pascal Vizeli 4f96eeb06e Cleanup hass.io component (#12556)
* Cleanup hass.io component

* fix lint

* Fix all tests

* Fix lint

* fix lint

* fix doc lint
2018-02-20 15:24:31 -08:00
Otto Winter 3077444d62 Fix numeric_state condition spamming on unavailable (#12550) 2018-02-20 17:02:27 +01:00
Paulus Schoutsen 39847ea651 Clarify cloud error (#12540)
* Clarify cloud error

* Fix tests
2018-02-20 12:31:43 +01:00
Robin 17bdcac61b Adds filesize component (#12211)
* Create filesize.py

* Update filesize.py

* Updates filesize

Addresses issues raised in review

* Update .coveragerc

* Addresses requested changes

Addresses the changes requested by @baloob.
Additionally the file size in bytes is now available in attributes.

* Create test_filesize.py

This isn't working yet

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* Update test_filesize.py

* fixed valid file test

* Update test_filesize.py

* Fix indentation

Fix incorrect indentation in setup

* Update filesize.py

* Update filesize.py
2018-02-19 23:55:54 -08:00
cdce8p 42ab4e1366 Homekit component test bugfixes for py3.5 2018-02-20 01:40:56 +01:00
Pascal Vizeli f3748cc4fa Add password support (#12525) 2018-02-19 14:49:52 -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
Anders Melchiorsen 635d36c6ba
Rework Sonos media player platform (#12126)
* Rework Sonos media player platform for push

* Ignore play_mode from events where it is missing

* Remove unused preload helper

* Freeze SoCo version

* Updates for entity registry

* Add codeowner

* Use real soco release
2018-02-18 20:05:20 +01:00
Paulus Schoutsen 371fe9c78f
Add example in test how to create list or object in template (#12469) 2018-02-17 11:47:20 -08:00
Richard Lucas fab991bbf6 Map Alexa StepVolume responses to volume_up/down (#12467)
It turns out I misunderstood which media_player services are available
when a media player supports StepVolume. This PR maps the Alexa
StepSpeaker messages to the volume_up and volume_down services.

Currently Alexa allows you to specify the number of steps but the media
player volume_up and volume_down services don't support this. For now I
just look to see if the steps are +/- and call up/down accordingly.
2018-02-17 08:54:15 -05:00
Paulus Schoutsen 3fd61d8f45 Update voluputous (#12463)
* Update voluputous

* Fix http config

* Fix optional with default=None

* Optional, default=none

* Fix defaults in voluptuous schemas

* Fix tests

* Fix update error

* Lint
2018-02-17 10:29:14 +01:00
Otto Winter fe5626b927 Make WUnderground async (#12385)
* 🐎 Async WUnderground

* ∞ Them lines be too long

* Fix pylint warnings

* Changes according to comments

* Remove STATE_UNKNOWN

* 🔬 Fix tests

* Improve tests
2018-02-16 14:54:11 -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
Andrey 13d6e56106 Fix light template to return brightness as int (#12447) 2018-02-16 09:32:11 -08:00
Paulus Schoutsen f32911d036 Cleanup http (#12424)
* Clean up HTTP component

* Clean up HTTP mock

* Remove unused import

* Fix test

* Lint
2018-02-15 22:06:14 +01:00
Otto Winter 5d4b1ecd3b Fix MQTT payload decode returning prematurely (#12420)
* Fix MQTT returning prematurely

* Add test
2018-02-14 22:00:49 -08:00
Paulus Schoutsen 78c44180f4 Extract data validator to own file and add tests (#12401) 2018-02-14 21:06:03 +01:00
Paulus Schoutsen c7416c8986 Remove usage of deprecated assert method (#12379) 2018-02-13 23:25:06 +01:00
Paulus Schoutsen d2cea84254 Allow disabling entities in the registry (#12360) 2018-02-13 13:33:15 +01:00
Mike O'Driscoll 0a558a0e82 Add New Sensor for ISP Start.ca (#12356)
Adding a new sensor for ISP Start.ca to track download/upload usage.
2018-02-12 19:43:56 -08:00
Otto Winter 2c202690d8 Fix WUnderground names (#12346)
* 📝 Fix WUnderground names

* 👻 Fix using event loop callback
2018-02-12 13:15:28 -08:00
Paulus Schoutsen 870728f68f
Mock Module + Platform default to async (#12347)
* Mock Module + Platform default to async

* Change checks
2018-02-12 10:59:20 -08:00
Paulus Schoutsen 04b68902e3
Fix platform dependencies (#12330) 2018-02-11 23:26:52 -08:00
Albert Lee ebe4418afe device_tracker.asuswrt: Ignore unreachable ip neigh entries (#12201) 2018-02-11 23:24:29 -08:00
Mike O'Driscoll eaa2791539 Unifi tracking filter by SSID (#12281)
Enable unifi device tracker component to track devices only
on specific SSIDs.
2018-02-11 23:23:53 -08:00
Richard Lucas 7059b6c6c1 Always return lockState == LOCKED when handling Alexa.LockController (#12328) 2018-02-11 23:20:54 -08:00
Paulus Schoutsen 5d15b257c4
Fix line endings [skipci] (#12333) 2018-02-11 23:07:28 -08:00
Richard Lucas 669929de06 Fix Report State for Alexa Brightness Controller (#12318)
* Fix Report State for Alexa Brightness Controller

* Lint
2018-02-11 22:36:22 -08:00
Paulus Schoutsen eb7adc74ef
Respect entity namespace for entity registry (#12313)
* Respect entity namespace for entity registry

* Lint
2018-02-11 20:55:38 -08:00
Anders Melchiorsen 247edf1b69 Purge recorder data by default (#12271) 2018-02-11 13:22:59 -08:00
NovapaX 219ed7331c add friendly_name_template to template sensor (#12268)
* add friendly_name_template to template sensor.
If set, overrides friendly_name setting.

* Add test
2018-02-11 12:12:30 -08:00
Richard Lucas 767d3c6206 Fix Alexa Step Volume (#12314) 2018-02-11 11:25:05 -08:00
Otto Winter e4a826d1c1 📝 Fix fixture encoding (#12296) 2018-02-11 11:01:44 -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
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
Rene Nulsch 64c5d26a84 Fix Panel_IFrame - FTP URL not allowed in 0.63 (#12295) 2018-02-11 09:19:31 -08:00
Rene Nulsch 2edebfee0a Fix config error for FTP links, add test (#12294) 2018-02-11 09:19:00 -08:00
Otto Winter b1c0cabe6c Fix MQTT retained message not being re-dispatched (#12004)
* Fix MQTT retained message not being re-dispatched

* Fix tests

* Use paho-mqtt for retained messages

* Improve code style

* Store list of subscribers

* Fix lint error

* Adhere to Home Assistant's logging standard

"Try to avoid brackets and additional quotes around the output to make it easier for users to parse the log."
 - https://home-assistant.io/developers/development_guidelines/

* Add reconnect tests

* Fix lint error

* Introduce Subscription

Tests still need to be updated

* Use namedtuple for MQTT messages

... And fix issues

Accessing the config manually at runtime isn't ideal

* Fix MQTT __init__.py tests

* Updated usage of Mocks
* Moved tests that were testing subscriptions out of the MQTTComponent test, because of how mock.patch was used
* Adjusted the remaining tests for the MQTT clients new behavior - e.g. self.progress was removed
* Updated the async_fire_mqtt_message helper

*  Update MQTT tests

* Re-introduce the MQTT subscriptions through the dispatcher for tests - quite ugly though...  🚧
* Update fixtures to use our new MQTT mock 🎨

* 📝 Update base code according to comments

* 🔨 Adjust MQTT test base

* 🔨 Update other MQTT tests

* 🍎 Fix carriage return in source files

Apparently test_mqtt_json.py and test_mqtt_template.py were written on Windows. In order to not mess up the diff, I'll just redo the carriage return.

* 🎨 Remove unused import

* 📝 Remove fire_mqtt_client_message

* 🐛 Fix using python 3.6 method

What's very interesting is that 3.4 didn't fail on travis...

* 🐛 Fix using assert directly
2018-02-11 09:17:58 -08:00
Paulus Schoutsen 17e5740a0c
Allow overriding name via entity registry (#12292)
* Allow overriding name via entity registry

* Update requirements
2018-02-11 09:16:01 -08:00
Paulus Schoutsen 8b9eab196c
Attempt fixing flakiness of check config test (#12283)
* Attempt fixing check_config script test flakiness

* Fix logging

* remove cleanup as Python will exit

* Make sure we don't enqueue magicmocks

* Lint

* Reinstate cleanup as it broke secret tests
2018-02-11 09:00:02 -08:00
Johann Kellerman 65c6f72c9d check_config check bootstrap errors (#12291) 2018-02-10 23:40:48 -08:00
Paulus Schoutsen f2296e1ff8 Retry keyset cloud (#12270)
* Use less threads in helpers.event tests

* Add helpers.event.async_call_later

* Cloud: retry fetching keyset
2018-02-10 11:40:24 +01:00
escoand cad9e9a4cb allow wildcards in subscription (#12247)
* allow wildcards in subscription

* remove whitespaces

* make function public

* also implement for mqtt_json

* avoid mqtt-outside topic matching

* add wildcard tests

* add not matching wildcard tests

* fix not-matching tests
2018-02-09 15:22:50 -08:00
Albert Lee 1db4df6d3a device_tracker.asuswrt: Clean up unused connection param (#12262) 2018-02-09 15:21:10 -08:00
Otto Winter 2ae0c5653e Fix source code using Windows newline (#12248)
* 🚜 Fix usage of carriage return

* 🤝 Rebase and repeat

* 🚜 Fix file permissions
2018-02-09 08:11:47 +01:00
Eu 905bb36e6a Added password mode to input_text (obscure content of text box) (#11849)
* Round values to one decimal

Temperature detection range: -20 - 60 Deg.C ( + / - 0.3 Deg.C )
Humidity detection range: 0 - 100pct RH ( + / - 0.3pct )
Atmospheric pressure detection range: 30 - 110KPa ( + / - 120Pa )

* Add password mode option

Hide the content of the input_text field

* Revert "Round values to one decimal"

This reverts commit a3124a6aaa.

* Added test for mode option

* Added newline (lint)
2018-02-08 12:29:33 +01:00
mkfink 25cbc8317f Force update support for mqtt binary sensor (#12092) 2018-02-08 12:28:12 +01:00
Anders Melchiorsen 6265d1b747 Avoid influxdb filling connection pool (#12182)
* Add a processing queue to influxdb

* Updates after reviews

* Remove lint

* Move retry loop to thread class

* Move constant calculation out of loop

* Deprecate retry_queue_limit
2018-02-08 12:25:26 +01:00
Paulus Schoutsen 5601fbdc7a Entity layer cleanup (#12237)
* Simplify entity update

* Split entity platform from entity component

* Decouple entity platform from entity component

* Always include unit of measurement again

* Lint

* Fix test
2018-02-08 12:16:51 +01:00
Diogo Gomes 0300229085 SQL sensor (#12142)
* Initial Commit

* Passed all checks

* Make DB_URL required

* addresses review comments from @fabaff

* unused variable
2018-02-07 23:32:39 -08:00
kennedyshead bd29cd2ba2 Fixes according to review from @MartinHjelmare Thank you. (#12171) 2018-02-06 21:27:35 +01:00
Dan Nixon 844337ca42 Properly handle thresholds of zero (#12175)
Explicitly test for thresholds to be None rather than truth value
testing (which for number types returns False for zero values).
2018-02-06 10:32:56 -08:00
tadly 98b47cecbd Upgrade wakeonlan to 1.0.0 (#12190) 2018-02-05 16:04:31 -08:00
Richard Lucas e7a0759e1c Add support for Alexa.StepSpeaker (#12183) 2018-02-05 16:02:08 -08:00
hawk259 4f0776de13 Binary Sensor Template: Add icon_template and entity_picture_template support (#12158)
* Binary Sensor Template: Add icon_template and entity_picture_template support

* fix white space

* Added else logging and return state
2018-02-05 23:30:56 +01:00
Tod Schmidt f5030d9ebf Services (small_pr)(fix): Added missing return on data template error (#12184)
* Added return on data template error

* Rebased so not sure why spelling errors returned...
2018-02-05 09:19:56 +01:00
kennedyshead 8fe339d2a8 Tests for samsungtv (#11933)
* Testing samsungtv

* Remove samsungtv from .coveragerc
2018-02-03 13:09:16 -05:00
ruohan.chen 4ac9e7edf4 fix generic_thermostat bug when restore state from HA start up (#12134)
* fix generic_thermostat bug when restore state from HA start up

if you don't set "initial_operation_mode" in config, you will get
`self._enabled = True` when init GenericThermostat. And then you will
miss the `if self._current_operation != STATE_OFF` statement and the
self._enabled still keep `True`. That's the problem

* add a test to describe the restore case
2018-02-03 16:59:19 +01:00