Commit Graph

1021 Commits (5aa72562a7b87df905321a2b59feda2f7007e6f6)

Author SHA1 Message Date
Adam Mills dddbce82f5 ZWave Sensor tests (#6721)
* ZWave Sensor tests

* Add missed coverage
2017-03-20 13:17:17 -04:00
Adam Mills 8325f9db8a Add zwave light tests (#6710)
* Add zwave light tests

* Test turn_off
2017-03-19 22:22:13 -07:00
printzlau 1cb2a6add0 automatically use bundled certificate it set to auto (#6707)
* automatically use bundled certificate if certificate-parameter is set to 'auto' and seperate this from which port is specified

* Fix travis error and long lines

* Update __init__.py
2017-03-19 14:51:53 -07:00
Greg Dowling acf75b5253 Revise power and energy units and property names. (#6212)
* Revise power and energy units and property names.

* Add change for new wemo parameter.
2017-03-19 22:02:11 +01:00
martinfrancois 678f273002 Rflink: added support for lights with toggle type (#6521)
* added support for lights with toggle type

* fixed style errors

* introduced tests for the toggle type

it's not passing yet because of an assertionerror at line 407

* updated to reflect tristate of "state"

* Format code according to pep8

Added line break for import that was too long.

* fixed lint, replaced if statement with 'var = bool(test)'

* changed implementation of state check according to bug on 6bceb04ca1 (r106758784)
2017-03-18 21:34:17 +01:00
miniconfig b5149dfba6 Added support for multiple efergy sensors in the same household. (#6630)
* Added support for multiple efergy sensors in the same household.
Also added inital tests for the efergy platform.

* Fixed current_values units.
Changed name to include efergy_ prefix.
2017-03-16 23:22:10 -07:00
Fabian Affolter c46ba3446d Upgrade astral to 1.4 (#6332)
* Upgrade astral to 1.4

* Update test for norway
2017-03-16 17:38:46 +01:00
John Arild Berentsen e75a66ed20 Add Zwave sensors test (#6640)
* Test for zwave sensor

* Add test for ZWave sensors

* Hound...

* Hound...

* Review changes
2017-03-16 08:25:37 -04:00
John Arild Berentsen 5aaa1f8404 Add test for Z-wave switch (#6619)
* Add test for Z-wave switch

* Changes for new tests
2017-03-16 11:05:51 +01:00
Wolf-Bastian Pöttner 509cfb6433 Added workday sensor (#6599)
* Added workday sensor

* Added unit tests
2017-03-15 23:46:13 -07:00
Pascal Vizeli 774fd19638 Bugfix RFLINK remove group (#6580)
* Bugfix RFLINK remove group

* Remove group hack from lutron too

* fix tests

* fix lint

* fix lint
2017-03-15 23:08:47 -07:00
Adam Mills 326337777a Add ZWave cover tests (#6648) 2017-03-15 22:06:37 -07:00
Paulus Schoutsen 96e22c7b41 Remove event decorators (#6634) 2017-03-15 14:46:57 +01:00
Adam Mills 5e5d2e8ab8 Tests for ZWave climate (#6629)
But wait, there's more! Also a few fixes discovered writing the tests.
2017-03-14 20:24:35 -07:00
Paulus Schoutsen 1a7ffdca52 Add "Refactor zwave discovery to entity schema" (#6565)
* Revert "Revert "Refactor zwave discovery to entity schema (#6445)" (#6564)"

This reverts commit 58826b264a.

* Update zwave tests for enitity schema

* Fix merge error

* Switch dict_id to id(self)
2017-03-14 19:55:33 -04:00
Johan Bloemberg bd3fbe8363 Upgrade to dsmr_parser 0.8, supporting protocol 3 and 5. (#6600)
* Upgrade to dsmr_parser 0.8, supporting protocol 3 and 5.

* Update tests for new import.
2017-03-14 20:16:43 +01:00
hawk259 f4d8095e54 Add configurable timeout option to notify/smtp (#6609)
* Add configurable timeout option to notify/smtp

* Updated smtp test to include timeout param

* fixed 80 column style issue
2017-03-14 19:00:16 +01:00
Pascal Vizeli 5d301590c3 Remove dispatcher camera (#6579) 2017-03-13 17:54:28 +01:00
Adam Mills 55d60a6a13 ZWave binary sensor tests (#6555)
* ZWave binary sensor tests

* Test fixes

* Improve coverage of features
2017-03-12 22:08:53 -07:00
Dennis de Greef 5183cb5903 Be able to select mqtt:tls_version for Python < 3.6 (#6442)
* Be able to select tls_version

* This test should always assert this value, not only in 3.6

* Disable linting on future property (py36)

* Only allow TLS 1.0, 1.1 and 1.2

* Fix line length issue

* Fix check config tests

* Allow auto as a TLS version
2017-03-12 22:02:59 -07:00
Boris K 9ac3928600 Add type configuration in history_stats (#6430) 2017-03-11 10:38:18 -08:00
Róbert Nagy 11f11481b2 Force update support for MQTT sensor (#6492) 2017-03-11 10:07:52 -08:00
Caleb b705b3ddb9 Update to Pyunifi2.0 (#6490)
* Updated pyUnifi

* Missing comma

* Security opt-out, not opt-in

* Adjust minimal values

* Update to pyUnifi 2.0
2017-03-10 11:15:21 +01:00
happyleaves 7892297240 more moon states 2017-03-09 16:54:04 -05:00
Pascal Vizeli 20fcd1f0e2 Bugfix mqtt socket memory error (#6501)
* Bugfix mqtt socket memory error

* Fix tests

* Fix lint
2017-03-09 06:31:43 -08:00
Paulus Schoutsen 855756cb2a Add first pass at Z-Wave light tests (#6483)
* Add first pass at Z-Wave light tests

* Remove unused SIGNAL_VALUE

* Lint

* Update test_init.py
2017-03-09 14:35:04 +01:00
Robbie Trencheny 2b97449d98 Expand MQTT lights (#6481)
* Add effect support to MQTT Light

* Use effect state topic for supported_features

* Dont use rainbow as default color

* Add color_temp support to MQTT JSON Light

* Add effect to MQTT JSON light

* Support lights in MQTT discovery

* Allow discovered devices to set their platform

* Add white value support to MQTT Light

* Add white value support to MQTT JSON Light

* Remove blank line

* Add color_temp support to MQTT Template light

* Add white value support to MQTT Template Light

* Remove unused SUPPORT_MQTT_TEMPLATE and stale unused flash and transition code from MQTT Template

* Add XY Color to MQTT Light Platform

* Fix syntax

* Fix more syntax errors

* Revert "Remove unused SUPPORT_MQTT_TEMPLATE and stale unused flash and transition code from MQTT Template"

This reverts commit c03798cb63.

* MQTT Template supports flash and transition but doesnt allow templating of the values

* Add XY color support to MQTT JSON

* Proper variable names

* Only allow whitelisted MQTT platforms to be loaded via MQTT Discovery

* Minor tweaks.
2017-03-07 23:01:36 -08:00
Pascal Vizeli c937a7bcb0 Add support for remove services / Reload script support (#6441)
* Add support for remove services / Reload script support

* Reload support for scripts

* Add more unittest for services

* Add unittest for script reload

* Address paulus comments
2017-03-07 22:51:34 -08:00
Pascal Vizeli e7f442d66b Add dispatcher camera for internal image. (#6471)
* Add dispatcher camera for internal image.

* fix lint

* Add unittest

* Update dispatcher.py
2017-03-07 22:37:23 -08:00
Johan Bloemberg 3508f74fb2 Remove connection status state. (#6475)
Current implementation of connection status doesn't follow convention and is not properly configurable. Might be added again in the future as a full fledged entity or some other way.

For now users can rely on error logging to determine connection status.
2017-03-07 23:20:27 +01:00
Marcelo Moreira de Mello 2baa838ba7 Added unittest for Ring sensor (#6447)
Add an optional extended description…
2017-03-06 12:15:08 +01:00
Dennis de Greef 1b23b32817 Use bundled certificates if port matches mqtts (#6429)
* Use bundled certificates if port matches mqtts

* Move import requests.certs to top, since it's used in more places

* Add happy and non-happy path tests for default certificate bundle on mqtts port
2017-03-05 14:08:29 -08:00
Paulus Schoutsen 2650c73a89 Split bootstrap into bs + setup (#6416)
* Split bootstrap into bs + setup

* Lint
2017-03-05 10:41:54 +01:00
Paulus Schoutsen 307514e3a7 Prevent more I/O in apns (#6413) 2017-03-04 19:57:04 -08:00
Paulus Schoutsen b939626497 Fix tests no internet (#6411)
* Fix honeywell tests without internet

* Fix device tracker without internet

* Fix MFI using internet during tests

* Remove I/O from apns tests
2017-03-04 17:15:20 -08:00
Johann Kellerman 1522e67351 Restore for automation entities (#6254)
* Restore for automation entities

* coroutine

* no clue what i'm doing now

* Still passes nicely in py 3.4
2017-03-04 15:19:01 -08: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
Lev Aronsky f396a4593e Add keep-alive feature to the generic thermostat (#6040)
* Add keep-alive feature to the generic thermostat

* Comply with maximum line lengths

* Added tests for the keep-alive functionality
2017-03-04 09:42:43 -08:00
Colin O'Dell 0489ae53c4 Don't initialize components which have already been discovered (#6381)
* Don't initialize components which have already been discovered (fixes #5588)

* Don't log that we've found a service unless we know it's not a duplicate

* Encode discovery data hash with JSON

This also solves the issue of trying to hash non-hashable objects like dicts

* Add test for duplicate device discovery
2017-03-03 13:11:40 -08:00
Pascal Vizeli ed9e93c29f Migrate mqtt tracker and arwn sensor to async / cleanup owntrack (#6373)
* Migrate mqtt tracker and arwn sensor to async / cleanup owntrack

* Fix tests / lint
2017-03-03 12:09:10 +01:00
Pascal Vizeli 3e70154695 OwnTrack Async (#6363)
* Migrate owntrack to async

* fix tests
2017-03-03 09:23:58 +01:00
Johann Kellerman fbd0bf77c7 [recorder] Catch more startup errors #6179 (#6192)
* [recorder] Catch more startup errors #6179

* Rebase on new recorder
2017-03-02 22:44:52 -08:00
Pascal Vizeli 08f9793175 Restore for input_slider (#6360) 2017-03-02 08:36:26 -08:00
Pascal Vizeli 55dc483c91 Template switch change flow / add restore (#6356)
* Template switch change flow / add restore

* fix tests

* fix binary_sensor template
2017-03-02 14:09:53 +01:00
dramamoose edd5db296d Update Formulas in Convert XY to RGB (#6322)
* Update to Current RGB D65 Conversion

As per Philips Hue https://developers.meethue.com/documentation/color-conversions-rgb-xy

* Update the source of the XYZ to RGB formulas

* Fix Whitespace

* Update Whitespace

* Update Tests for new Formulas

* Update Tests

* Update XY_Brightness_to_hsv tests

* Update test_color.py
2017-03-02 08:54:45 +01:00
Pascal Vizeli f3870a8a48 Template binary_sensor change flow / add restore (#6343)
* Template binary_sensor change flow / add restore

* fix lint
2017-03-02 08:50:41 +01:00
Thibault Cohen 31bf5b8ff0 Improve Honeywell US climate component (#5313)
* Improve Honeywell US climate component

* Fix tests

* Fix tests

* Add cool_away_temp and heat_away_temp for honeywell US

* Fix honeywell tests

* Fix PR comments
2017-03-01 23:49:49 -08:00
Pascal Vizeli 6cb8a36cf1 Template sensor change flow / add restore (#6336) 2017-03-02 07:38:19 +02:00
Paulus Schoutsen 0ac4a152be Discovery fix (#6321)
* Fix incorrect import

* Create own discovery service

* Fix tests

* Fix hdmi_cec bad import
2017-03-01 07:38:49 -08: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
Krasimir Zhelev be297c4c7e Frontier silicon (#6131)
* added frontier_silicon constant

* added the frontier_silicon component

* cleaning up according to travis

* trying to satisfy pylint

* trying to satisfy pylint

* fsapi version 0.0.6

* with fsapi version 0.0.7

* added fsapi dependency

* yielding the FSAPI

* Removing white space from docstring

* Removing white space from an empty line

* Switching to sync

* clean up white spaces and rename device to FSAPIDevice

* added frontier_silicon constant

* added the frontier_silicon component

* cleaning up according to travis

* trying to satisfy pylint

* trying to satisfy pylint

* fsapi version 0.0.6

* with fsapi version 0.0.7

* added fsapi dependency

* yielding the FSAPI

* Removing white space from docstring

* Removing white space from an empty line

* Switching to sync

* clean up white spaces and rename device to FSAPIDevice

* changed info to debug

* added frontier_silicon constant

* added the frontier_silicon component

* cleaning up according to travis

* trying to satisfy pylint

* trying to satisfy pylint

* fsapi version 0.0.6

* with fsapi version 0.0.7

* added fsapi dependency

* yielding the FSAPI

* Removing white space from docstring

* Removing white space from an empty line

* Switching to sync

* clean up white spaces and rename device to FSAPIDevice

* added the frontier_silicon component

* trying to satisfy pylint

* fsapi version 0.0.6

* remove white space

* generated requirements

* added the frontier_silicon component

* cleaning up according to travis

* trying to satisfy pylint

* trying to satisfy pylint

* fsapi version 0.0.6

* with fsapi version 0.0.7

* added fsapi dependency

* yielding the FSAPI

* Removing white space from docstring

* Removing white space from an empty line

* Switching to sync

* clean up white spaces and rename device to FSAPIDevice

* trying to satisfy pylint

* changed info to debug

* added the frontier_silicon component

* fsapi version 0.0.6

* generated requirements

* pylint

* moved import requests to the method where it is being used

* add a basic unit test

* cleaned up source code

* added frontier_silicon constant

* added the frontier_silicon component

* added basic test

* added fsapi to requirements_all.txt

* added coverage omit, though a basic test was included

* added MEDIA_TYPE_MUSIC for artist and album

* removed duplicate cons

* switched fsapi call to a property, removed unecessary comment

* detailed docstring for fs_device

* added a space for the info_name - info_text separator

* reduced proeprty (fsapi) access for volume down/up
2017-02-28 09:23:07 -05:00
Adam Mills faf8bbcf13 Fix toggle and media_play_pause post async (#6291) 2017-02-27 19:55:34 -08:00
Boris K d7bf3920a5 improve history_stats accuracy (#6294) 2017-02-27 19:52:10 -08:00
Andrey 7ee75d67c5 Add temperature support for MH-Z19 CO2 sensor. (#6169)
* Add temperature support for MH-Z19 CO2 sensor.

* Remove debug printout

* More tests

* Minor fixes
2017-02-27 21:19:11 +02:00
Jose Juan Montes 65d255a626 Local file camera now supports yet inexisting files. (#6157) 2017-02-26 21:16:11 -08:00
Paulus Schoutsen 61909e873f Feature/reorg recorder (#6237)
* Re-organize recorder

* Fix history

* Fix history stats

* Fix restore state

* Lint

* Fix session reconfigure

* Move imports around

* Do not start recording till HASS started

* Lint

* Fix logbook

* Fix race condition recorder init

* Better reporting on errors
2017-02-26 14:38:06 -08:00
Pascal Vizeli 48cf7a4af9 Move ffmpeg to dispatcher from hass.data entity store. (#6211)
* Move ffmpeg to dispatcher from hass.data entity store.

* fix lint

* address paulus comments

* add more unittest for better coverage
2017-02-26 14:31:46 -08:00
Pierre Ståhl 9490cb4c8f Add service to change log levels (#6221)
* Add service to change log levels

* Fix review comments
2017-02-26 14:15:44 -08:00
Fabian Affolter 9f2719bb1f Update regex (#6216) 2017-02-25 12:55:01 -08:00
Pascal Vizeli 81ca978413 Move mqtt from eventbus to dispatcher / add unsub for dispatcher (#6206)
* Move mqtt from eventbus to dispatcher / add unsub for dispatcher

* Fix lint

* Fix test

* Fix lint v2

* fix dispatcher_send
2017-02-24 17:11:50 -08:00
Paulus Schoutsen d6818c7015 Fix reporting on bad login (#6201) 2017-02-24 16:33:58 -08:00
Paulus Schoutsen 34a7aa2376 Extend test for group config 2017-02-23 21:57:48 -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
Andrey 1d32bced1c Create zwave devices on OZW thread and only add them during discovery (#6096)
* Create zwave devices on OZW thread and only add them during discovery.

* Read and write devices dict from loop thread.

* More async

* replace callback with coroutine

* import common function instead of callin git
2017-02-23 13:06:28 -08:00
Pierre Ståhl eefedaf332 Make it possible to ignore platforms in discovery (#6048)
* Make it possible to ignore platforms in discovery

* Add tests for discovery component

* small cleanups
2017-02-23 11:54:35 +01:00
Johann Kellerman 74837dbf45 Restore for device_tracker (#6150) 2017-02-22 22:55:11 +02:00
Pascal Vizeli b0d3bbed79 Convert mqtt platforms to async (#6145)
* Convert mqtt platforms to async

* fix lint

* add more platforms

* convert mqtt_eventstream

* fix lint / add mqtt_room

* fix lint

* fix test part 1

* fix test part 2

* fix out of memory bug

* address comments
2017-02-22 09:43:22 +01:00
Johann Kellerman aee8758fc1 Restore input_select and test helper proposal (#6148)
* Restore input_select and test helper proposal

* DB still active
2017-02-22 00:15:48 -08:00
Johann Kellerman fdc373f27e Restore_state helper to restore entity states from the DB on startup (#4614)
* Restore states

* feedback

* Remove component move into recorder

* space

* helper

* Address my own comments

* Improve test coverage

* Add test for light restore state
2017-02-20 23:40:27 -08:00
Paulus Schoutsen 32873508b7 Add initial group config (#6135) 2017-02-20 21:53:55 -08:00
Scott Bradshaw 37a8035c54 Added support for alternate SSH ports in AsusWRT (#4832) (#6109)
* Added support for alternate SSH ports in AsusWRT (#4832)

* Always set the SSH port in SSH arguments

* Removed whitespace

* Adding port=22 to the mock calls

* Changed config.get(CONF_PORT)  to config[CONF_PORT] per feedback from @pvizeli
2017-02-20 09:06:50 +01:00
Paulus Schoutsen 25408941de Mqtt fixes (#6116)
* Fix MQTT stop

* MQTT: Make sure to have connection setup at end of MQTT setup.

* Fix MQTT connect
2017-02-19 22:43:10 -08:00
Tom Matheussen 66d8787d47 Weather platform Forecast (#4721)
* Added forecast functionality to the weather platform, updated OWM to get forecast data

* style fixes

* Changed returned forecast data to a more managable dict

* Fixed line length

* forecast will always be collected, data returned from owm is based on metric setting

* use list comprehension to create the forecast data

* Added forecast data to the weather demo

* Create dict directly in list comprehension

* Minor variable change in weather demo platform

* Convert forecast temperatures in weather component

* set forecast attributes as constants

* Style fixes and tests

* Copied forecast_entry instead of mutating data
2017-02-19 16:42:12 -08:00
Adam Mills 5f095b5126 Add supported_features to cover component (#6082) 2017-02-18 18:11:03 -08:00
Pascal Vizeli e1cbd6b4c0 MQTT convert to async (#6064)
* Migrate mqtt to async

* address paulus comment / convert it complet async

* adress paulus comment / remove future

* Automation triggers should be async

* Fix MQTT async calls

* Show that event helpers are callbacks

* Fix tests

* Lint
2017-02-18 14:17:18 -08:00
Walker Boyle ba305ee71c Add aurora sensor (#6003)
* Add aurora sensor

* allow custom forecast threshold for aurora binary sensor

* move AuroraGateway functionality to Aurora data object to conform with HA standards
2017-02-17 09:13:52 +01:00
Andrey 905f4bf994 Support zwave glob & domain device settings. (#6046)
* Support zwave glob & domain device settings.

* data[DATA_DEVICE_CONFIG].get() now always return non-None

* Update test

* Update tests2

* Lint fix
2017-02-16 15:19:22 -08:00
Paulus Schoutsen 75e41a21c9 Clean up mock_coro (#6037) 2017-02-15 23:19:34 -08:00
Johan Bloemberg 2d33ee6258 Reconnect robustness, expose connection state. (#5869)
* Reconnect robustness, expose connection state.

- Expose connection status as rflink.connection_status state.
- Handle alternative timeout scenario.
- Explicitly set a timeout for connections.
- Error when trying to send commands if disconnected.
- Do not block component setup on gateway connection.

* Don't use coroutine where none is needed.

* Test disconnected behaviour.

* Use proper conventions for task creation.

* Possibly fix test race condition?

* Update hass import style
2017-02-15 16:10:19 +01:00
Paulus Schoutsen 409b74b780 Update hassbian component with real output (#5989) 2017-02-14 09:34:17 -08:00
Paulus Schoutsen 36c196f9e8 Add initial Z-Wave config panel (#5937)
* Add Z-Wave config panel

* Add config to Z-Wave dependencies

* Lint

* lint

* Add tests

* Remove temp workaround

* Lint

* Fix tests

* Address comments

* Fix tests under Py34
2017-02-13 21:34:36 -08:00
Paulus Schoutsen b2d1774293 Fix Z-Wave (#5955) 2017-02-13 08:54:11 -08:00
Paulus Schoutsen 8ca3ca8564 Z-Wave: Rename customize to device_config [Breaking change] (#5933)
* Z-Wave: Rename customize to device_config

* Fix light

* Make entity id not required
2017-02-12 23:55:27 -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 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
Jose Juan Montes 2103bfc824 Fixed proximity zone incorrectly using name instead of zone setting. (#5862)
* Fixed proximity zone incorrectly using name instead of zone setting.

* Fixed proximity tests to suit change.
2017-02-12 11:03:53 -08:00
Paulus Schoutsen 44311193ef Add config component and hassbian example panel (#5868)
* Add hassbian panel

* Rename to generic config panel

* Allow loading hassbian as test

* Add tests

* Update frontend

* Lint

* Lint
2017-02-11 17:29:05 -08:00
Johann Kellerman abaf9e53c2 Component set add unsing OR (#5880) 2017-02-11 23:27:06 +02:00
Paulus Schoutsen 5ad934907a Revert "Stop using entity_picture that is known to be bad." (#5882) 2017-02-11 13:10:28 -08:00
Andrey b981bfba7e Stop using entity_picture that is known to be bad. (#5856)
* Stop using entity_picture that is known to be bad.

* Only abandon image on 400 or 404 response

* Return is_permanent_failure as a third part of response

* Add debug printout

* Fix lint

* Fix lint
2017-02-11 20:33:41 +02:00
Adam Mills e877d572f5 binary_sensor sensor_class to entity device_class (#5860)
* binary_sensor sensor_class to entity device_class

* Linter fixes

* Should be it
2017-02-10 20:46:15 -08:00
Boris K 5ecef6aaac Add history_stats sensor (#5610)
* Add new sensor/history_stats component

* Add real unit tests

* Code style changes requested for pull request

* Remove time aliases & allow datetime values

* Reformat unit tests

* Remove all async behavior in history_stats

* Change duration format
2017-02-09 18:47:12 -08:00
Adam Mills be08bf0ef7 [recorder] Add tests for full schema migration (#5831)
* [recorder] Add tests for full schema migration

* Remove leftover code

* Fix duplicate creation of sqlalchemy Index object

* It's that kind of day...

* Improve models_original docstring
2017-02-09 18:17:17 -08:00
Paulus Schoutsen c54517de90 Convert config.components to a set (#5824) 2017-02-09 20:21:57 +02:00
Pascal Vizeli 881d53339b [Image_Processing][Breaking Change] Cleanup Base face class add support for microsoft face detect (#5802)
* [Image_Processing] Cleanup Base face class add support for microsoft face detect

* fix lint

* add unittest for micosoft detect

* fix test
2017-02-08 09:19:40 -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 490ef6afad WIP: [component/recorder] Refactoring & better handling of SQLAlchemy Sessions (#5607)
* Refactor recorder and Sessions

* Cover #4352

* NO_reset_on_return

* contextmanager

* coverage
2017-02-07 21:47:41 -08:00
Adam Mills ecfe8e0a9a Formalize supported_features as entity property (#5794)
* Formalize supported_features as entity property

* Remove extra emulated_hue conditions

* Generate log message in executor
2017-02-07 20:42:45 -08:00
Martin Hjelmare 45a7c27280 Add mysensors device tracker and platform discovery (#5781)
* Add mysensors device_tracker platform

* Add discovery of device_tracker platforms

* Enable discovery of device_tracker platforms that are not
  DeviceScanner.
* Update signature of setup_scanner function in all affected platforms.
* Add test.
* Use discovery for mysensors device_tracker platform.

* Remove gps accuracy

* Small change to core like schema

* fix depency
2017-02-07 20:47:11 +01:00
Fabian Affolter c7fd28c10f MQTT discovery (#5724)
* Change implementation

* Re-write

* Remove unused consts

* Update discovery.py

* Add tests

* fix other tests

* Fix check_config script test

* Lint

* Lint
2017-02-07 09:13:24 -08:00
Robbie Trencheny 45507cd9d1 TTS ID3 support (#5773)
* Add support for writing ID3 tags to the file for improved display in media players

* Lint and async fixes

* Use mutagen instead of taglib

* Fix tests

* Add fallback for album

* Requested changes

* move import

* Fix album name

* Change default options handling

* Move to member function / minor fix

* fix style

* fix lint

* change mutagen handling

* fix lint / add name to bytesio

* Update __init__.py

* Fix test, some cleanups

* Add mutagen exeption handling, fix tests

* fix mutagen taging
2017-02-07 12:07:11 +01:00
Trevor 063c0e8f44 Add icon_template to template sensor (#5766)
* Add icon_template to template sensor

* Update test_template.py

* Update test_template.py again

* Update template.py

* Update test_template.py

* Update test_template.py
2017-02-07 01:51:44 -08:00
Pascal Vizeli 48161697f8 Sonos fix favorite, coordinator, cleanup update (#5778)
* Sonos fix favorite, coordinator, cleanup update

* Bugfix snapshot restore
2017-02-07 00:27:55 -08:00
Fabian Affolter f9ede73a55 Add moon sensor (#5726)
* Add moon sensor

* Update moon.py
2017-02-02 23:43:03 -08:00
Ryan Kraus 537355924f Alert Component (#5201) 2017-02-03 07:20:51 +02:00
Adam Mills 6a64e79d7b [recorder] Index events time_fired to improve logbook performance (#5633)
* Index events time_fired to improve logbook perf.

* Updated implementation to track schema versions

* Added tests for schema migration support logic

* Rename check_schema to migrate_schema
2017-02-02 22:04:14 -05:00
Trevor b5f285a789 Fix OwnTracks state names (#5454)
* Fix OwnTracks state names (#5453)

* Update owntracks.py

* Update tests
2017-02-01 22:06:02 -08:00
Pascal Vizeli eefb603f17 Cleanup media_player universal platform / blocking platform. (#5671)
* Cleanup media_player universal platform / blocking platform.

* fix comments

* fix unittest

* fix lint

* fix unittest lint

* fix coro

* fix test

* fix tests part 2
2017-02-01 21:45:19 -08:00
Johan Bloemberg ae1f59970d Prevent infinite loop in crossconfigured mqtt event streams (#5624)
* Prevent events about MQTT messages received to cause infinite loop when two HA instances are crossconfigured for mqtt_eventstream.

* Fix linting

* Publish all MQTT received events except incoming from eventstream. Also make it configurable.
2017-02-01 21:00:05 -08:00
Pascal Vizeli 32f8622bba Bugfix sonos group coordinator (#5691)
* Bugfix sonos group coordinator

* Fix tests
2017-02-01 16:53:02 +01:00
Johan Bloemberg bbda2a72f4 Rflink 433Mhz gateway platform and components (#4547)
* Initial sketches of rflink component.

* Add requirement.

* Properly load configuration.

* Bump rflink for graceful parse errors and protocol callback.

* Cleanup, documentation and linting.

* More documentation, first sensor implementation (temp & hum).

* Add brightness/dim support for newkaku protocol.

* Use separate class for dimmables.

* Make sure non-dimmable newkaku devices are turned on.

* Move some code around, add switches. Support loading from config.

* Fix bug in ignoring devices.

* Fix initial state assumption.

* Improve reliability on invalid conditions.

* Allow configuration of group for new devices.

* Sensor icons.

* Fix parsing negative numbers.

* Correct icon.

* Allow sending commands serial.

* Pluralize.

* Allow adding sensors from config.

* Fix ignoring devices and bugs in previous commit.

* Share know devices so devices from configuration don't get added as lights.

* Lookup unit from value_key.

* Remove debug.

* Start implementing event protocol in place of packet protocol.

- Added first test suite for sensors.
- This currently breaks light and switch.

* Refactor switch component to fit new rflink changes. Add test suite.

* Fix style.

* Refactor and test lights. Bring coverage to 100%.

* Use non-broken and production tested rflink module.

* Update requirements.

* Bump for logging.

* Improve readability.

* Do not use global variable but keep known device state in intended place.

* Improve docs.

* Make icon support generic.

* Disable overriding icons in config, as it belongs in customization. Only keep custom icon for entities that are able to detect a icon based on the thing they represent (sensors in this case).

* Implement configuration schema, overall refactor of magic values.

* Fix bug in config/test wait_for_ack.

* Small refactors.

* Move command logic into separate class.

* Convert command sending logic to class based pattern instead of using the event bus.

* Start not using bus for rflink event propagation to platforms.

* Do not use event bus for all entity types.

* Fire an event on the bus for every switch incoming rflink command.

* Resolve lint errors, remove some old code.

* Known devices no longer need to be registered separately.

* Log bus events.

* Event callback is a..... callback.

* Use full entity id for events.

* Move event sending to entity.

* Log incoming events.

* Make firing events optional inline with rfxtrx.

* Add foundation for signal repetition.

* Add signal repetition config and tests.

* Make plain switchable type explicitly configurable.

* Enable default entity settings for automatically added entities as well.

* Prevent default configuration leaking accross entities.

* Make sure device defaults don't get overwritten by defaults further down.

* Don't let fast state switching and repetitions turn your house into a disco.

* Make repetitions more responsive.

* Disable on/off fallback on dimmables as it currently doesn't play nice with repetitions.

* Use rflink that allows send_command_ack to be safely cancelled.

* Reduce duplication and make repeat work for non-ack.

* Implement reconnection logic.

* Improve reconnection logic.

* Also cancel repetitions when entity state is changed due to external command.

* Update requirements.

* Fix linting.

* Fix spelling.

* Don't lie.

* Fix lint.

* Support for automatically creating protocol translation (fixes spaces in device names).

* Returned support for dimmable and on/off entity.

* Duplicate code to fix linting issues with inheritance.

* Allow overriding unit of measurement from config.
2017-01-31 08:11:52 -08:00
Adrián López 14f8bc26d1 Voice command API.AI. First import (#5462)
* Voice command API.AI. First import

* Fixes suggested by hound

* Fixing comments

* Fix pylint and pydocstyle errors

* Change how speech is defined

Also clean some unused constants, remove card type (not used), define
a message when action is not defined and improve the message when
action is unknown.

* Change how speech is defined

Clean some constants.
Improve error messages.
Delete card type, not used.

* Tests for new Api.ai component

* Use async_add_job to python compatibility. New test to measure response time

* Add async_action option to choose between waiting or not for the action to execute

* Travis-ci needs more time

* Removed timeout tests

* Removed timeout tests

* Added apiai to .coveragerc as specified by PR doc
2017-01-31 07:54:54 -08:00
Pascal Vizeli 88d9d787a6 Add unittests for FFmpeg and spliting binary sensor (#5659)
* Spliting ffmpeg binary sensor and move service to component.

* unittests for component

* add unittest for binary_sensor

* exclude camera for tests
2017-01-31 07:48:03 -08:00
Daniel Høyer Iversen 3a1607500e Add set_options_service for input select (#5630) 2017-01-30 09:17:57 -08:00
Fabian Affolter 87764a51ba Use device_state_attributes() for platforms (#5649)
* Use device_state_attributes() for platforms

* Update test

* Fix lint issue
2017-01-30 16:16:49 +01:00
Pascal Vizeli 261ffbbfea Move part of image_processing tests (#5634)
* Move part of image_processing tests

* fix lint
2017-01-29 14:40:37 -08:00
andrey-git 1fb372ffdb Apply new customize format to Zwave (#5603) 2017-01-28 22:29:51 +02:00
Duoxilian b732174def Hold mode (#5586)
* Initial commit of hold_mode feature.

* Added deprecation warning for climate.away_mode

* Add tests to demo environment.
2017-01-27 08:57:18 -08:00
Pascal Vizeli 1d4e967106 sonos set coordinator after join/unjoin (#5584)
* sonos set coordinator after join/unjoin

* fix unittest
2017-01-27 15:37:16 +01:00
Pascal Vizeli 4831f57834 Bugfix sonos / refactor of sonos function for TTS (#5571)
* Bugfix sonos / refactor of sonos function for TTS

* fix unittest

* update service yaml

* restore group of a coordinator

* use group function to evaluate

* fix state flooting

* fix comments
2017-01-26 22:50:36 -08:00
nordlead2005 837994196e Added forecast support to DarkSky (#5264)
* Added forecast support to DarkSky

	modified:   homeassistant/components/sensor/darksky.py
	modified:   tests/components/sensor/test_darksky.py

* Fix async_volume_up / async_volume_down (#5249)

async_volume_up / async_volume_down should be async versions of
volume_up / volume_down, not a async version of the default variants of
volume_up / volume_down.

The previous code always called into the mediaplayers set_volume_level,
and never into volume_up / volume_down.

Signed-off-by: Anton Lundin <glance@acc.umu.se>

* adding a default icon "blind" to a PowerView blinds scene. (#5210)

* adding a default icon "blind" to a PowerView blinds scene.

* Adding icon property to define blind icon. Removed it from the state attributes dict.

* fixing lint error

* Added forecast support to DarkSky

	modified:   homeassistant/components/sensor/darksky.py
	modified:   tests/components/sensor/test_darksky.py

* Use SHA hash to make token harder to guess (#5258)

* Use SHA hash to make token harder to guess

Use hashlib SHA256 to encode object id instead of using it directly.

* Cache access token

Instead of generating a token on the fly cache it in the constructor.

* Fix lint

* Bugfix async device_tracker see callback (#5259)

* Add support for NAD receivers (#5191)

* Add support for NAD receivers

* remove self.update() in various methods

* remove setting attributes in various methods

* Change import to hass style

* Updated Config Validation, extended daily forecast to all supported types

* Fix style errors from previous commit, fix test since adding daily for all supported types

* Removed temperature from daily as it isn't supported

* Added forecast support to DarkSky

	modified:   homeassistant/components/sensor/darksky.py
	modified:   tests/components/sensor/test_darksky.py

* Updated Config Validation, extended daily forecast to all supported types

* Fix style errors from previous commit, fix test since adding daily for all supported types

* Removed temperature from daily as it isn't supported

* Revert "Bugfix camera streams (#5306)"

This reverts commit 4b43537801.

Revert "Version bump for kodi dependency (#5307)"

This reverts commit 6abad6b76e.

Revert "Add HMWIOSwitch to sensor, binary (#5304)"

This reverts commit 2c3f55acc4.

Revert "Remove GTFS default name & string change"

This reverts commit 6000c59bb5.

Revert "Update pyhomematic 1.19 & small cleanups (#5299)"

This reverts commit a30711f1a0.

Revert "[sensor] Add Dublin bus RTPI sensor (#5257)"

This reverts commit 1219ca3c3b.

Revert "Bugfix group reload (#5292)"

This reverts commit baa8e53e66.

Revert "Support for TrackR device trackers (#5010)"

This reverts commit f7a1d63d52.

Revert "Bump pywemo version."

This reverts commit dc937cc8cf.

Revert "Upgrade to voluptuous to 0.9.3 (#5288)"

This reverts commit d12decc471.

Revert "Upgrade distro to 1.0.2 (#5291)"

This reverts commit 64800fd48c.

Revert "Don't build Adafruit_BBIO - doesn't work on all platforms. (#5281)"

This reverts commit 9a3c0c8cd3.

Revert "Convert flic to synchronous platform. (#5276)"

This reverts commit eb9b95c292.

Revert "Upgrade to aiohttp 1.2 (#4964)"

This reverts commit e68e29e03e.

Revert "Fix TCP sensor to correctly use value_template (#5211)"

This reverts commit 1cf9ae5a01.

Revert "Cleanup language support on TTS (#5255)"

This reverts commit 3f3a3bcc8a.

Revert "Add last triggered to script (#5261)"

This reverts commit 467cb18625.

Revert "Bump flux_led version and make use of PyPi package (#5267)"

This reverts commit 34a9fb01ac.

Revert "Add support for NAD receivers (#5191)"

This reverts commit 3b59e169f1.

Revert "Bugfix async device_tracker see callback (#5259)"

This reverts commit 71fddd26eb.

Revert "Use SHA hash to make token harder to guess (#5258)"

This reverts commit 922308bc1f.

* Revert "Revert "Bugfix camera streams (#5306)""

This reverts commit 2ee8c44021.

* Update darksky.py
2017-01-26 22:32:45 -08:00
Daniel Høyer Iversen a465a45588 Fix for assumed state in command_line (#5578)
* Bug fix for assumed state in command_line

* command line

* command line

* command line

* command line test
2017-01-26 21:41:30 -08:00
Nick Touran 43e46154c6 Added new Washington State DOT sensor. (#5496)
* Added new Washington State DOT sensor.

* Minor changes from review for WSDOT.

* Update wsdot.py
2017-01-24 22:08:19 -08:00
Pascal Vizeli b57f5728c5 [image_processing/microsoft_face_identify] face recognition for automation (#5472)
* [image_processing/microsoft_face_verify] face recognition for automation

* Add platform for microsoft face identify

* add unittest for demo

* Add unittest for platform
2017-01-24 21:50:10 -08:00
Robbie Trencheny 794852f76f Merge pull request #5497 from armills/test-port-fixes
Fix network tests to use get_test_instance_port
2017-01-24 21:10:00 -08:00
Adam Mills f54f68903d Fixes for rest tests (#5495)
* Fixes for rest tests

* Linter fixes

* Alternate test_setup_missing_config implementation
2017-01-23 10:17:29 -05:00
Adam Mills df361dc1e1
Fix network tests to use get_test_instance_port 2017-01-21 22:15:05 -05:00
Lupin Demid ccd2588cf7 added speed and emotion to Yandex tts (#5431)
* Added speed and emotion  parameters. Refactored test's

* Fixed float point arfs in url and added test for float point values
2017-01-21 08:36:28 +01:00
Pascal Vizeli 2fff8a5a11 [TTS] options support for service calls (#5436)
* [TTS] Support now options like voice and age on service.

* Add unittest
2017-01-21 08:35:18 +01:00
Robbie Trencheny 074f9315d7 Fan improvements (#5457)
* Remove SPEED_MED from fan

* Correctly use the oscillation on/off payloads for MQTT fan

* Add set_direction service documentation

* Correct function name for Wink fans

* Check for existence of the correct topic

* Enable set fan speed in emulated_hue

* features -> functions

* Final emulated_hue fan fixes

* Fix linting issues

* Revert to supported features instead of supported functions

* Fix logic

* Add a test for emulated_hue fan support
2017-01-20 22:21:28 -08:00
Adam Mills 1f6f9a1677 Filter new entities from logbook (#5402) 2017-01-19 23:30:47 -08:00
Paulus Schoutsen 887a33c7d1 Persist emulated hue IDs (#5435) 2017-01-19 21:27:10 -08:00
Touliloup 909978b0d1 [Device Tracker] Xiaomi Mi Router token refresh (#5437)
Device token is refreshed if not anymore valid (for example after router reboot).
Token refresh will only be tried once per update.
2017-01-19 15:05:37 +01:00
Adam Mills 216ac14b3d Fix test for async media player volume helpers (#5432) 2017-01-18 19:15:51 -08:00
Adam Mills eb06023aa5 Fix universal mp service call wth no child (#5411) 2017-01-17 22:15:37 -08:00
Pascal Vizeli 2a362fd1ff Asyncio notify component migration (#5377)
* Async migrate notify/platform

* convert group to async

* fix unittest
2017-01-17 22:08:03 -08:00
Paulus Schoutsen f7ac644c11 Make SMTP tests fast 2017-01-17 22:00:23 -08:00
Pascal Vizeli cfc936761b Make upc more robust (#5404)
* Make upc more robust

* update unittest

* add test for parse error
2017-01-17 23:35:02 +01:00
Johan Bloemberg 915a91dc1b DSMR: TCP, reconnecting and V4 CRC support (#5164)
* Add support for TCP connection.

* Implement reconnect logic.

* Actually register connect loop task and fix error handling.

* Fix lint, configure upstream requirement.

* Revert debug logging.

* Explicitly catch connection errors.

* Test reconnect on setup and reconnect after disconnect.

* Style.
2017-01-16 23:56:00 -08:00
Lupin Demid 85a84549eb Yandex tts component (#5342)
* Added Yandex SpeechKit TTS

* Added test stub

* Added two test and added property for yandex tts

* Copy all test from voice rss

* Added test vith different speaker and  code style changes

* Added new line to end of file

* Url format replaced with url_params
2017-01-15 15:43:10 +01:00
Adam Mills e7c157e766 Tests for async volume up/down (#5265) 2017-01-15 08:27:56 +01:00
Martin Hjelmare 9db1aa7629 Add discovery notify support and mysensors notify (#5219)
* Add mysensors notify platform

* Make add_devices optional in platform callback function.
* Use new argument structure for all existing mysensors platforms.
* Add notify platform.
* Update mysensors gateway.

* Refactor notify setup

* Enable discovery of notify platforms.
* Update and add tests for notify component and some platforms.
* Continue setup of notify platforms if a platform fails setup.
* Remove notify tests that check platform config. These tests are not
  needed when config validation is used.
* Add config validation to APNS notify platform.
* Use discovery to set up mysensors notify platform.

* Add discovery_info to get_service and update tests

* Add discovery_info as keyword argument to the get_service function
  signature and update all notify platforms.
* Update existing notify tests to check config validation using test
  helper.
* Add removed tests back in that checked config in apns, command_line
  and file platforms, but use config validation test helper to verify
  config.
* Add a test for notify file to increase coverage.
* Fix some PEP issues.

* Fix comments and use more constants

* Move apns notify service under notify domain
2017-01-15 03:53:14 +01:00
Thibault Cohen 3b9fb6ccf5 Improve InfluxDB (#5238)
* Revert #4791 and fixes #4696

* Update influxDB based on PR comments

* Add migration script

* Update influxdb_migrator based on PR comments

* Add override_measurement option to influxdb_migrator

* Rename value field to state when data is string type

* Fix influxdb cloning query
2017-01-14 09:52:47 -08:00
Pascal Vizeli c2492d1493 Component "Image processing" (#5166)
* Init new component for image processing.

* Add demo platform

* address comments

* add unittest v1 for demo

* Add unittest for alpr

* Add openalpr local test

* Add openalpr cloud platform

* Add unittest openalpr cloud platform

* Update stale docstring

* Address paulus comments

* Update stale docstring

* Add coro to function

* Add coro to cloud
2017-01-14 08:18:03 +01:00
William Scanlon 0da8418f3f Wink fan support (#5174)
* Initial commit for Wink fan support

* Added fan to discovery list

* Raise NotImplementedError and fixed is_on

* Added speed property

* Update __init__.py
2017-01-13 22:08:13 -08:00
Touliloup 394b52b9e8 Xiaomi device tracker (#5283)
* [Device Tracker] Xiaomi Mi Router integration as device tracker

    This device tracker allow to track device connected to Xiaomi Router.
    Parameter: host, username (default admin) and password.

* [Device Tracker] Addition of Xiaomi device tracker file in coverage
2017-01-13 21:24:58 -08:00
Paulus Schoutsen e68e29e03e Upgrade to aiohttp 1.2 (#4964)
* Upgrade to aiohttp 1.2

* Clean up emulated_hue tests
2017-01-11 21:25:02 +01:00
Andrew Williams 1cf9ae5a01 Fix TCP sensor to correctly use value_template (#5211)
* Fix TCP sensor to correctly use value_template

* Fix TCP component tests

* Update tcp.py
2017-01-11 17:26:29 +01:00
Pascal Vizeli 3f3a3bcc8a Cleanup language support on TTS (#5255)
* Cleanup language support on TTS

* change to default_language & address comments

* Cleanup not needed code / comment from paulus
2017-01-11 16:31:16 +01:00
Johann Kellerman 1f31dfe5d3 [recorder] Include & Exclude domain fix & unit tests (#5213)
* Tests & domain fix

* incl/excl combined
2017-01-09 21:53:30 +01:00