Commit graph

4334 commits

Author SHA1 Message Date
Paulus Schoutsen
63a843c19c Fix test 2019-12-22 10:31:23 +01:00
Alexei Chetroi
8e3dfbd5c9
Refactor ZHA electrical measurement sensor. () 2019-12-21 17:15:50 -05:00
Alexei Chetroi
fb3bb8220b
Implement ZHA entity classes registry ()
* ZHA Entity registry.
Match a zha_device and channels to a ZHA entity.

* Refactor ZHA sensor to use registry.
* Remove sensor_types registry.
* Fix ZHA device tracker battery remaining.
* Remove should_poll/force_update attributes.
* Fix binary_sensor regression.
* isort.
* Pylint.
* Don't access protected members.
* Address comments and fix spelling.
* Make pylint happy again.
2019-12-21 16:26:58 -05:00
Jc2k
b41480ae46 Add a config entry mechanism to rediscover a discovery that was ignored ()
* Mechanism to rediscover a discovery that was ignored

* Add core config entry tests for new rediscover step

* Add tests for homekit_controller implementation of async_step_rediscover

* Rename rediscover to unignore

* Comment the new ignore/unignore mechanisms
2019-12-21 11:22:07 +01:00
ochlocracy
0faca57e8b Explicitly include Alexa interface for image_processing entities. () 2019-12-20 20:28:23 +01:00
Fazli Sapuan
92fd3e3ad5 Fix homekit handling of 0 light brightness and fan speed ()
* Fix homekit handling of 0 light brightness and fan speed

* Update homekit tests for new initial brightness/speed value
2019-12-20 11:00:21 +01:00
Franck Nijhof
eb0aed3653
Fix update port and api key on deconz discovery config entry u… ()
* Fix update port and api key on discovery config entry update

* Remove coroutine from _update_entry
2019-12-20 10:29:18 +01:00
Ville Skyttä
d236a19139
Include all SSDP data in discovery info ()
* Include all SSDP data in discovery info

* Use UPnP device description as discovery info, inject some SSDP attrs

* Clean up attribute names

* Adapt existing SSDP flows to changed attribute names

* Prefix all SSDP UPnP attribute name constants with ATTR_UPNP, tweak a bit
2019-12-19 19:28:03 +02:00
Paulus Schoutsen
52818bdb89
Make Hassfest stricter pt 2 ()
* Make Hassfest stricter

* Fix if-condition

* Small cleanup
2019-12-19 14:00:22 +01:00
ochlocracy
5baaa852dd Refactor Alexa capabilityResources object into class, Implement Alexa semantics object ()
* Refactor capabilityResources object into class.
Implement semantics object to support open, close, raise, lower utterences.
Replace covers PercentageController with RangeController.
Add semantics for covers.
Remove PowerController for covers.
Add new display categories.
Add new items to Alexa Global Catalog.
Implement garage door voice PIN code support though Alexa app.
Fixed bug with getting property for ModeController.
Fixed bug were PercentageController AdjustPercentage would exceed 100.

* Comment fixes in Tests.

* Reorder imports.

* Added additional tests for more code coverage.

* Added and additional test for more code coverage.

* Explicitly return None for configuration() if not instance of AlexaCapabilityResource.
2019-12-19 12:44:17 +01:00
Jc2k
c3144eddbb Set unique id on homekit_controller config entries ()
* Set unique id on config entries

* Changes from review
2019-12-19 09:45:22 +01:00
Alexei Chetroi
41bef4b919 Add timer reload service. () 2019-12-18 21:15:11 +01:00
Paulus Schoutsen
9c7caaa142
Add option to ignore flows () 2019-12-18 07:41:01 +01:00
Robert Van Gorkom
78e831b08e Make tplink light more responsive ()
* Making tplink light more responsive.

* Adding light platform tests.

* Addressing PR feedback.

* Mocking the module, not the api.

* Using sync method for background update.
2019-12-17 02:24:50 +01:00
Paulus Schoutsen
58b5833d64
Convert Hue to use unique ID ()
* Convert Hue to use unique ID

* Fix normalization

* Store/restore unique ID

* Fix tests
2019-12-16 19:45:09 +01:00
Paulus Schoutsen
d851cb6f9e
Add unique ID to config entries ()
* Add unique ID to config entries

* Unload existing entries with same unique ID if flow with unique ID is
finished

* Remove unused exception

* Fix typing

* silence pylint

* Fix tests

* Add unique ID to Hue

* Address typing comment

* Tweaks to comments

