Commit Graph

94 Commits (7bdb79bd5492ebd46c1a3f681645946e351b4d10)

Author SHA1 Message Date
Marcelo Moreira de Mello 5e44934e7e Added some extra options to Weather Underground component (#4306)
* Added some extra options to Weather Underground component

* Added Location and Elevation options

* Fixed if statement

* Fixed lint

* Updated tests including  elevation and location

* Update wunderground.py
2016-11-10 23:01:20 -08:00
Johann Kellerman f3595f790a Async version of Yr.no (#4158)
* initial

* feedback

* More feedback. Still need to fix match_url

* url_match

* split_lines
2016-11-02 19:34:12 -07:00
Paulus Schoutsen 7f699b4261 Lazy initialise the worker pool (#4110)
* Lazy initialise the worker pool

* Minimize pool initialization in core tests

* Fix tests on Python 3.4

* Remove passing in thread count to mock HASS

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

* Remove JobPriority for thread pool

* Fix wrong block_till_done

* EmulatedHue: Remove unused test code

* Zigbee: do not touch hass.pool

* Init loop in add_job

* Fix core test

* Fix random sensor test
2016-10-31 08:47:29 -07:00
Fabian Affolter b4899ec469 Allow multiple symbols (sensor.yahoo_finance) (#4126)
* Allow multiple symbols

* Update test
2016-10-31 13:31:09 +01:00
Fabian Affolter 4484a7a94b Use voluptuous for Pilight switch (#3819)
* Migrate to voluptuous

* Add protocol

* Update
2016-10-31 13:18:47 +01:00
Fabian Affolter 274e9799b3 Add random number sensor (#4139) 2016-10-31 00:01:25 -07:00
Jared Beckham 5ce9aea65d Added tests for REST sensors (#4115) 2016-10-30 21:51:03 -07:00
Fabian Affolter be272ac64a Disable too-many-* (#4107)
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Pascal Vizeli d5368f6f78 Async bootstrap / component init (#3991)
* Async bootstrap

* Adress comments

* Fix tests

* More fixes

* Tests fixes
2016-10-27 00:16:23 -07:00
Fabian Affolter 2604dd89a6 Add test (#3999) 2016-10-24 22:01:38 -07:00
Paulus Schoutsen 519d9f2fd0 async HTTP component (#3914)
* Migrate WSGI to asyncio

* Rename wsgi -> http

* Python 3.4 compat

* Move linting to Python 3.4

* lint

* Lint

* Fix Python 3.4 mock_open + binary data

* Surpress logging aiohttp.access

* Spelling

* Sending files is a coroutine

* More callback annotations and naming fixes

* Fix ios
2016-10-23 23:48:01 -07:00
Fabian Affolter fae620f3b3 Migrate to voluptuous (#3748) 2016-10-21 21:14:35 -07:00
Marcelo Moreira de Mello fee01fcccc Added unit test to the Yahoo Finance sensor (#3943) 2016-10-20 20:14:50 +02:00
David-Leon Pohl 947c1efca2 New pilight sensor component (#3822)
* Pilight daemon expects JSON serializable data. Thus dict is needed and not a mapping proxy.
* Add explanation why dict as message data is needed
* Use pytest-caplog and no unittest.TestCase
2016-10-18 23:16:20 +02:00
Rob Capellini 4891ca1610 Removing calls to mock.assert_called_once_with (#3896)
If a mock's assert_called_once_with method is misspelled (e.g. asert_called_once_with) then the test will appear as passing.  Therefore, this commit removes all instances of assert_called_once_with calls and replaces them with two assertions:

        self.assertEqual(mock.call_count, 1)
        self.assertEqual(mock.call_args, mock.call(call_args))
2016-10-16 16:13:27 -07:00
Fabian Affolter 9743e17d62 Minimum/maximum/mean sensor (#3852)
* Add min/max sensor

* Update min_max.py
2016-10-14 21:43:46 -07:00
Marcelo Moreira de Mello 6fcb1b548e Added the ability to Weather Underground to track severe weather alerts (#3505)
*  Added the ability to Weather Underground to track severe weather alerts

*   * Added message on the advisory attr

  * Updated tests

* * Making use of guard clause

* Checking multiple_alerts prior loop

* Using a better way to create dict

* Fixed issue to set to None only the object that failed

* Added unittest

* Split update() method to different calls with their one throttle control to minimize API calls

* Updated unittest and make sure the alert sensor will not return 'unknown' status'

* Removed update() method from state property

* Branch rebased and include Weather Underground attribution

* Update wunderground.py
2016-10-14 21:35:27 -07:00
Johann Kellerman 7b40a641ec Continue on invalid platforms and new setup_component unit tests (#3736) 2016-10-08 11:27:35 -07:00
Fabian Affolter a94571fd10 Change name of Forecast.io platform to Dark Sky (#3698)
* Rename Forecast.io platform to Dark Sky

* Upgrade to python-forecastio to 1.3.5

* Update to reflect name change (Forecast.io -> Dark Sky)

* Rename forecast to darksky
2016-10-05 21:42:58 +02:00
Fabian Affolter 74b0e4cb45 Statistics sensor (#3513)
* Initial stats sensor

* Add total and tests

* Use deque, rename var, set default, and only update sensor
2016-10-04 01:04:00 -07:00
Klaas Hoekema 9da2d6edd0 Make forecast.io update interval configurable (#3520)
Adds a config parameter (`update_interval`) to the `forecast` sensor to
set the minimum update interval. The default remains 120 seconds.
2016-10-01 21:18:10 -07:00
Paulus Schoutsen 3e24a35c1e Skip RFXtrx tests unless RFXTRX=RUN (#3625)
* Skip RFXtrx tests unless RFXTRX=RUN

* Remove my previous hacks to slightly speed up rfxtrx

* Exclude RFXTRX tests from coverage

* Remove unused import in rfxtrx tstt

* Add close connection back to RFXtrx tests

* Typo
2016-10-01 13:57:10 -07:00
Paulus Schoutsen 4b8bc90d16 Limit worker pool to 10 threads (#3560)
* Limit worker pool to 10 threads

* Comment evdev in requirements

* Allow skipping RFXtrx tests locally

* Fix worker pool size tests

* lol whut
2016-09-28 00:05:38 -07:00
Paulus Schoutsen 00e298206e Optimize template 2 (#3521)
* Enforce compiling templates

* Refactor templates

* Add template validator to Logbook service

* Some more fixes

* Lint

* Allow easy skipping of rfxtrx tests

* Fix template bug in AND & OR conditions

* add entities extractor

Conflicts:
	tests/helpers/test_template.py

* fix unittest

* Convert template to be async

* Fix Farcy

* Lint fix

* Limit template updates to related entities

* Make template automation async
2016-09-27 21:29:55 -07:00
Pascal Vizeli bbfd86dec3 Use setup_component in tests v1 (#3507)
* update unittests like #3414

* setup_component - splunk

* setup_component - statsd

* fix statsd & splunk unittest config values

* component_setup - device_sun_light_trigger

* setup_component - introduction

* component_setup - persistent_notification

* setup_component - logentries, mqtt eventstream

* fix unittest logentries
2016-09-25 23:15:21 +02:00
Fabian Affolter 2ecbcac2b1 Fix PEP257 issues (#3491)
* Align test name with platform

* Fix PEP257 issues
2016-09-23 10:28:28 +02:00
Fabian Affolter 3d31d26b6c Fix typos (#3490) 2016-09-23 10:28:16 +02:00
sam-io de5bd26050 Email (#3421)
* Added email component

* added email sensor component

* added doc string to test class

* fixed lint error

* fixed lint error

* rename of email component

* added another block as test fails on CI

* added retry to multi email test

* added delay to retry

* added to .coveragerc

* removed sleep from tests and fixed up stale comments
2016-09-20 00:09:14 -07:00
Paulus Schoutsen 4076ccf639 Use setup_component in tests (#3414)
* Alarm Control Panel Manual - use setup_component

* Update automation - zone tests

* Update climate - demo tests

* Update climate - generic thermostat tests

* Update cover - command line tests

* Update cover - demo tests

* Update device tracker tests

* Update device tracker - owntracks tests

* Update fan - demo tests

* Update garage door - demo tests

* Update light tests

* Update lock - demo tests

* Update media player - demo tests

* Update notify - command line tests

* Update notify - demo tests

* Update notify - file tests

* Update notify - group tests

* Update sensor - mfi tests

* Update sensor - moldindicator tests

* Update sensor - mqtt room tests

* Update switch - command line

* Update switch - flux

* Update switch tests

* Update scene tests

* Fix wrong default port for mfi switch
2016-09-17 10:29:58 -07:00
Pascal Vizeli 1697a8c774 SleepIQ component with sensor and binary sensor platforms (#3390)
Original from #2949
2016-09-14 00:11:50 +02:00
Paulus Schoutsen 609d7ebea5 Migrate core from threads to async awesomeness (#3248)
* Add event loop to the core

* Add block_till_done to HA core object

* Fix some tests

* Linting core

* Fix statemachine tests

* Core test fixes

* fix block_till_done to wait for loop and queue to empty

* fix test_core for passing, and correct start/stop/block_till_done

* Fix remote tests

* Fix tests: block_till_done

* Fix linting

* Fix more tests

* Fix final linting

* Fix remote test

* remove unnecessary import

* reduce sleep to avoid slowing down the tests excessively

* fix remaining tests to wait for non-threadsafe operations

* Add async_ doc strings for event loop / coroutine info

* Fix command line test to block for the right timeout

* Fix py3.4.2 loop var access

* Fix SERVICE_CALL_LIMIT being in effect for other tests

* Fix lint errors

* Fix lint error with proper placement

* Fix slave start to not start a timer

* Add asyncio compatible listeners.

* Increase min Python version to 3.4.2

* Move async backports to util

* Add backported async tests

* Fix linting

* Simplify Python version check

* Fix lint

* Remove unneeded try/except and queue listener appproriately.

* Fix tuple vs. list unorderable error on version compare.

* Fix version tests
2016-09-12 19:16:14 -07:00
Dan Smith f55095df83 Fix mFi sensors in uninitialized state (#3246)
If mFi sensors are identified but not fully assigned they can
have no tag value, and mficlient throws a ValueError to signal this.
This patch handles that case by considering such devices to always
be STATE_OFF.
2016-09-06 18:04:20 -07:00
Fabian Affolter 3c615e2319 Use voluptuous for mFi switch (#3168)
* Migrate to voluptuous

* Take change configuration into account
2016-09-03 20:32:35 -06:00
Fabian Affolter 8467d07a3d Migrate to voluptuous (#3171) 2016-09-03 20:24:29 -06:00
Fabian Affolter 40c71b5d96 Use voluptuous for Command line platforms (#2968)
* Migrate to voluptuous

* Fix pylint issues

* Remove FIXME

* Split setup test

* Test with bootstrap

* Remove lon and lat

* Fix pylint issues
2016-09-02 08:09:09 -06:00
Paulus Schoutsen 21fb18e5aa pep257 fixes 2016-08-23 20:25:52 -07:00
Greg Dowling 32318c6f19 Add voluptuous validation to template sensor. (#2886) 2016-08-22 01:11:16 -07:00
Heiko Rothe 6aa0789e38 MQTT room presence detection (#2913)
* Added room presence tracker

* Fixed room/device discovery bugs

* Added tests for room tracker

* Fixed some formatting mistakes

* Fixed a tiny bug with the track new option

* Converted device tracker into sensor

* Removed leftover service entry

* Changed name to mqtt_room

* Changed payload validation to voluptuous

* Fixed validation

* Removed sleep from tests
2016-08-20 20:49:38 -07:00
Teagan Glenn 297fca9351 Type-o 2016-08-18 16:39:16 -06:00
Teagan Glenn cb3a37691f Type-o 2016-08-18 16:28:19 -06:00
Teagan M. Glenn 2b8e2a3d36 Remove print lines 2016-08-18 10:27:53 -06:00
Teagan M. Glenn 41f84d9e20 Pydoc for unit test methods 2016-08-18 10:27:38 -06:00
Teagan M. Glenn a5fd04f215 Unit tests around wunderground 2016-08-17 22:33:39 -06:00
Daniel 98550b5465 rfxtrx light tests 2016-07-17 11:14:29 +02:00
Daniel c79cd905fe rfxtrx sensor tests 2016-07-17 10:24:08 +02:00
Daniel Høyer Iversen 16feb1c55e Fix issue #2290 for rfxtrx (#2498)
* Fix issue #2290 for rfxtrx

* update tests for rfxtrx sensor

* Replace state_unkown with None in rfxtrx sensor

* Update test_rfxtrx.py
2016-07-13 07:46:11 -07:00
Paulus Schoutsen 6714392e9c Move elevation to core config and clean up HTTP mocking in tests (#2378)
* Stick version numbers

* Move elevation to core config

* Migrate forecast test to requests-mock

* Migrate YR tests to requests-mock

* Add requests_mock to requirements_test.txt

* Move conf code from bootstrap to config

* More config fixes

* Fix some more issues

* Add test for set config and failing auto detect
2016-06-27 09:02:45 -07:00
Paulus Schoutsen 0525af920c Update betamax casettes 2016-06-08 21:06:14 -07:00
Robbie Trencheny c9b5ea97da Fix docstring issues with MoldIndicator 2016-05-21 10:03:24 -07:00
Felix eaebe83429 Moldindicator Sensor (#1575)
* Adds MoldIndicator sensor platform

This sensor may be used to get an indication for possible mold growth in rooms.
It calculates the humidity at a pre-calibrated indoor point (wall, window).

* Automatic conversion to Fahrenheit for mold_indicator

* Minor change to critical temp label

* Fixed docstrings and styles

* Minor changes to MoldIndicator implementation

* Added first (non-working) implementation for mold_indicator test

* Small style changes

* Minor improvements to mold_indicator

* Completed unit test for mold indicator

* Fix to moldindicator initialization

* Adds missing period. Now that really matters..

* Adds test for sensor_changed function
2016-05-21 09:58:59 -07:00