Commit Graph

393 Commits (6d9f1b3fd3ab964ef6815117b1a23237290ead6c)

Author SHA1 Message Date
Paulus Schoutsen e9ea5c2ccb Move tests to right folder (#23790)
* Move tests to right folder

* Fix test leaving files behind
2019-05-10 13:20:50 -07:00
Penny Wood bf4b7a82b4 Move platforms patch (#22168)
* move mold sensor

* Get tests working

* Move moon and season sensor strings.

* Renamed sensor strings.
2019-03-19 06:43:15 -07:00
Penny Wood f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
Paulus Schoutsen f5076188ef
Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00
Paulus Schoutsen f8921f84d7
skip flaky test (#21981) 2019-03-12 14:19:11 -07:00
Willem Burgers 458548daec Fix TypeError (#21734)
* timediff is of type timedelta. Divide by timedelta does not work.

- convert a timedelta to int
- make sure the test inputs real timestamps

* Convert the total_seconds to decimal and round the result

readings are of type Decimal, so fix test to reflect that

* split line into multiple statements

Line too long

* use total_seconds instead of timediff

* Make both values float instead of Decimal
2019-03-09 17:51:15 +01:00
Willem Burgers 2017e45d78 fix derived rate, fixes #20097 (#21620)
* fix derived rate, fixes #20097

* fix derived rate, fixes #20097

* Fix typo

thnx @amelchio

* Make the test more realistic

Took values from my own smart meter for the test

* Update test to ignore rounding issues
2019-03-03 23:42:52 +01:00
Giorgos Logiotatidis 5a5c97acb3 Add timeout option to sensor.rest and binary_sensor.rest. (#20065) 2019-02-26 10:23:46 -08:00
siberx 616c7628d7 Fixes the sensor.filter outlier filter (handle step-changes correctly) (#21332)
* Fix outlier filter median return, Add/update filter outlier tests

* Switch outlier filter to store raw vals (handles step-changes correctly)

* Filter store_raw as attribute instead of filter_state parameter

* Fix linting issues
2019-02-23 13:51:33 +00:00
Rohan Kapoor 481439d387 Deprecate conf_update_interval (#20924)
* Deprecate update_interval and replace with scan_interval

* Update tests

* Fix Darksky tests

* Fix Darksky tests correctly

This reverts commit a73384a223ba8a93c682042d9351cd5a7a399183.

* Provide the default for the non deprecated option

* Don't override default schema for sensors
2019-02-17 06:23:09 +01:00
Diogo Gomes f1f3074612 Add integration method to sensor.integration (#21050)
* add integration method and respective new methods

* ack @ottowinter tip

* align const name with value
2019-02-13 20:26:27 -08:00
arigilder 0d98f9783f Add lagging hdate for sensors that should lag to update (#20655)
* Add lagging hdate for sensors that should lag to update

* Fix indentation

* Lint fix
2019-02-11 23:34:48 +01:00
Paulus Schoutsen f3b20d138e Embed Z-Wave platforms (#20810) 2019-02-07 22:50:59 +01:00
Paulus Schoutsen b8cc547fa3
Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00
Daniel Høyer Iversen ef6b0b8e0b Update flake8 to 3.7.5 (#20761)
* Upgrade flake8

* Upgrade flake8

* Add noqa for hound
2019-02-05 11:12:09 +01:00
emontnemery b1faad0a50 Use PLATFORM_SCHEMA_BASE as base schema for additional components. (#20578)
* Disable extra=vol.ALLOW_EXTRA for additional platforms.

* Remove PLATFORM_SCHEMA_2

* Add entity_namespace to base platform schema
2019-02-04 21:52:19 -08:00
Paulus Schoutsen e2d3c27e85
Embed all platforms into components (#20677)
* Consolidate all components with platforms

* Organize tests

* Fix more tests

* Fix Verisure tests

* one final test fix

* Add change

* Fix coverage
2019-02-02 07:13:16 -08:00
Diogo Gomes ca143f8a35 print() left behind (#20689) 2019-02-02 14:54:46 +01:00
Diogo Gomes 384a9625c9 fix test commented in #20678 (#20680) 2019-02-01 22:11:50 -08:00
Paulus Schoutsen c9671f8205 Test is broken 2019-02-01 16:31:53 -08:00
Jason Hu d7b61f7ff6 Move mqtt_mock to tests/components/mqtt/conftest.py (#20621)
* Move mqtt_mock to tests/components/mqtt/conftest.py

* Move mqtt room presence sensor test to tests/components/mqtt

* Revert "Move mqtt room presence sensor test to tests/components/mqtt"

This reverts commit e08bc143

* Decouple mqtt room presence sensor test and mqtt_mock
2019-01-31 21:22:29 +01:00
Sander Zumbrink e20c2aa113 Add precision parameter to dsmr sensor (#19873)
* Added precision parameter to dsmr sensor

* Added precision parameter to dsmr sensor, added whitespace after comma

* Added precision parameter to dsmr sensor

* Added precision parameter to dsmr sensor, fixed test

* Changed try except as requested
2019-01-31 16:46:54 +01:00
Diogo Gomes b0ff51b0ef Add an Integration sensor (#19703)
* initial version

* Tested

* set state added

* lint

* lint

* remove artifacts

* Use Decimal instead of float

* simplify

* travis lint fix

* addres comments by @ottowinter

* remove job

* better sanity check

* lower error -> warning

* hound

* fix state validation

* refactor energy -> integration

* address @MartinHjelmare comments

* new style string format

* remove async_set_state

* patching the source function
2019-01-29 08:25:36 +01:00
Andrey Kupreychik d4c7515681 Add time_throttle filter to sensor.filter (#20334)
* Added time_throttle filter

* Added time_throttle filter test

* Updated comments for time_throttle filter
2019-01-25 10:07:45 +00:00
Daniel Høyer Iversen 1bd31e3459 Change STATE_UNKOWN to None (#20337)
* Change STATE_UNKOWN to None

* Change STATE_UNKOWN to None

* tests

* tests

* tests

* tests

* tests

* style

* fix comments

* fix comments

* update fan test
2019-01-24 08:20:20 +01:00
Nikolay Vasilchuk 075b575bde Support device_class for rest sensor (#20132)
* Ready

* Tests fixed
2019-01-16 10:03:53 -08:00
Robert Svensson a3f0d55737
Change deCONZ to embedded platforms (#20113)
Move all platforms into components/deconz
2019-01-15 19:29:56 +01:00
emontnemery 5b53bd6aa0
Move MQTT platforms under the component (#20050)
* Move MQTT platforms under the component
2019-01-15 17:31:06 +01:00
Paulus Schoutsen 6cba51fd0e Lint 2019-01-11 16:31:16 -08:00
Paulus Schoutsen 578bfe9798 Fix fail2ban tests 2019-01-11 15:01:24 -08:00
Fredrik Erlandsson b9a488912a Add support for 'via_hub' for device_info (#19454)
* Add support for 'via_hub'

* Update config schema

* add domain to via_hub

* add tests for via_hub
2019-01-11 13:11:13 -08:00
Antoine GRÉA 14dd8791ec Adding IPv6 to fail2ban sensor (#19457)
* Fixing fail2ban regex for ipv6

* Adding IPv6 tests for fail2ban

* Formating code for hound

* Formating again

* Formating again 2
2019-01-11 12:54:47 -08:00
Paulus Schoutsen d812f23f6b
min_max sensor support for STATE_UNAVAILABLE (#19914) 2019-01-11 09:27:48 -08:00
arigilder 4d187e08d4 Add sensors to jewish_calendar for upcoming Shabbat times (#19278)
* Initial pass of cleanup for shabbat_times

* Switch to async defs

* First pass of unit tests + fixture data

* Completion of first round of unit tests, 100% passing

* Unit tests for state restoring

* Style fixes

* More style fixes

* Lint fix

* Add upcoming candelighting and havdalah sensors

* Add unit tests, remove havdalah offset

* More unit tests + small bugfix for weekly_portion

* Add issur melacha sensor

* Remove old shabbat_times work-in-progress files

* Bump required version of hdate

* Add havdalah offset config parameter

* Bump hdate version required

* Pin hdate requirement

* Lint fixes

* Changes based on review + API changes for hdate 0.8.7

* Add three-day holiday unit tests

* Remove debugging line

* Add missing docstring

* Fix doc lint comment
2019-01-10 16:27:34 -08:00
Jérôme Wiedemann e6a2c18430 min_max sensor support for STATE_UNAVAILABLE 2019-01-10 13:48:24 +01:00
emontnemery 0b57cfb004 Cleanup if discovered mqtt sensor can't be added 2019-01-07 17:03:10 +01:00
Andrew Hayworth 87a0118082 Do not choke on no awair data (#19708)
* awair: do not choke on no data

The awair API returns an empty response for various air data queries
when a device is offline. The underlying library (python_awair) does
not directly inform us that a device is offline, since we really can
only infer it from an empty response - there is no online/offline
indicator in the graphql API.

So - we should just ensure that we do not attempt to update device state
from an empty response. This ensures that the platform does not crash
when starting up with offline devices, and also ensures that the
platform is marked unavailable once devices go offline.

* Fix typo

Further proof that coding after 10pm is rolling the dice.
2019-01-03 14:41:18 +01:00
javicalle b9f4a7220e Improve rflink coverage (#19596)
* some minor tests refactor
* async/await refactor
* toggle have not brightness
* test for race condition in unknown device
* test for 'no_command' and 'not_connected'
* test for race condition in unknown device
* sensor events are handled in sensor devices, RflinkDevice handle
command events
* test race conditions & bogus entity remove
* two more tests
* Test race condition for unknown components
* Test cleanup for `commands events` and `sensor events`
2019-01-01 15:35:31 +01:00
Robin ff80fc347b Fix london_underground issue (#19642)
* Update london_underground.py

* Update test

* Update london_underground.py

* Update london_underground.py

* Update london_underground.py

* Fix lint

* Use london-tube-status==0.2
2018-12-31 06:24:52 -08:00
Antoine GRÉA 1099018a5e Fix fail2ban by removal of internal timer logic (#19456)
* Remove timer logic from sensor class

Proposed fix for issue #10500

* Updating the tests to remove timer logic

* Removing unecessary dependancy

* Fixing requested changes

* Commit to try to fix the CLA ?
2018-12-22 18:25:02 +01:00
javicalle fb226e3e3b Clean up RFLink tests and add two tests (#19511)
* some minor tests refactor

* unused import
2018-12-22 08:53:02 +01:00
uchagani 71900ca719 Add new sensor platform to expose Islamic prayer times (#19444)
* added new sensor platform to expose Islamic prayer times

* added new sensor platform to expose Islamic prayer times

* updated tests according to feedback

* make prayer_times_info a public attribute

* remove stale comments
2018-12-20 22:52:43 +01:00
emontnemery 1568de62df Correct calls to subscription.async_unsubscribe_topics (#19414)
* Correct calls to subscription.async_unsubscribe_topics

* Review comments

* Add testcases
2018-12-19 14:05:24 +01:00
Pascal Vizeli 2bf36bb1db
Use unicode slugify (#19192)
* Update __init__.py

* Update setup.py

* Update requirements_all.txt

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* remove `-`

* fix packages

* Update package_constraints.txt

* Update __init__.py

* Update package_constraints.txt

* Update requirements_all.txt

* Update setup.py

* Fix tests

* Fix line issue

* fix all test

* fix type

* Fix lint
2018-12-17 07:51:13 +01:00
Malte Franken 629dd24ff3 bump georss_client to 0.5 (#19337) 2018-12-16 11:14:36 +01:00
Erik 0e868deedd Add JSON attribute topic to MQTT sensor 2018-12-12 16:26:44 +01:00
Heine Furubotten 4bee3f760f Add Entur departure information sensor (#17286)
* Added Entur departure information sensor.

* Fixed houndci-bot comments.

* Removed tailing whitespace.

* Fixed some comments from tox lint.

* Improved docstring, i think.

* Fix for C1801

* Unit test for entur platform setup

* Rewritten entur component to have pypi dependecy.

* Propper client id for api usage.

* Minor cleanup of usage of constants.

* Made location output configurable.

* Cleaned up usage of constants.

* Moved logic to be contained within setup or update methods.

* Moved icon consts to root in module.

* Using config directly in test

* Minor changes
2018-11-30 09:06:59 +01:00
ehendrix23 aadf72d445 Fix statistics for binary sensor (#18764)
* Fix statistics for binary sensor

-) Binary sensors have 'on' and 'off' for state resulting in issue as numbers were expected. Fixed so that it works with non-numeric states as well.
-) Added check to skip unknown states.
-) Updates test so that binary sensor test will use non-numeric values for states.

* Using guard clause and changed debug to error

Changed to use a guard clause for state unknown.
Writing error on value error instead of debug.

* Add docstring
2018-11-29 09:01:56 +01:00
ehendrix23 0bdf96d94c Add block after setting up component (#18756)
Added a block_till_done after setting up component and before starting HASS.
2018-11-28 16:14:37 +01:00
emontnemery a03cb12c61 Reconfigure MQTT sensor component if discovery info is changed (#18178)
* Reconfigure MQTT sensor component if discovery info is changed

* Do not pass hass to MqttSensor constructor

* Remove duplicated line
2018-11-27 11:23:47 +01:00