* lint
2019-12-16 12:27:43 +01:00
Louis-Dominique Dubeau
33cbb398ad Don't use the locals parameter on exec. ()
Using the locals parameter makes it so that the code of a Python script runs as
if it were in the body of a ``class``. One effect of this is that functions
defined as part of a script cannot call one another directly.

Fixes: , 
2019-12-16 09:39:20 +01:00
Paulus Schoutsen
9e51a18845
Make hassfest import detection better ()
* Make hassfest import detection better

* Fix tests
2019-12-16 08:22:20 +01:00
Kevin Eifinger
fc01da8933 Migrate to api_key () 2019-12-16 08:20:41 +01:00
Joakim Plate
039cc98278 Support case of unknown/unavailable temperature/humidity ()
* Support case of unknown/unavailable temperature/humidity

State is never None, just a string.

* Lint suggestion
2019-12-16 08:04:59 +01:00
Ville Skyttä
445fd15f76 Drop Python 3.6 support () 2019-12-16 07:29:19 +01:00
Andrew Onyshchuk
bfafa77016 Fix support for legacy Z-Wave thermostats ()
This brings back support for Z-Wave thermostats
of SETPOINT_THERMOSTAT specific device class.
Such devices don't have COMMAND_CLASS_THERMOSTAT_MODE
and are now handled separately.
2019-12-15 20:02:18 -05:00
Ville Skyttä
d6f317c0a9
Remove deprecated rflink configs ()
They've been deprecated and automatically replaced since July 2017
already, fe6a4b8ae5
2019-12-15 22:57:23 +02:00
Chris Caron
09f3362cc6 isort fix on test_media_player () 2019-12-15 16:07:57 +01:00
Joakim Plate
84a7115435
Start of using hass state for tests rather than direct object () 2019-12-15 13:14:50 +01:00
Jeff Irion
8a5bce81c8 Bump adb-shell to 0.1.0 and androidtv to 0.0.36 ()
* Bump adb-shell to 0.1.0 and androidtv to 0.0.36

* Add test for setting up two devices

* Add test_setup_same_device_twice

* Fix test_setup_two_devices

* Fix coverage

* Coverage

* Fix flaky 'test_setup_two_devices'

* Another stab at coverage

* Rename 'address' back to 'host'
2019-12-15 11:31:59 +01:00
Raman Gupta
003658a3f0 Update androidtv version to improve source selection support ()
* Change androidtv module versions and add support for select_source for all device types

* Update and add tests

* Update requirements_test_all.txt

* Update requirements_all.txt

* Consolidate tests

* Fix typo

* Remove 'self._device'
2019-12-14 16:54:41 +01:00
ochlocracy
3db7e8f5e9 Implement Alexa.EventDetectionSensor for Alexa ()
* Implement Alexa.EventDetectionSensor Interface

* Removed references to PR  not yet merged into dev.

* Update tests to include Alexa Interface

* Guard for `unknown` and `unavailible` states.

* Fixed Unnecessary "elif" after "return"
2019-12-14 08:47:45 +01:00
Paulus Schoutsen
a470a72ec5
Add integration platform helper () 2019-12-13 15:38:41 +01:00
Franck Nijhof
b91a8f510c
Fix incorrect file format yr test fixure () 2019-12-13 12:29:24 +01:00
Bas Nijholt
c59bf0bff6 genericpath is an internal Python module and shouldn't be imported according to core Python devs. (see [this](https://bugs.python.org/msg358136) comment) ()
For a reason unknown to me, @exxamalte introduced this in https://github.com/home-assistant/home-assistant/pull/14342.

