Commit graph

137 commits

Author SHA1 Message Date
Robert Svensson
a3f0d55737
Change deCONZ to embedded platforms ()
Move all platforms into components/deconz
2019-01-15 19:29:56 +01:00
emontnemery
5b53bd6aa0
Move MQTT platforms under the component ()
* Move MQTT platforms under the component
2019-01-15 17:31:06 +01:00
emontnemery
d8370f44cb Cleanup if discovered mqtt binary_sensor can't be added 2019-01-07 17:00:03 +01:00
javicalle
fb226e3e3b Clean up RFLink tests and add two tests ()
* some minor tests refactor

* unused import
2018-12-22 08:53:02 +01:00
emontnemery
1568de62df Correct calls to subscription.async_unsubscribe_topics ()
* Correct calls to subscription.async_unsubscribe_topics

* Review comments

* Add testcases
2018-12-19 14:05:24 +01:00
emontnemery
b97f0c0261 Make variable entity_id available to value_template for MQTT binary sensor ()
* MQTT binary_sensor: Make variable `entity_id` available to value_template

* Review comments

* Add testcase
2018-12-14 13:00:37 +01:00
Erik
21197fb968 Review comments 2018-12-04 19:56:34 +01:00
Erik
b9ad19acbf Add JSON attribute topic to MQTT binary sensor
Add MqttAttributes mixin
2018-12-02 17:00:31 +01:00
emontnemery
a9990c130d Revert change to MQTT discovery_hash introduced in () 2018-11-30 13:57:17 +01:00
Charles Garwood
b7742999cf
Update Z-Wave Tests asyncio/yield from -> async/await ()
* Update lock tests

* Update binary sensor

* Update zwave component tests
2018-11-20 14:58:03 -05:00
emontnemery
de9bac9ee3 Reconfigure MQTT binary_sensor component if discovery info is changed ()
* Recreate component if discovery info is changed

* Update component instead of remove+add

* Set name and unique_id in __init__

* Update unit test

* Cleanup

* More cleanup

* Refactor according to review comments

* Change discovery_hash

* Review comments, add tests

* Fix handling of value_template
2018-11-19 16:49:04 +01:00
Anders Melchiorsen
84fd66c8a1 Template binary sensor to not track all state changes () 2018-11-19 12:10:48 +01:00
jjlawren
9807ba1a5d Remove FFmpeg input tests ()
* Remove FFmpeg input tests

* Not needed here

* Removing tests for removed functionality

* Minor lint

* Fix tests to reflect removed config option

* Remove async service registration by request

* More lint

* Unused imports

* Make it a non-breaking change

* Update ffmpeg.py
2018-11-03 12:36:22 +01:00
Robert Svensson
a9140dc8f5
deCONZ - retry if setup fails ()
* Make component retry if setup fails
* Improve overall test coverage
2018-10-31 22:38:04 +01:00
Anders Melchiorsen
e5c97fdcab Extract entity ids from all templates () 2018-10-29 08:03:10 +01:00
Paulus Schoutsen
08fe7c3ece
Pytest tests ()
* Convert core tests

* Convert component tests to use pytest assert

* Lint 🤷‍♂️

* Fix test

* Fix 3 typos in docs
2018-10-24 12:10:05 +02:00
emontnemery
10c1378195 Add binary_sensor support to RFlink ()
* Add binary_sensor support to RFlink

* Add support for aliases

* Fix review comments

* Refactor, add tests

* Review comments

* Review comments

* Review comments

* Review comments
2018-10-18 22:28:40 +02:00
emontnemery
5961f2f577 Add support for off_delay to MQTT binary_sensor ()
* Add support for off_delay to MQTT binary_sensor

* Fix debounce, add testcase

* Make off_delay number of seconds instead of timedelta

* Update mqtt.py

* Fix testcase, remove CONF_OFF_DELAY from const.py
2018-10-11 19:14:23 +02:00
Otto Winter
744dd42ad3 Add device registry to MQTT binary sensor () 2018-10-08 14:44:00 +02:00
Martin Berg
e922dd10ba Init sub-components using global var. () 2018-10-07 23:30:09 +02:00
Otto Winter
af89e7c50f Move more MQTT platforms to config entries ()
* Move more MQTT platforms to config entries

