Commit graph

231 commits

Author SHA1 Message Date
David-Leon Pohl
947c1efca2 New pilight sensor component ()
* 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 ()
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 ()
* 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 ()
*  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 () 2016-10-08 11:27:35 -07:00
Fabian Affolter
a94571fd10 Change name of Forecast.io platform to Dark Sky ()
* 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 ()
* 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 ()
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 ()
* 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 ()
* 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 ()
* 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 ()
* update unittests like 

* 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 ()
* Align test name with platform

* Fix PEP257 issues
2016-09-23 10:28:28 +02:00
Fabian Affolter
3d31d26b6c Fix typos () 2016-09-23 10:28:16 +02:00
sam-io
de5bd26050 Email ()
* 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 ()
* 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 ()
Original from 
2016-09-14 00:11:50 +02:00
Paulus Schoutsen
609d7ebea5 Migrate core from threads to async awesomeness ()
* 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 ()
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 ()
* Migrate to voluptuous

* Take change configuration into account
2016-09-03 20:32:35 -06:00
Fabian Affolter
8467d07a3d Migrate to voluptuous () 2016-09-03 20:24:29 -06:00
Fabian Affolter
40c71b5d96 Use voluptuous for Command line platforms ()
* 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. () 2016-08-22 01:11:16 -07:00
Heiko Rothe
6aa0789e38 MQTT room presence detection ()
* 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 for rfxtrx ()
* Fix issue  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 ()
* 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 ()
* 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
Daniel
2ca1f7542f Refactor rfxtrx code 2016-04-24 13:42:59 +02:00
Daniel
55b51cb3fa Update rfxtrx tests to handle new config 2016-04-23 20:13:24 +02:00
Paulus Schoutsen
2e79e9d5bb Correct celcius to celsius () 2016-04-19 20:30:44 -07:00
Daniel Høyer Iversen
769d958464 Config validation for rfxtrx sensor () 2016-04-10 16:05:32 -07:00
Daniel Høyer Iversen
d3493c7e5a Config validation of yr sensor () 2016-04-10 10:43:05 -07:00
Jan Harkes
eb3f812e38 Config validation for MQTT sensor platform. 2016-04-06 22:51:39 -04:00
Paulus Schoutsen
b063fa3165 Merge pull request from balloob/rfxtrx
Fixed bug in rfxtrx sensor
2016-03-31 22:12:04 -07:00
Daniel
c4062bf6ea Fixed bug in rfxtrx sensor 2016-03-30 10:57:26 +02:00
Paulus Schoutsen
41f205e09d Clean up template platforms 2016-03-24 23:22:17 -07:00
Fabian Affolter
9838697d2b Fix PEP257 issues 2016-03-09 10:25:50 +01:00
Paulus Schoutsen
41214fd082 TCP test to work offline 2016-03-05 09:27:22 -08:00
Paulus Schoutsen
d641cd5eef Merge pull request from balloob/rfxtrx_tests
Added tests for rfxtrx sensor
2016-03-01 08:07:21 -08:00
Daniel
6c518c74ec Added tests for rfxtrx sensor 2016-03-01 10:14:02 +01:00