The problem is that Linux and macOS implement `os.path` differently, one imports from [`ntpath.py`](https://github.com/python/cpython/blob/master/Lib/ntpath.py) and the other one from [`posixpath.py`](https://github.com/python/cpython/blob/master/Lib/posixpath.py), and both these files use `genericpath.py`.

Somehow, `isort` on macOS will see `genericpath` as a third party library and sort it accordingly.
Other Unix-based OSes will correctly treat `genericpath` as an internal library.

This problem led to a sorting sequence in the following commits:

- ca0fad2cbb
- f5d4878992
- 7d68e88d31
- 1fee400dcd

This supersedes https://github.com/home-assistant/home-assistant/pull/29893.
2019-12-13 09:47:09 +01:00
John Luetke
7c42f4b45b (Re)Add support for multiple Pi-Holes ()
* Update configuration schema to support multiple Pi-holes

* Construct sensors for each configured Pi-hole

* Ensure each Pi-hole has a unique name

* Update services to handle multiple Pi-holes

* Update tests for multiple configurations

* Refactor tests to support service testing

* Fix else-raise per pyliunt

* Per code review, add all entities in a single call

* Per code review, add the default name as default.

* Per code review, add cv.ensure_list to prevent breaking change

* Per code review, move name validation to schema

* Remove default name

* Per code review, validate api_key in schema definition

* Per code review, rename variables

* Per code review, use list comprehension

* Ensure unique slug names in config validation

* Per code review, refactor to CoroutineMock

* Fix adding sensor entities

* Per code review, refactor mock function creation

* Per code review, refactor mock function return values
2019-12-12 19:43:49 +01:00
Alexei Chetroi
1fee400dcd Revert "Sort import for tests/components/feedreader/test_init.… ()
This reverts commit 7d68e88d31.
2019-12-12 17:10:43 +01:00
Ville Skyttä
130571c478 Remove no longer needed auth.util, use secrets instead () 2019-12-12 16:46:33 +01:00
Bas Nijholt
7d68e88d31 Sort import for tests/components/feedreader/test_init.py ()
This unblocks https://github.com/home-assistant/home-assistant/pull/29739
2019-12-12 15:56:32 +01:00
Pascal Vizeli
0c796fc3c3
Remove uvloop event policy ()
* Remove uvloop event policy

* Clean tests

* Fix lint

* Cleanup statment
2019-12-11 13:28:50 +01:00
Tiit Rätsep
01ef44fd68 Fix Soma integration connection issue ()
* Added a check for Connect actually returning something before telling the user the setup succeeded

* Added handling for KeyError in case API returns empty response, formatting

* Trying to please the linter
2019-12-11 13:27:28 +01:00
Bas Nijholt
004af97699 Sort imports for requirements.py and its test using isort ()
Unblocks https://github.com/home-assistant/home-assistant/pull/29739
2019-12-11 12:12:06 +01:00
Ville Skyttä
a12cf7211d Upgrade pydocstyle to 5.0.1 ()
* Upgrade pydocstyle to 5.0.1

http://www.pydocstyle.org/en/5.0.1/release_notes.html

* Pydocstyle and other docstring fixes
2019-12-10 23:25:06 +01:00
Alexei Chetroi
3ed1738f76 Fix input_text initialization with empty config. () 2019-12-10 23:24:33 +01:00
Robert Van Gorkom
66d2f5f61d Fix withings wrong sleep state entry ()
* Fixing issue where wrong sleep state entry was being used. closes #28370,#29397

* Fixing formatting.

* Sorting imports to get black checks to pass.

* Using lambda for getting latest sleep serie.
2019-12-10 21:54:50 +01:00
Robert Svensson
99328bd4c1
UniFi - honor detection time when UniFi wire bug happens () 2019-12-10 20:05:18 +01:00
Franck Nijhof
f5d4878992 Fix isort on a small set of misc files () 2019-12-10 09:25:42 +01:00
Paulus Schoutsen
27244e29c4 Install discovery requirements if used ()
* Install discovery requirements if used

* Update loader.py

* Fix types
2019-12-10 09:24:49 +01:00
Ian
4f1f4a1b4f Nextbus: Sort results for upcoming times ()
Sort upcoming times across all direction's for a particular route and
stop.
2019-12-10 09:22:13 +01:00
Alexei Chetroi
315d0064fe
Fix zha circular import ()
* Refactor zha.core.helpers.
* Make zha isort-able.
* Const import reorg.
* Keep DATA_ZHA config key on entry unload.
* Cleanup ZHA config flow.
* isort.
* Add test.
2019-12-10 00:00:04 -05:00
Alexei Chetroi
454cc684e4 Add input_select reload service. ()
* Add input_select reload service.

* Add test.
2019-12-09 21:15:32 +01:00
Alexei Chetroi
8c1cdc0cf7 Add input_text reload service. ()
* Add input_text reload service.

* Add test.
2019-12-09 21:15:24 +01:00
David F. Mulcahey
1222aa8c56 Add ZHA group API ()
* add skeleton to retrieve zigbee groups
* get single group
* add a group
* return group members with group
* add comment
* fix group members
* add function to add device to group
* add group members
* add remove from group method
* add api to remove members from group
* add remove groups method
* clean up group add and remove
* fix remove group
* fix remove groups
* add api to get only groupable devices
* change var init
* add tests
* address review comment
2019-12-09 14:50:04 -05:00
Bas Nijholt
7f948594eb Sort imports according to PEP8 for google_assistant ()
* sort imports and fix flake8 issue for google

* add isort:skip to EVENT_SYNC_RECEIVED
2019-12-09 20:00:14 +01:00