* Address comments
2018-09-28 16:57:17 +02:00
emontnemery
eb59f2dd3c Move MQTT discovery removal tests to platform test files () 2018-09-25 19:32:04 +02:00
Paulus Schoutsen
7840b1e387
Fix MQTT leaving files behind () 2018-09-25 12:22:27 +02:00
Martin Berg
a5cb4e6c2b Use pyspcwebgw for SPC component ()
* Use pyspcwebgw library.

* Support alarm triggering.

* Update requirements.

* Add pyspcwebgw to test reqs.

* Also update script.

* Use dispatcher.

* Address review feedback.
2018-09-24 10:10:10 +02:00
Malte Franken
d5813cf167 Make rest sensor and binary sensor more efficient ()
* create binary sensor even if initial update fails

* fixed broken test assertion

* fixed broken test assertion

* avoid fetching resource twice - manually in the setup_platform and then through add_devices

* raising PlatformNotReady instead of creating the sensor if the initial rest call fails; throttling the update to avoid fetching the same resource again immediately after setting up sensor

* rolled back throttling of the rest update call; can still avoid updating the binary sensor's rest resoure twice; fixed tests

* typo
2018-09-21 15:54:50 +02:00
Robert Svensson
90c18d1c15 deCONZ add via_hub attribute for device registry ()
* deCONZ add via_hub attribute for device registry

* A shorter way to get bridgeid
2018-09-21 09:21:44 +02:00
Matthias Urlichs
0121e3cb04 Remove usage of "run_until_complete" ()
* De-run_forever()-ization

* Use asyncio.run (or our own implementation on Python <3.7)
* hass.start is only used by tests
* setup_and_run_hass() is now async
* Add "main" async hass.run method
* move SIGINT handling to helpers/signal.py
  * add flag to .run to disable hass's signal handlers
* Teach async_start and async_stop to not step on each other
  (more than necessary)

* shorten over-long lines

* restore missing "import asyncio"

* move run_asyncio to homeassistant.util.async_

* LOGGER: warn => warning

* Add "force" flag to async_stop

only useful for testing

* Add 'attrs==18.2.0' to requirements_all.txt

Required for keeping requirements_test_all.txt in sync, where it is in
turn required to prevent auto-downgrading "attrs" during "pip install"

* Fixes for mypy

* Fix "mock_signal" fixture

* Revert mistaken edit

* Flake8 fixes

* mypy fixes

* pylint fix

* Revert adding attrs== to requirements_test*.txt

solved by using "pip -c"

* Rename "run" to "async_run", as per calling conventions
2018-09-19 15:40:02 +02:00
Paulus Schoutsen
201fd4afee Add config entries to connection class () 2018-09-17 10:12:46 +02:00
Paulus Schoutsen
994b829cb4
add_devices -> add_entities ()
* add_devices -> add_entities

* Lint

* PyLint

* Revert external method in scsgate
2018-08-24 16:37:30 +02:00
Ville Skyttä
dbd0763f83 Grammar and spelling fixes () 2018-08-19 22:29:08 +02:00
Ville Skyttä
2f7b79764a More pylint 2 fixes ()
## Description:

More fixes flagged by pylint 2 that don't hurt to have before the actual pylint 2 upgrade (which I'll submit soon).

## Checklist:
  - [ ] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
2018-07-20 11:45:20 +03:00
lich
7d7c2104ea Customizable command timeout ()
* Customizable command timeout

* Change string to int

* update the tests. Do the same thing on the binary_sensor.command_line.
2018-07-17 22:58:30 +02:00
Paulus Schoutsen
538236de8f Fix formatting pylint comments in test () 2018-07-13 23:02:23 +02:00
Marcelo Moreira de Mello
2839f0ff5f Upgrade ring_doorbell to 0.2.1 to fix oauth issues ()
* Upgraded to ring_doorbell to 0.2.1 to fix oauth issues

* Updated unittest to cover Ring oauth
2018-06-16 08:58:39 +02:00
Marius
08adfd87f7 Add unique_id for mqtt binary sensor ()
* Added unique_id for mqtt binary sensor

* Added missing mqtt message fire in test
2018-06-13 16:20:38 +02:00
Robert Svensson
8c93b484c4 deCONZ - Option to load or not to load clip sensors on start ()
* Option to load or not to load clip sensors on start

* Full flow

* Fix config flow and add tests

* Fix attribute dark reporting properly

* Imported and properly configured deCONZ shouldn't need extra input to create config entry
2018-05-29 10:09:53 -04:00
Diogo Gomes
97076aa3fd Fix probability_threshold in binary_sensor.bayesian () (Closes: ) 2018-05-18 07:48:16 +02:00
Ville Skyttä
843789528e Remove extra quotes from docstrings () 2018-05-13 11:06:15 +02:00
Robert Svensson
8410b63d9c deCONZ add new device without restart ()
* Add new device without restarting hass

* Remove debug prints

* Fix copy paste error

* Fix comments from balloob
Add tests to verify signalling with new added devices

* Fix hound comments
Add test to verify when new sensor is added

* Fix tests

* Unload entry should unsubscribe all deconz dispatchers

* Make sure mock setup also creates unsub in hass data

* Fix copy paste issue

* Lint
2018-05-05 10:11:00 -04:00
Kane610
8a10fcd985 deCONZ use forward entry setup ()
* Use forward entry setup with light platform

* Move sensor to forward entry setup

* Use forward entry setup with binary sensors

* Use forward entry setup with scene platform

* Remove import of unused functionality

* Move deconz setup in to setup entry
Create initial negative tests for setup entry

* Fix hound comment

* Improved tests

* Add test for scene platform

* Add test for binary sensor platform

* Add test for light platform

* Add test for light platform

* Add test for sensor platform

* Fix hound comment

* More asserts on sensor types
2018-04-23 12:00:16 -04:00
Matthias Urlichs
f5cc40024d Rename homeassistant.util.async to .async_ ()
"async" is (going to be) a reserved word.
2018-03-11 10:01:12 -07:00
Paulus Schoutsen
b3a47722f0
Initial support for Config Entries ()
* Introduce Config Entries

* Rebase fail

* Address comments

* Address more comments

* RequestDataValidator moved
2018-02-16 14:07:38 -08:00
mkfink
25cbc8317f Force update support for mqtt binary sensor () 2018-02-08 12:28:12 +01:00
Dan Nixon
844337ca42 Properly handle thresholds of zero ()
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
hawk259
4f0776de13 Binary Sensor Template: Add icon_template and entity_picture_template support ()
* 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
Otto Winter
8dcfd35b8b Spelling fixes ()
* Spelling fixes

*Lots* of them.

* Spelling breaking changes

* Fix lint errors
2018-01-29 23:37:19 +01:00
Ville Skyttä
b4d682ca75 Python 3.6 invalid escape sequence deprecation fixes ()
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
2018-01-27 12:16:30 +01:00
Dan Nixon
3972d1d4c6 Mark REST binary_sensor unavailable if request fails ()
* Mark REST binary_sensor unavailable if request fails

* Add test suite for RESTful binary sensor
2018-01-11 10:48:15 +01:00
cdce8p
cba55402b1 Improved test runtime ()
* Remove redundent assert statements and cleanup

* Added 'get_date' function

* Replace 'freeze_time' with 'mock.patch'
* Tox in 185s (py35)

* Removed obsolete 'freeze_time' from test_updater
* Tox 162s (py35)

* Remove test requirement 'freezegun'

* Fixed flake8 errors

* Added 'mock.patch' for 'feedparser.parse'

* Made 'FUNCTION_PATH' a constant

* Remove debug statements.
2018-01-09 16:00:49 -08:00
Paulus Schoutsen
ff9688bb7a
Fix vultr tests () 2018-01-05 16:34:03 -08:00