1
mirror of https://github.com/home-assistant/core synced 2024-10-07 10:13:38 +02:00
Commit Graph

5247 Commits

Author SHA1 Message Date
springstan
04c4501455
Add and use UNIT_VOLT constant (#33994)
* Add and use UNIT_VOLT constant

* Run isort
2020-04-11 02:04:58 +02:00
Steven Looman
dfc66b2018
Rewrite parts of upnp component (#33108)
* Rewrite parts of upnp component

* Linting

* Add SCAN_INTERVAL

* Get values simultaneously

* Move to time related constants, as per #32065

* Linting

* Move constant KIBIBYTE to homeassistant.const

* Simplify code

* Fix tests for #33344

* Changes after review

* Update homeassistant/components/upnp/sensor.py

* Changes after review

* Formatting

* Formatting

* Use ST from discovery info to avoid swapping device_types if device advertises multiple versions

* Linting

* Requirements for upnp + dlna_dmr components

* Linting

* Regen requirements

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

* Formatting

* Linting

* Changes after review by @MartinHjelmare

* Changes after review by @MartinHjelmare

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-11 00:24:03 +02:00
Ziv
302e631984
Ability to mock long poll requests + refactor qwikswitch unit… (#33804)
* added the ability to mock a "long poll" get request by setting up the
waiting request and feeding responses to it
with this, refactored the qwikswitch test so it doesn't use global variables
and is more understandable and maintainable

* added import asyncio from merge

* added assert that first call with long_poll has empty content

* passing json instead of the binary string

* use json instead of text in mock requests

* refactored to use a proxy

* return the proxy also for the http methods other than get

* refactored so any side_effect can be used and created the long_poll side effect

* simplified by using kwargs
needed to move the json->text->content logic from mocker to mockrequest

* no need to explicitly define method and url
2020-04-10 14:57:39 -07:00
David F. Mulcahey
13dda7bd98
Cleanup ZHA group entity lifecycle (#33977)
* Clean up ZHA group entity lifecycle

* group entities don't use state restore

* add tests
2020-04-10 13:17:48 -07:00
springstan
25198242c1
Use TEMP_FAHRENHEIT constant (#33969) 2020-04-10 21:10:10 +02:00
springstan
02c9e47db8
Use ENERGY_KILO_WATT_HOUR constant (#33962) 2020-04-10 20:21:29 +02:00
Erik Montnemery
6d3046cb42
Remove support for cast dynamic speaker groups (#33884) 2020-04-10 10:36:57 -07:00
springstan
78d87dc40f
Use TEMP_CELSIUS constant (#33963) 2020-04-10 19:17:46 +02:00
J. Nick Koston
ca0648afe8
Fix powerwall units (kW) (#33954)
* Fix powerwall units (kW)

* Fix test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-04-10 09:33:58 -07:00
Erik Montnemery
a0b3a9e50b
Discover manually added casts (#33922)
* Discover manually added casts
2020-04-10 17:19:44 +02:00
J. Nick Koston
a000af5c03
Fix tplink HS220 dimmers (round 2) (#33928)
* HS220 dimmers are handled as lights with a limited feature set

* Dimmers look up has has_emeter every call so this is cached as well now
to resovle the performance issue.
2020-04-09 17:10:02 -07:00
Kit Klein
c2d1db61b6
Exclude access token from host info updates in Konnected config flow (#33912)
* black updates

* test that host update doesn't impact access token
2020-04-10 01:16:33 +02:00
jjlawren
42ca566e05
Improve Plex debounce/throttle logic (#33805)
* Improve Plex debounce/throttle logic

* Use Debouncer helper, rewrite affected tests

* Mock storage so files aren't left behind

* Don't bother with wrapper method, store debouncer call during init

* Test cleanup from review

* Don't patch own code in tests
2020-04-10 00:49:09 +02:00
Franck Nijhof
30c6ace0f3
Rewrite MQTT & demo Lock tests (#33838)
* Refactor tests to remove tests.lock.common

* Remove unused is_locked hass binding

* Import constants via entity component

* Import constants via entity component

* Fix light vs lock in naming
2020-04-10 00:40:51 +02:00
J. Nick Koston
6b2baae0de
Fix tplink HS220 dimmers (#33909)
* HS220 dimmers are handled as lights with a limited feature set
2020-04-09 15:07:39 -07:00
jan iversen
9535dd87b0
Rename domain import in modbus (#33906) 2020-04-09 22:15:20 +02:00
springstan
bc26be3c11
Add and use HTTP_FORBIDDEN constant (#33839) 2020-04-09 17:41:17 +02:00
On Freund
a4c9446b8d
Fix Monoprice robustness (#33869)
* Silently handle update failures

* Limite parallel updates

* Remove return values

* Remove trailing return

* Add test for empty update
2020-04-09 17:04:12 +02:00
Quentame
45b28b8b00
Add local_ip unique_id & icon and single_instance_allowed (#33483)
* Add config flow + sensor unique_id & icon to local_ip

* single_instance_allowed

* Fix test

* Martin's review

* Name deprecated
2020-04-09 16:06:01 +02:00
Erik Montnemery
3845539577
Lookup manufacturer name for casts (#33845)
* Lookup manufacturer name, remove use of get_multizone_status

* Bump pychromecast

* Bump pychromecast

* Fix test
2020-04-09 10:58:19 +02:00
Raman Gupta
b46eee04e4
Fix vizio bug that occurs when CONF_APPS isn't in config entry… (#33857)
* fix bug when search for string in dict fails when dict is null

* another bug fix that I only noticed because of this other bug

* add test to cover failure scenario

* update docstring

* add additional assertions to cover failure scenario that's being fixed
2020-04-08 20:44:33 -07:00
J. Nick Koston
ff936302d7
Fix Doorbird yaml import aborted if discovery finds it first (#33843) 2020-04-08 18:29:46 -07:00
J. Nick Koston
8be7cb4539
Update nut to use DataUpdateCoordinator (#33831)
* Convert nut to use DataUpdateCoordinator

* Adjust per review

* ups_list is a dict with {id: name, ...}
2020-04-08 18:26:10 -07:00
Paulus Schoutsen
bdb998bdb3
Fix last flaky TTS test (#33849) 2020-04-08 19:18:09 -05:00
springstan
9a40d5b7ed
Use HTTP_NOT_FOUND constant (#33835) 2020-04-09 00:57:47 +02:00
J. Nick Koston
ac9429988b
Add a config flow for flume (#33419)
* Add a config flow for flume

* Sensors no longer block Home Assistant startup
since the flume api can take > 60s to respond on
the first poll

* Update to 0.4.0 to resolve the blocking startup issue

* Missed conversion to FlumeAuth

* FlumeAuth can do i/o if the token is expired, wrap it

* workaround async_add_entities updating disabled entities

* Fix conflict
2020-04-08 16:29:59 -05:00
springstan
fb8f8133a0
Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
Robert Svensson
15ab63a4c2
UniFi: Add UDM/P (UniFi OS) support (#33766)
* Fix get_controller and all tests:wq

* Bump dependency to v16
2020-04-08 23:19:39 +02:00
J. Nick Koston
7dd42bc32d
Separate august keypads into their own device (#33665)
The keypad has its own unique id so its better
represented as its own device.  This fixes
showing the keypad battery state for the lock
in the UI.
2020-04-08 12:57:27 -07:00
Paulus Schoutsen
df744c5944
Speed up TP-Link lights (#33606)
* Speed up TP-Link lights

* Color temp kan be None

* hs as int, force color temp=0

* Fix color temp?

* Additional tplink cleanups to reduce api calls

* Update test to return state, remove Throttle

* Fix state restore on off/on

* Fix lights without hue/sat

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-08 14:36:45 -05:00
Robert Van Gorkom
ea709d0630
Remove withings sleep state (#33817) 2020-04-08 11:57:42 -07:00
J. Nick Koston
cec3b57390
Fix thermostats that do not support off under homekit (#33809)
TargetHeatingCoolingState: value=0 is an invalid value.
would be raised when a thermostat did not support
off.
2020-04-08 11:56:11 -07:00
Martin Hjelmare
c3decc6531
Do not ban supervisor ip if set (#33781)
* Use asynctest patch instead of mock_coro

* Add test for supervisor ip ban

* Do not ban supervisor ip if set

* Extract supervisor ip helper

* Check supervisor ip before banning

* Remove added blank line

* Clean up get supervisor ip

Co-Authored-By: Pascal Vizeli <pvizeli@syshack.ch>

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-04-08 10:31:44 -07:00
J. Nick Koston
7383e81609
Convert nut to a multi step config flow (#33803)
* Convert nut to a multi step config flow

* Users can now choose the ups they want in
step 2 (or skipped if only one)

* Users can now select the resources they want
to monitor based on what is actually available
on the device

* CONF_NAME has been removed as we now get the
name from NUT

* Device classes have been added which allows
the battery charge state to be seen in the
devices UI

* Remove update_interval as its for a followup PR

* explict

* reduce

* fix bug, add tests for options flow

* Test for dupe import

* Test for dupe import

* Call step directly

* Update homeassistant/components/nut/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-08 11:45:45 -05:00
MatthewFlamm
a3e84791c6
Convert nws integration to component configuration (#31398)
* convert nws to component configuration

* add more debug logging

* remove assumed state

* move initialization of data into init

* refactor update logic

* use forecast success for checking available entities

* Split unique_id into more usable pieces.

use a base_unique_id for each entry.  Add domain for signaling to entities.  Each entity in each platform can use base_unique_id to form individual unique_id's.

* Revert "move initialization of data into init"

This reverts commit 09eb0220469285b10f0500f5f6def67415931a81.

* add silver quality scale to manifest

* unsubscribe listener in will_remove_from_hass

* initialize _unsub_listener in __init__

* use async_on_remove

* remove scan interval from configuration

* Use better name

Co-Authored-By: J. Nick Koston <nick@koston.org>

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-08 10:22:25 -05:00
Paulus Schoutsen
ba8ae17487
Fix hue ct (#33791) 2020-04-08 11:31:41 +02:00
springstan
eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
springstan
46bbe816f6
Remove None from dict.get(key, None) (#33794) 2020-04-07 21:06:05 +02:00
Chris Talkington
d54ee77375
Update directv remote platform tests service calls (#33793)
* Update test_remote.py

* Update test_remote.py
2020-04-07 11:57:51 -07:00
J. Nick Koston
078ce6766e
Add discovery support to synology_dsm (#33729)
* Add discovery support to synology_dsm

* Remove debug

* black

* Fix mocks

* Merge strings

* Move placeholders

* add missing placeholders

* reorder

* use constants in test

* Remove CONF_NAME (only displayed in discovery now)

* test reduction

* Shorten long name

* Use name for name but NOT for unique_id, remove CONF_NAME from yaml config

* Use Synology for the name for now, hopefully we can use the hostname later

* lint

* Remove name from strings

* remove =None

* show login errors at username field

* Update tests/components/synology_dsm/test_config_flow.py

Co-Authored-By: Quentame <polletquentin74@me.com>

* Update tests/components/synology_dsm/test_config_flow.py

Co-Authored-By: Quentame <polletquentin74@me.com>

* Update homeassistant/components/synology_dsm/const.py

Co-authored-by: Quentame <polletquentin74@me.com>
2020-04-07 10:22:35 -07:00
Paulus Schoutsen
8fb89854d3
Fix flaky TP-Link test (#33790) 2020-04-07 10:13:55 -07:00
Erik Montnemery
ddef681dd2
Improve MQTT debug info for subscriptions with wildcard (#33752) 2020-04-07 09:38:22 -07:00
Ziv
3697ea7b27
Remove uncaught exceptions from rflink (#33709)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-04-07 09:37:54 -07:00
Franck Nijhof
bb8bbc9c54
Collection of tests improvements (#33778) 2020-04-07 09:36:35 -07:00
Ziv
bee742994e
Fix uncaught exceptions for discovery, unify_direct, spotify,… (#33735)
* used coroutinemock to avoid exception

* added spec to mock to remove exception

* added the current_user return value so it doesnt throw exception

* fix the mocks so properties do not need .return_value

* fixed missing mock values that were causing exceptions

* moved patch to asynctest so no need to define m_init

* fixed black error
2020-04-07 09:34:13 -07:00
Franck Nijhof
60bc517d01
Collection of core tests improvements (#33757)
* Collection of core tests improvements

* Added some more

* Fix aiohttp client response release
2020-04-07 09:33:23 -07:00
Chris Talkington
1f7803c541
Catch IPPParseError during config flow (#33769)
* Update config_flow.py

* Update strings.json

* Update config_flow.py

* squash.
2020-04-07 09:32:43 -07:00
jan iversen
b3286a4a01
Fix Modbus review comments (#33755)
* update common test for modbus integration

* remove log messages from modbus setup function.

* Make global method local

* Change parameter name to snake_case
2020-04-07 16:56:48 +02:00
Martin Hjelmare
cb98d62968
Patch gdacs entry setup in config flow tests (#33776) 2020-04-07 12:36:40 +02:00
Paulus Schoutsen
cc1564da4a
TTS: Wait till files are created in tests (#33760) 2020-04-06 15:11:46 -07:00
Erik Montnemery
f3b6575272
Fix MQTT debug info for subscriptions with wildcard. (#33744) 2020-04-06 10:25:09 -07:00
Franck Nijhof
476072927a
Collection of random test improvements (#33742) 2020-04-06 10:09:44 -07:00
Ziv
cedf7e3945
Fix unhandled exceptions for config, default_config, harmony (#33731)
* replaced MagicMock with CoroutineMock to avoid exception

* added conversion to str so mock returns unique-id that doesn't throw json exception

* added non-empty config since hass throws exception when config is empty
2020-04-06 13:36:49 +02:00
Franck Nijhof
98a2efcbab
Collection of random (mainly) test improvements (#33733) 2020-04-06 12:51:48 +02:00
Jevgeni Kiski
a1aebe904e
Add MQTT Alarm Control Panel custom bypass state (#32541)
* MQTT Alarm Control Panel to have all available states

* MQTT Alarm Control Panel to have all available states

* test_arm_custom_bypass_* tests added

* MQTT payload_arm_custom_bypass abbreviation
2020-04-06 11:45:37 +02:00
Ziv
ffa111deb9
Fix exceptions in tests for samsung_tv (#33732) 2020-04-06 11:21:52 +02:00
J. Nick Koston
e4ee4cf302
Remove legacy async_add_job from homekit tests (#33727)
* Remove legacy async_add_job from homekit tests

* Empty commit to rerun CI
2020-04-05 21:33:36 -05:00
jan iversen
738ef38ddc
Modbus: isolate common test functions (#33447)
Since all entity test functions are going to use
the modbus class, isolate the common parts in
conftest.py, and thereby make it simpler to write
additional test cases.

cleaned up test_modbus_sensor.py while splitting the code.
2020-04-05 19:09:20 -04:00
Quentame
d99e228983
Add config flow to Synology DSM (#32704)
* Add config flow to Synology DSM

* Use proper sensor unique ID from flow + sensor name

* Add description to api_version

* Add authentication flow check

* Add device_info

* Add test_login_failed test

* Bump python-synology to 0.5.0

* 0.5.0 test updates

* Use NAS S/N as config_flow unique_id

* Add missed conf disks + volumes

* Review: async_unload the async_track_time_interval

* Fix NoneType for disks or volumes

* Keep all disks and volumes forever

* Update homeassistant/components/synology_dsm/.translations/en.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Update homeassistant/components/synology_dsm/strings.json

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Fix "Keep all disks and volumes forever" for empty import

* Fix prettier

* Remove useless LOGGER in config flow

* Fix Synology DSM tests doing I/O

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-05 17:50:52 -05:00
springstan
67c3a4c970
Improve string formatting v7 (#33705) 2020-04-05 17:34:24 -05:00
J. Nick Koston
d28b477f9a
Fix nuheat response error checking (#33712)
This integration was checking request instead
of response for the error code.
2020-04-05 15:23:20 -07:00
Quentame
a16e742107
Fix iCloud tests doing I/O (#33721) 2020-04-05 15:21:22 -07:00
Ziv
5711c0882f
Fix exception in zwave test (#33711)
would be better to not have it in there but mock has all attributes
2020-04-05 15:17:24 -07:00
Ziv
18e4493ca3
Ignore tplink tests exceptions (#33710) 2020-04-05 15:16:16 -07:00
J. Nick Koston
171c1b20f7
Remap homekit auto to home assistant heat_cool (#33701)
Home Assistant auto mode is described as
"The device is set to a schedule, learned behavior, AI."

HomeKit Accessory Protocol expects "heating or cooling to maintain
temperature within the heating and cooling threshold of the
target temperature"

Since HomeKit is expecting to set temperatures in this mode,
mapping homekit state 3 ("Auto") to Home Assistant HVAC_MODE_HEAT_COOL
is more inline with how Home Assistant defines HVAC_MODE_HEAT_COOL
as "The device supports heating/cooling to a range"
2020-04-05 15:54:57 -05:00
Franck Nijhof
d33cf28936
Add check executables have shebangs (in pre-commit and CI) (#33703)
* Add check executables have shebangs (in pre-commit and CI)

* Fix file permissions

* Adjust Azure Pipelines
2020-04-05 18:45:43 +02:00
Malachi Soord
3f0936f068
Prevent last.fm errors with None (#33446) 2020-04-05 18:03:13 +02:00
J. Nick Koston
b855177fe6
Make homekit aware of STATE_STANDBY (#33679) 2020-04-05 08:47:44 -05:00
J. Nick Koston
de317fb2f6
Map dry and fan only states for homekit thermostats (#33682)
Homekit only has Off/Heat/Cool/Auto at this time, but
at least we can prevent the device from erroring
by mapping dry and fan to cool so it continues
to function.
2020-04-05 08:47:32 -05:00
Paulus Schoutsen
5bf7e0fcc0
List dir when test fails (#33685) 2020-04-05 12:15:29 +02:00
Franck Nijhof
7653dc947a
Enable pylint unnecessary-pass (#33650)
* Enable pylint unnecessary-pass

* Process review suggestions

* Fix smhi tests
2020-04-05 10:33:07 +02:00
J. Nick Koston
000ad256fb
Handle float values for homekit lightning (#33683)
* Handle float values for homekit lightning

* Empty commit to rerun CI
2020-04-04 23:21:44 -07:00
jjlawren
d3a4270312
Plex logging additions & cleanup (#33681) 2020-04-04 23:21:20 -07:00
Michal Ziemski
8d3a415d07
Add OpenERZ API integration (#30441)
* Adding OpenERZ integration

* Added unit tests

* Linter fixes, better friendly_name handling

* Increase coverage

* Review fixes

* fixup! Review fixes

* Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library

* fixup! Refactor to use external openerz-api library
2020-04-05 05:04:41 +02:00
Franck Nijhof
528c7f4871
Removal of extraneous parenthesis in tests (#33670)
* Removal of extraneous parenthesis

* Process review suggestions

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-05 03:50:30 +02:00
Franck Nijhof
b00b8ea0c1
Use byte literals instead of encode in tests (#33672) 2020-04-05 02:39:44 +02:00
Franck Nijhof
59f1a1be93
Replace OSError aliases with OSError in UVC test (#33673) 2020-04-05 02:21:47 +02:00
Franck Nijhof
262b01d632
Removal of old style class definitions in tests (#33671) 2020-04-05 02:21:07 +02:00
Franck Nijhof
03dd92d51b
Use set literals in tests (#33669) 2020-04-05 02:20:09 +02:00
Phil Bruckner
bf1b408038
Handle cancellation in ServiceRegistry.async_call (#33644) 2020-04-04 15:36:33 -07:00
Franck Nijhof
d7e9959442
String formatting improvements for tests (2) (#33666) 2020-04-05 00:33:07 +02:00
Franck Nijhof
906385172a
String formatting improvements for tests (#33663) 2020-04-05 00:26:08 +02:00
Ziv
c3c7b68cac
Fix unhandled exceptions in dsmr (#33601)
* reordered the clearing of the closed Event so it can stay set at the end and not
leave a task waiting on close

* fixed the side effect so it returns one TimeoutError and after that success
Previously it reached the end of the single item list and threw an exception

* fixed the error. it doesn't happen on python 3.7.5 but CI is on 3.7.0

* fixed comment
2020-04-04 14:38:20 -07:00
Paulus Schoutsen
0a3ec6fea1
Correct Hue mireds for lights (#33597) 2020-04-04 14:29:03 -07:00
springstan
dde93304d3
Improve string formatting v2 (#33645)
* Improve string formatting v2

* Improve string formatting v3

* Address review comments
2020-04-04 23:09:34 +02:00
springstan
0d95eff21d
Use dict literals (#33658) 2020-04-04 22:31:56 +02:00
springstan
ed71683488
Improve string formatting (#33643) 2020-04-04 20:17:11 +02:00
Franck Nijhof
46fa20411e
Bump twentemilieu to 0.3.0 (#33622)
* Bump twentemilieu to 0.3.0

* Fix tests
2020-04-04 14:51:12 +02:00
Ziv
0d05bd309a
Fix uncaught exceptions in upnp (#33604)
removed also the yr tests that are already successful
2020-04-03 22:44:57 -07:00
Paulus Schoutsen
c6ba607c8c
Use IP addresses instead of mDNS names when wled discovered (#33608) 2020-04-03 22:41:08 -07:00
Chris Talkington
07ae3f9ee9
Use IP addresses instead of mDNS names when IPP discovered (#33610)
* use discovery resolved host rather than mdns host.

* Update __init__.py

* Update test_config_flow.py

* Update __init__.py

* Update test_init.py

* Update test_config_flow.py

* Update test_config_flow.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update test_init.py

* Update test_config_flow.py
2020-04-03 22:36:46 -07:00
jjlawren
42353282d4
Debounce calls to Plex server (#33560)
* Debounce calls to Plex server

* Simplify debounce by recommendation

* Update tests to handle debounce

* Test debouncer, fix & optimize tests

* Use property instead
2020-04-03 22:34:42 -07:00
Paulus Schoutsen
dc7127aacf
Data Coordinator to return unsub func (#33588) 2020-04-03 20:15:42 +02:00
Erik Montnemery
4e6fd19624
Improve MQTT test coverage and remove dead code (#33584)
* Improve MQTT tests and remove dead code

* Remove useless test.

* Add more test
2020-04-03 09:05:58 -07:00
ollo69
62835f0536
Fix asuswrt network failure startup (#33485)
* Fix network failure startup

Fix for issue ##33284 - Asuswrt component fail at startup after power failure

* Removed comment

* Removed bare except

* is_connected moved out try-catch

* Removed pointless-string-statement

* Raise PlatformNotReady on "not is_connected"

* Removed unnecessary check

* Revert "Removed unnecessary check"

This reverts commit a2ccddab2c4b1ba441f1d7482d802d9774527a26.

* Implemented custom retry mechanism

* Fix new line missing

* Fix formatting

* Fix indent

* Reviewed check

* Recoded based on tibber implementation

* Formatting review

* Changes requested

* Fix tests for setup retry

* Updated missing test

* Fixed check on Tests

* Return false if not exception

* Format correction
2020-04-03 15:02:48 +02:00
Robert Van Gorkom
ae22b5187a
Add vera config entries support (#29880)
* Adding vera config entries support.

* Fixing lint error.

* Applying minimal changes necessary to get config entries working.

* Addressing PR feedback by further reducing the scope of the change.

* Addressing PR feedback.

* Fixing pyvera import to make it easier to patch.
Addressing PR feedback regarding creation of controller and scheduling of async config flow actions.

* Updating code owners file.

* Small fixes.

* Adding a user config flow step.

* Adding optional configs for user config flow.

* Updating strings to be more clear to the user.

* Adding options flow.
Fixing some PR feedback.

* Better handling of options.
PR feedback changes.

* Using config registry to update config options.

* Better managing config from file or config from UI
Disabling config through UI if config is provided from a file.
More tests to account for these adjustments.

* Address PR feedback.

* Fixing test, merging with master.

* Disabling all Vera UI for configs managed by configuration.yml.
Adding more tests.

* Updating config based on unique_id.
Addressing additional PR feedback.

* Rebasing off dev.
Addressing feedback.

* Addressing PR feedback.
2020-04-03 09:49:50 +02:00
Paulus Schoutsen
aef06a3544
Directly call write state 2 (#33513)
* Directly call async_write_ha_state pt2

* Directly call async_write_ha_state pt2

* Fix mock

* Address comments
2020-04-03 09:34:50 +02:00
akasma74
83cc871edf
Add force_update to timer integration (#31646)
* force_update added

As per this discussion we need to update last_changed when active timer restarted.
One way to do that is to force HA update the state on each request even if it remains the same.
More details here - https://github.com/home-assistant/architecture/issues/345

* add test for force_update

make sure state_change event fired every time timer (re)started

* remove whitespaces

* remove whitespace

* Update tests/components/timer/test_init.py

Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>

* fix lint

* fix isort

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-04-02 23:48:41 -07:00
Raman Gupta
081b822d25
Add support for Vizio sound mode (#33200)
* add sound mode support for devices that support it

* make setting and unsetting flag better

* move eq and audio settings into constants

* fix missed statement to use constant instead of hardcoded string

* further fixes based on review

* bump pyvizio version to include newly identified app
2020-04-02 22:48:19 -04:00
J. Nick Koston
f25321e010
Use homekit service callbacks for lights to resolve out of sync states (#32348)
* Switch homekit lights to use service callbacks

Service callbacks allow us to get the on/off, brightness, etc
all in one call so we remove all the complexity that was
previously needed to handle the out of sync states

We now get the on event and brightness event at the same time
which allows us to prevent lights from flashing up to 100%
before the requested brightness.

* Fix STATE_OFF -> STATE_ON,brightness:0
2020-04-02 20:06:13 -05:00
Teemu R
e64104300f
Use backend-provided fan speed presets for Xiaomi vacuums, bum… (#32850)
* Use backend-provided fan speed presets for Xiaomi vacuums

This needs input from Xiaomi vacuum owners to verify that it does not break anything.
I have personally tested this on rockrobo v1 (old mapping).

Related issues/PRs:
home-assistant/core#32821
home-assistant/core#31268
home-assistant/core#27268

This is a WIP as it requires a new upstream release.
The PR is https://github.com/rytilahti/python-miio/pull/643

* Bump version requirement for 0.5.0

* Bump requirements_test_all.txt, too

* Fix linting; missing setup.cfg on local checkout caused wrong settings for black..

* Add tests for both fan speed types

* Remove useless else..

* bump python-miio to 0.5.0.1 due to broken 0.5.0 packaging
2020-04-02 16:55:44 -07:00
Aaron Bach
cb058ff6c0
Add config entry for Flu Near You (#32858)
* Add config flow for Flu Near You

* Cleanup

* Cleanup

* Add tests

* Add test requirements

* Code review

* Reduce unnecessary async-ness

* Handle API registration

* Cleanup

* Update homeassistant/components/flunearyou/.translations/en.json

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Code review

* Ensure config schema allows additional keys

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-04-02 16:54:11 -07:00
Ziv
f2dad7905d
fixed uncaught exceptions for tradfri (#33550)
was caused by device_info being mocks, so write to storage failed
2020-04-03 00:55:04 +02:00
Alistair Galbraith
3db9d6a6aa
Fix template light returning NULL in color or temperature (#33498)
* Support for returning NULL in color or temperature. Fixes #33469

* Added further support for ‘None’ returns in level template

* Removed assumption that template render may not be a string

* Streamlined code per cloud pylint

* Updates per code review suggestions

* Added improved error handling and logging for brightness

* Additional exception handling for temperature
2020-04-02 17:41:19 -05:00
Ziv
8fbdc703e0
Fix uncaught exceptions for mqtt (#33547)
now all mqtt tests pass
2020-04-02 15:18:30 -07:00
David F. Mulcahey
201e958854
Use mock storage for MQTT tests (#33553)
* mock storage for MQTT

* more mqtt storage mocks
2020-04-02 17:13:44 -05:00
Paulus Schoutsen
6afe6acb6c
Mark new gate device class as 2FA (#33541) 2020-04-02 22:02:59 +02:00
Ziv
39408ab240
Add cover platform to Dynalite (#32594)
* lib version

* unit-test refactoring

* added type hints

* added cover

* added test to see that consts have the same value as library consts

* Update tests/components/dynalite/test_init.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* removed trigger template

* Update homeassistant/components/dynalite/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/dynalite/const.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* removed CONF_TRIGGER from const
corrected type hints - not clear why mypy didn't catch it

* conversion of the config to library CONFs

* moved to use the value since it should come from the library

* taking CONF_HOST from homeassistant.const instead of module const

* use dict.get
removed leftover log

* force device_class to be from homeassistant consts

* move dict.get to inline

* removed CONF from values
changed "channelcover" to "channel_cover"

* moved some CONF values out of const.py and taking them from homeassistant.const

* verifying that device class is a valid HA device class

* moved shutter to home assistant const

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-02 20:26:36 +02:00
mvn23
1d89d22a38
Update pyotgw to 0.6b1 (#33529) 2020-04-02 10:29:41 -07:00
David F. Mulcahey
8b0a0ee521
Don't write storage to disk while stopping (#33456)
* Don't write storage to disk while stopping

* rework change

* lint

* remove delay save and schedule final write at stop

* update tests

* fix test component using private methods

* cleanup

* always listen

* use stop in restore state again

* whitelist JSON exceptions for later

* review comment

* make zwave tests use mock storage
2020-04-02 10:25:28 -07:00
Chris Talkington
30fd9950e2
Add remote platform to directv (#32790)
* add remote platform to directv.

* Update __init__.py

* Update .coveragerc

* Rename remote py to remote.py

* Update remote.py

* squash.

* Update remote.py

* squash.

* Update remote.py
2020-04-02 10:18:53 -07:00
Paulus Schoutsen
b10319f69e
Convert TTS tests to async (#33517)
* Convert TTS tests to async

* Address comments
2020-04-02 18:55:34 +02:00
Martin Hjelmare
1d2713b0ea
Clarify light reproduce state deprecation warning (#33531) 2020-04-02 09:52:46 -07:00
Erik Montnemery
457d439e24
Fix MQTT cleanup regression from #32184. (#33532) 2020-04-02 09:52:05 -07:00
J. Nick Koston
590e714021
Ensure harmony hub is ready before importing (#33537)
If the harmony hub was not ready for connection or
was busy when importing from yaml, the import validation
would fail would not be retried.

To mitigate this scenario we now do the validation in
async_setup_platform which allows us to raise
PlatformNotReady so we can retry later.
2020-04-02 09:46:10 -07:00
Robert Svensson
314bc07cee
UniFi - Make POE control switches configurable (#32781)
* Allow control whether POE switches are to be created or not

* Fix options flow and test
2020-04-02 17:53:33 +02:00
Maciej Bieniek
5a55d50879
Bump brother to 0.1.11 (#33526) 2020-04-02 13:52:03 +02:00
Paulus Schoutsen
7ae802bb0d
Cloud do checks during setup (#33507)
* Update cloud to do more tasks during async_setup

* Upgrade hass_nabucasa to 0.33
2020-04-01 15:25:04 -07:00
Paulus Schoutsen
aaa1d06809
Directly call async_write_ha_state (#33508)
* Directly call async_write_ha_state

* Address comments

* Fix tests
2020-04-01 14:19:51 -07:00
Erik Montnemery
fbd197146a
Add MQTT debug info for remaining MQTT integrations (#33506) 2020-04-01 11:48:32 -07:00
Eugenio Panadero
71aaf2d809
Add device triggers for Hue remotes (#33476)
* Store device_registry entry id in HueEvent

so it can be retrieved with that key when using device triggers

* Add device_trigger for hue_event from hue remotes

* supporting Hue dimmer switch & Hue Tap
* State mapping and strings are copied from deCONZ

* refactor mock_bridge for hue tests

and also share `setup_bridge_for_sensors`
for test_sensor_base and test_device_trigger.

* Add tests for device triggers with hue remotes

* Remove some triggers
2020-04-01 11:42:22 -07:00
J. Nick Koston
4a32a0f1da
Expand network util to check for link local addresses (#33499) 2020-04-01 11:24:30 -07:00
springstan
0cf9268ca8
Fix invalid directory for dnsmasq files in asuswrt (#33503) 2020-04-01 11:04:44 -07:00
Erik Montnemery
fb93b79b12
Add MQTT debug info (#33461)
* Add MQTT debug info

* Tweaks

* Tweaks
2020-04-01 10:00:40 -07:00
Ziv
4dbbf93af9
Replace asyncio.wait with asyncio.gather since wait ignores exceptions (#33380)
* replace asyncio.wait with asyncio.gather since wait ignores exceptions
fix for test_entity_platform so it expects the exception

* changed to log on failed domains

* discovered that this fix actually removes other uncaught exceptions

* fix in the list of ignored exceptions

* replaced a few ignores on dyson tests that work locally but fail in the CI

* two more tests that are failing on the CI and not locally

* removed assertion on multiple entries with same unique_id - replaced with log and return
reverted test_entity_platform to its original since now there is no exception thrown

* entered all the dyson tests. they all pass locally and probabilistically fail in the CI

* removed unnecessary str() for exception

* added log message for duplicate entity_id / unique_id

* removed log in case of False return value

* added exc_info

* change the use of exc_info
2020-04-01 07:09:13 -07:00
J. Nick Koston
cc443ff37a
Add config flow for nut (#33457)
* Convert nut to config flow

* Add a test for importing

* lint

* Address review items (part 1)

* Address review items (part 1)

* Cleanup unique id handling

* Update tests for new naming scheme

* No unique id, no device_info

* Remove sensor types

* Update tests to use resources that still exist
2020-03-31 19:08:27 -07:00
Chris Talkington
83fb5e5071
Apply recommendations from IPP review (#33477)
* Update test_config_flow.py

* Update test_config_flow.py

* lint.
2020-03-31 16:40:07 -07:00
Kit Klein
955c94e313
allow overriding host api url in config flow (#33481)
* allow overriding host api url in config flow

* fix typo

* capitalize URL
2020-03-31 15:50:37 -07:00
Chris Talkington
b892dbc6ea
Refactor DirecTV Integration to Async (#33114)
* switch to directv==0.1.1

* work on directv async.

* Update const.py

* Update __init__.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update media_player.py

* Update test_config_flow.py

* Update media_player.py

* Update media_player.py

* work on tests and coverage.

* Update __init__.py

* Update __init__.py

* squash.
2020-03-31 15:35:32 -07:00
J. Nick Koston
3566803d2e
Fix setting zone overlays for tados that support swing (#33439)
* Fix setting zone overlays for tados that support swing

* Support for changing swing mode will come at a later
time as another upstream update is required.

* remove debug

* style
2020-03-31 17:29:45 -05:00
J. Nick Koston
a473ae6711
Ignore link local addresses during doorbird ssdp config flow (#33401) 2020-03-31 14:20:29 -07:00
J. Nick Koston
e6ed2f0377
Add version and device type to powerwall device_info (#33453)
* Add version and device type to powerwall device_info

* Upstream powerwall now supports a http_session
2020-03-31 12:55:50 -07:00
Paulus Schoutsen
06216a8a45
Google Assistant: parallize as many requests as possible (#33472)
* Google Assistant: parallize as many requests as possible

* Fix double comment
2020-03-31 12:01:31 -07:00
J. Nick Koston
b783aab41b
Add binary sensor for myq gateway connectivity (#33423) 2020-03-31 11:58:44 -07:00
J. Nick Koston
12b408219e
Improve handling of nuheat switching states (#33410)
* The api reports success before the state change
takes effect

* We now set state optimistically and followup with
an update 4 seconds in the future after any state change to
verify it actually happens.

* When hvac_mode is passed to the set_temperature service
we now switch to the desired mode.
2020-03-31 11:55:13 -07:00
J. Nick Koston
6cafc9aaef
Add humidity support to homekit thermostats (#33367) 2020-03-31 11:45:33 -07:00
Eugenio Panadero
f5cbc9d208
Fire events for hue remote buttons pressed (#33277)
* Add remote platform to hue integration

supporting ZGPSwitch, ZLLSwitch and ZLLRotary switches.

* Ported from custom component Hue-remotes-HASS from @robmarkcole

* Add options flow for hue, to toggle handling of sensors and remotes

* Sensors are enabled by default, and remotes are disabled,
  to not generate any breaking change for existent users.
  Also, when linking a new bridge these defaults are used,
  so unless going explicitly to the Options menu,
  the old behavior is preserved.
* SensorManager stores the enabled platforms and ignores everything else.
* Bridge is created with flags for `add_sensors` and `add_remotes`,
  and uses them to forward entry setup to only the enabled platforms.
* Update listener removes disabled kinds of devices when options are changed,
  so device list is in sync with options, and disabled kinds disappear from HA,
  leaving the enable/disable entity option for individual devices.

* Fix hue bridge mock with new parameters

* Revert changes in hue bridge mock

* Remove OptionsFlow and platform flags

* Extract `GenericHueDevice` from `GenericHueSensor`

to use it as base class for all hue devices, including those without any entity,
like remotes without battery.

* Add `HueBattery` sensor for battery powered remotes

and generate entities for TYPE_ZLL_ROTARY and TYPE_ZLL_SWITCH remotes.

* Remove remote platform

* Add HueEvent class to fire events for button presses

* Use `sensor.lastupdated` string to control state changes
* Event data includes:
  - "id", as pretty name of the remote
  - "unique_id" of the remote device
  - "event", with the raw code of the pressed button
    ('buttonevent' or 'rotaryevent' property)
  - "last_updated", with the bridge timestamp for the button press
* Register ZGP_SWITCH, ZLL_SWITCH, ZLL_ROTARY remotes

* fix removal

* Exclude W0611

* Extract GenericHueDevice to its own module

and solve import tree, also fixing lint in CI

* Store registered events to do not repeat device reg

* Minor cleaning

* Add tests for hue_event and battery entities for hue remotes
2020-03-31 10:27:30 -07:00
Jeff McGehee
dd1608db0d
Best effort state initialization of bayesian binary sensor (#30962)
* Best effort state initialization of bayesian binary sensor.

Why:

* https://github.com/home-assistant/home-assistant/issues/30119

This change addresses the need by:

* Running the main update logic eagerly for each entity being observed
  on `async_added_to_hass`.
* Test of the new behavior.

* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.

* Improve test coverage

Why:

* Because for some reason my commits decreased test coverage.

This change addresses the need by:

* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates

* rebase and ensure upstream tests passed

* Delete commented code from addressing merge conflict.
2020-03-31 10:41:29 -06:00
Eugenio Panadero
f2f03cf552
Fix deconz tests that have uncaught exceptions (#33462) 2020-03-31 11:19:34 -05:00
Eugenio Panadero
977f1a6916
Fix hue tests that have uncaught exceptions (#33443) 2020-03-31 10:17:09 -05:00
Marcel Steinbach
6208d8c911
Add HomeKit support for slat tilting (#33388)
* Add HomeKit support for slat tilting

* Reset tilt-specific attribute, not position attribute

Co-Authored-By: J. Nick Koston <nick@koston.org>

* Add explanation why we fix HomeKit's targets

We have to assume that the device has worse precision than HomeKit. If it
reports back a state that is only _close_ to HK's requested state, we'll
"fix" what HomeKit requested so that it won't appear out of sync.

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-03-30 19:47:03 -05:00
David F. Mulcahey
d0dad4bfd6
Fix uncaught exceptions in ZHA tests (#33442) 2020-03-30 20:34:23 -04:00
Chris Talkington
98f68f4798
Add Internet Printing Protocol (IPP) integration (#32859)
* Create __init__.py

* Create manifest.json

* Update zeroconf.py

* more work on integration

* more work on integration.

* add more sensor tests.

* Update const.py

* Update sensor.py

* more work on ipp.

* Update test_config_flow.py

* more work on ipp.

* Update config_flow.py

* Update config_flow.py
2020-03-30 16:13:47 -07:00
Erik Montnemery
9508c51403
Fix change of entity_id for discovered MQTT entities (#33444) 2020-03-30 14:26:59 -07:00
Bram Kragten
952aa02e37
Add ability to specify group when creating user (#33373)
* Add abbility to specify group when creating user

* Fix tests

* Not default admin and tests
2020-03-30 20:33:43 +02:00
David F. Mulcahey
bcd1eb952c
RFC - Add a 3rd state to the HA shutdown sequence for writing… (#33358)
* add third stage to hass shutdown

* use 3rd stage in storage

* update core state

* add writing data to multi stop ignore

* update core test

* review comment

* update name based on feedback
2020-03-30 10:18:39 -07:00
da-anda
01bf4daf37
Fix detection of zone master in soundtouch media_player (#33157) 2020-03-30 17:27:02 +02:00
Santobert
0186ce7896
Filter the history of device_tracker by location attributes (#33356)
* Add include_location_attributes

* Add check for different state

* Fix things

* Drop filter

* significant changes only

* Change default behavior

* Remove trailing commas
2020-03-30 08:13:22 -07:00
J. Nick Koston
f42804805c
Move Tado zone state handling into upstream python-tado library (#33195)
* Tado climate state moved to python-tado

* Resolve various incorrect states and add tests for known tado zone states

* Write state instead of calling for an update

This is a redux of pr #32564 with all of the zone state now moved into
python-tado and tests added for the various states.

* stale string

* add missing undos to dispachers

* remove unneeded hass

* naming

* rearrange

* fix water heater, add test

* fix water heater, add test

* switch hvac mode when changing temp if in auto/off/smart
2020-03-30 09:06:26 -05:00
Kit Klein
0e6b905cdf
Add konnected multi output (#33412)
* add test to for importing multiple output settings

* provide option to set multiple output states

* tweaks after testing

* Update homeassistant/components/konnected/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-29 20:05:59 -07:00
Malte Franken
de54659097
Fix GeoNet NZ Quakes tests (#33383)
* enable tests

* only remove entity if exists
2020-03-29 22:40:09 +02:00
SukramJ
1cd0e764b6
Use new HMIP labels for HomematicIP Cloud multi devices (#32925)
* Use new labels for HomematicIP Cloud multi devices

* Update homeassistant/components/homematicip_cloud/device.py

Co-Authored-By: springstan <46536646+springstan@users.noreply.github.com>

* Update name composition

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-29 21:38:59 +02:00
jan iversen
dd3cd95954
Modbus patch, to allow communication with "slow" equipment using tcp (#32557)
* modbus: bumb pymodbus version to 2.3.0

pymodbus version 1.5.2 did not support asyncio, and in general
the async handling have been improved a lot in version 2.3.0.

updated core/requirement*txt

* updated core/CODEOWNERS

committing result of 'python3 -m script.hassfest'.

* modbus: change core connection to async

change setup() --> async_setup and update() --> async_update()

Use async_setup_platform() to complete the async connection to core.

listen for EVENT_HOMEASSISTANT_START happens in async_setup()
so it needs to be async_listen.

But listen for EVENT_HOMEASSISTANT_STOP happens in start_modbus()
which is a sync. function so it continues to be listen().

* modbus: move setup of pymodbus into modbushub

setup of pymodbus is logically connected to the class modbushub,
therefore move it into the class.

Delay construction of pymodbus client until event
EVENT_HOMEASSISTANT_START arrives.

* modbus: use pymodbus async library

convert pymodbus calls to refer to the async library.

Remark: connect() is no longer needed, it is done when constructing
the client. There are also automatic reconnect.

* modbus: use async update for read/write

Use async functions for read/write from pymodbus.

change thread.Lock() to asyncio.Lock()

* Modbus: patch for slow tcp equipment

When connecting, via Modbus-TCP, so some equipment (like the
huawei sun2000 inverter), they need time to prepare the protocol.

Solution is to add a asyncio.sleep(x) after the connect() and before
sending the first message.

Add optional parameter "delay" to Modbus configuration.
Default is 0, which means do not execute asyncio.sleep().

* Modbus: silence pylint false positive

pylint does not accept that a class construction __new__
can return a tuple.

* Modbus: move constants to const.py

Create const.py with constants only used in
the modbus integration.

Duplicate entries are removed, but NOT any entry that would
lead to a configuration change.

Some entries were the same but with different names, in this
case renaming is done.

Also correct the tests.

* Modbus: move connection error handling to ModbusHub

Connection error handling depends on the hub, not the
entity, therefore it is logical to have the handling in
ModbusHub.

All pymodbus call are added to 2 generic functions (read/write)
in order not to duplicate the error handling code.

Added property "available" to signal if the hub is connected.

* Modbus: CI cleanup

Solve CI problems.

* Modbus: remove close of client

close() no longer exist in the pymodbus library, use
del client instead.

* Modbus: correct review comments

Adjust code based on review comments.

* Modbus: remove twister dependency

Pymodbus in asyncio mode do not use twister but still throws a
warning if twister is not installed, this warning goes into
homeassistant.log and can thus cause confusion among users.

However installing twister just to avoid the warning is not
the best solution, therefore removing dependency on twister.

* Modbus: review, remove comments.

remove commented out code.
2020-03-29 12:39:30 -05:00
David F. Mulcahey
188ca630de
Miscellaneous ZHA code cleanup (#33395)
* cleanup state change listener

* update group id handling and unique id

* update test

* add guards for last_seen updates
2020-03-29 13:26:48 -04:00
jjlawren
ffafcf27a8
plexwebsocket bump 0.0.7 to fix ignored tests (#33398)
* Bump plexwebsocket to 0.0.7

* Remove unnecessary test ignores
2020-03-29 12:14:42 -04:00
jjlawren
312af53935
Handle Plex certificate updates (#33230)
* Handle Plex certificate updates

* Use exception in place

* Add test
2020-03-28 21:02:29 -07:00
SukramJ
3c2df7f8f2
Fix homematicip_cloud tests that have uncaught exceptions (#33371) 2020-03-28 21:01:53 -07:00
David F. Mulcahey
f7ae78f78e
Update ZHA group entity when Zigbee group membership changes (#33378)
* cleanup group entities

* add test

* appease pylint

* fix order
2020-03-28 20:38:48 -04:00
Ziv
dd232a3507
Fix uncaught exceptions in dynalite (#33374) 2020-03-28 22:19:43 +01:00
Malte Franken
c08ca8a439
Fix GDACS tests (#33357)
* enable tests

* only remove entity if exists
2020-03-28 21:18:15 +01:00
shred86
bf16b50679
Fix Abode tests uncaught exceptions (#33365) 2020-03-28 18:54:07 +01:00
J. Nick Koston
5a1b0edd96
Add inline comments to elkm1 about how config is updated from… (#33361) 2020-03-28 17:23:39 +01:00
Bram Kragten
1477087c71
Fix Lovelace resources health info (#33309)
* Fix Lovelace resources health info

* Fix tests
2020-03-28 13:57:36 +01:00
Ziv
ff391e538a
Fail tests with uncaught exceptions (#33312)
* initial implementation and ignore file

* updated ignore list for the tests in the most recent dev branch
2020-03-27 21:36:06 -07:00
ochlocracy
28a2c9c653
Implement Alexa.CameraStreamController in Alexa (#32772)
* Implement Alexa.CameraStreamController.

* Add dependencies.

* Add camera helpers for image url, and mjpeg url.

* Remove unsupported AlexaPowerController from cameras.

* Refactor camera_stream_url to hass_url

* Declare HLS instead of RTSP.

* Add test for async_get_image_url() and async_get_mpeg_stream_url().

* Sort imports.

* Fix camera.options to camera.stream_options. (#32767)


(cherry picked from commit 9af95e8577)

* Remove URL configuration option for AlexaCameraStreamController.

* Update test_initialize_camera_stream.

* Optimize camera stream configuration.

* Update Tests for optimized camera stream configuration.

* Sort imports.

* Add check for Stream integration.

* Checks and Balances.

* Remove unnecessary camera helpers.

* Return None instead of empty list for camera_stream_configurations().
2020-03-27 21:19:11 -07:00
J. Nick Koston
369ffe2288
Fix setting HomeKit temperatures with imperial units (#33315)
In PR#24804 the step size was changed to match the step size
of the device that HomeKit is controlling. Since HomeKit
is always working in TEMP_CELSIUS and the step size is based on
the Home Assistant units setting, we were mixing data with different
units of measure when Home Assistant was using imperial units.

This regression presented the symptom that setting the
temperature to 73F would result in 74F.  Other values are affected
where the math doesn't happen to work out.

HomeKit currently has a default of 0.1 in the spec and the override
of this value has been removed.
2020-03-27 21:02:51 -07:00
J. Nick Koston
18a4829314
Config flow for elkm1 (#33297)
* Config flow for elkm1

* As entity ids can now be changed, the “alarm_control_panel”
attribute “changed_by_entity_id” is now “changed_by_keypad”
and will show the name of the Elk keypad instead of the entity id.

* An auto configure mode has been introduced which avoids the
need to setup the complex include and exclude filters.  This
functionality still exists when configuring from yaml for power
users who want more control over which entities elkm1 generates.

* restore _has_all_unique_prefixes

* preserve legacy behavior of creating alarm_control_panels that have no linked keypads when auto_configure is False

* unroll loop
2020-03-27 15:38:35 -05:00
Paulus Schoutsen
73c52e668e
Fix dispatcher logging (#33299) 2020-03-26 20:44:44 -07:00
David F. Mulcahey
4f767dd3ef
Add entities for ZHA fan groups (#33291)
* start of fan groups

* update fan classes

* update group entity domains

* add set speed

* update discovery for multiple entities for groups

* add fan group entity tests

* cleanup const

* cleanup entity_domain usage

* remove bad super call

* remove bad update line

* fix set speed on fan group

* change comparison

* pythonic list

* discovery guards

* Update homeassistant/components/zha/core/discovery.py

Co-Authored-By: Alexei Chetroi <lexoid@gmail.com>

Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-03-26 22:19:48 -04:00
Bram Kragten
a6d5ed0160
Add support for dashboards to lovelace cast service (#32913) 2020-03-26 16:23:46 -07:00
J. Nick Koston
f93e4e3de7
Support homekit matches that have a dash after the model (#33274) 2020-03-26 15:15:35 -07:00
J. Nick Koston
f5a6c3484d
Abort rachio homekit config when one is already setup (#33285)
* Abort rachio homekit config when one is already setup.

We can see rachio on the network to tell them to configure
it, but since the device will not give up the account it is
bound to and there can be multiple rachio controllers on a single
account, we avoid showing the device as discovered once
they already have one configured as they can always
add a new one via "+"

* doc string freshness

* doc string freshness

* Update tests/components/rachio/test_config_flow.py

Co-Authored-By: Franck Nijhof <git@frenck.dev>

Co-authored-by: Franck Nijhof <git@frenck.dev>
2020-03-26 17:14:52 -05:00
J. Nick Koston
b8afb9277a
Bump nexia to 0.7.2 (#33292)
* Bump nexia to 0.7.2

* Fixes zones on the same thermostat showing as active
when the damper was closed.

* Update test for nexia 0.7.2
2020-03-26 15:14:35 -07:00
Malte Franken
a38db1f677
Fix GDACS integration to remove stale entities from entity registry (#33283)
* remove entities from entity registry

* added test for removing entities from entity registry
2020-03-26 19:05:48 +01:00
David F. Mulcahey
eb8e8d00a6
Add group entities for ZHA switches (#33207) 2020-03-25 13:29:40 -04:00
Raman Gupta
d5f4dfdd6b
Update vizio app_id state attribute to show app config dict in… (#32727)
* bump pyvizio and update app_id to show app config to aid in HA config generation. squashed from multiple commits to make a rebase on dev easier

* bump pyvizio for bug fixes

* fix pyvizio version number

* only return app_id if app is unknown and explicitly create the dict that's returned

* fix tests

* fix docstring for app_id
2020-03-25 09:35:36 -07:00
David F. Mulcahey
2a3c94bad0
Add group entity support to ZHA (#33196)
* split entity into base and entity

* add initial light group support

* add dispatching of groups to light

* added zha group object

* add group event listener

* add and remove group members

* get group by name

* fix rebase

* fix rebase

* use group_id for unique_id

* get entities from registry

* use group name

* update entity domain

* update zha storage to handle groups

* dispatch group entities

* update light group

* fix group remove and dispatch light group entities

* allow picking the domain for group entities

* beginning - auto determine entity domain

* move methods to helpers so they can be shared

* fix rebase

* remove double init groups... again

* cleanup startup

* use asyncio create task

* group entity discovery

* add logging and fix group name

* add logging and update group after probe if needed

* test add group via gateway

* add method to get group entity ids

* update storage

* test get group by name

* update storage on remove

* test group with single member

* add light group tests

* test some light group logic

* type hints

* fix tests and cleanup

* revert init changes except for create task

* remove group entity domain changing for now

* add missing import

* tricky code saving

* review comments

* clean up class defs

* cleanup

* fix rebase because I cant read

* make pylint happy
2020-03-25 07:23:54 -04:00
J. Nick Koston
2a36adae46
Abort myq homekit config when one is already setup. (#33218)
We can see myq on the network to tell them to configure
it, but since the device will not give up the account it is
bound to and there can be multiple myq gateways on a single
account, we avoid showing the device as discovered once
they already have one configured as they can always
add a new one via "+"
2020-03-24 17:09:24 -07:00
Patryk
ad9f4db983
Add leak sensor support to Homekit integration (#33171)
* Add leak sensor support to Homekit integration

* Add leak entries to binary_sensor/strings.json

* Revert changes from binary_sensor

* Fix

* Review fix
2020-03-24 13:49:01 -07:00
Aaron Bach
0e2fa7700d
Allow more than one AirVisual config entry with the same API k… (#33072)
* Allow more than one AirVisual config entry with the same API key

* Add tests

* Correctly pop geography

* Code review

* Code review
2020-03-24 11:39:38 -07:00
Eugenio Panadero
fb22f6c301
Add Context support for async_entity removal (#33209)
* Add Context for async_remove

* Check context in state automation on entity removal
2020-03-24 09:59:17 -07:00
On Freund
b50281a917
Options flow for Monoprice sources (#33156)
* Options flow for monoprice sources

* Fix lint errors
2020-03-23 17:32:21 -07:00
Oxan van Leeuwen
6180f7bd64
Fix Google Assistant temperature control for entity without mo… (#33107) 2020-03-23 16:57:26 -07:00
elmurato
45241e57ca
Add support for Minecraft SRV records (#32372)
* Added support for Minecraft SRV records

* Switched from dnspython to aiodns, improved server ping and log messages, use address instead of host and port in config flow

* Updated component requirements
2020-03-23 16:51:13 -07:00
Eugenio Panadero
cd57b764ce
Fix state_automation_listener when new state is None (#32985)
* Fix state_automation_listener when new state is None (fix #32984)

* Listen to EVENT_STATE_CHANGED instead of using async_track_state_change

and use the event context on automation trigger.

* Share `process_state_match` with helpers/event

* Add test for state change automation on entity removal
2020-03-23 16:05:21 -07:00
Eugenio Panadero
c2a9aba467
Minor changes for new pvpc_hourly_pricing integration (#33177)
* Use async_call_later for retrying, instead of async_track_point_in_time
* Normalize test filename renaming it to `test_sensor`
* Remove link to docs in docstring
* Adjust test results to new behavior with async_call_later
2020-03-23 22:45:04 +01:00
Franck Nijhof
513abcb7e5
Add effect service to WLED integration (#33026)
* Add effect service to WLED integration

* Inline service schema
2020-03-23 13:21:35 -07:00
Paulus Schoutsen
1ff245d9c2
Make sure entity platform services work for all platforms of d… (#33176)
* Make sure entity platform services work for all platforms of domain

* Register a bad service handler

* Fix cleaning up

* Tiny cleanup
2020-03-23 12:59:36 -07:00
J. Nick Koston
2360fd4141
Switch legacy calls to init_recorder_component using async_add… (#33185) 2020-03-23 11:27:45 -07:00
Alexei Chetroi
bf4b099f11
Update sw_version in device registry for ZHA devices (#33184)
* Update firmware version in device registry.
Parse recevied OTA requests for firmware version and update device
registry.

* Update tests.
* Cleanup sw_id_update listener.
* Update ZHA test devices list.
2020-03-23 12:42:41 -04:00
J. Nick Koston
b8fdebd05c
Add aircleaner and humidify service to nexia climate (#33078)
* Add aircleaner and humidify service to nexia climate

* These were removed from the original merge to reduce review scope

* Additional tests for binary_sensor, sensor, and climate states

* Switch to signals for services

Get rid of everywhere we call device and change to zone or thermostat
as it was too confusing

Renames to make it clear that zone and thermostat are tightly coupled

* Make scene activation responsive

* no need to use update for only one key/value

* stray comma

* use async_call_later

* its async, need ()s

* cleaner

* merge entity platform services testing branch
2020-03-23 11:01:48 -05:00
J. Nick Koston
f9a7c64106
Config flow for doorbird (#33165)
* Config flow for doorbird

* Discoverable via zeroconf

* Fix zeroconf test

* add missing return

* Add a test for legacy over ride url (will go away when refactored to cloud hooks)

* Update homeassistant/components/doorbird/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* without getting the hooks its not so useful

* Update homeassistant/components/doorbird/config_flow.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix copy pasta

* remove identifiers since its in connections

* self review fixes

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-23 10:14:21 +01:00
J. Nick Koston
b09a9fc81a
Add config flow for Nuheat (#32885)
* Modernize nuheat for new climate platform

* Home Assistant state now mirrors the
  state displayed at mynewheat.com

* Remove off mode as the device does not implement
  and setting was not implemented anyways

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

* Presets now map to the open api spec
  published at https://api.mynuheat.com/swagger/

* ThermostatModel: scheduleMode

* Revert test cleanup as it leaves files behind.

Its going to be more invasive to modernize the tests so
it will have to come in a new pr

* Config flow for nuheat

* codeowners

* Add an import test as well

* remove debug
2020-03-23 00:29:45 -05:00
J. Nick Koston
0b2a8bf79a
Make harmony handle IP address changes (#33173)
If the IP address of the harmony hub changed it would
not be rediscovered.  We now connect to get the
unique id and then update config entries with
the correct ip if it is already setup.
2020-03-22 21:24:49 -07:00
Alan Tse
087b672449
Add enable_wake_on_start option to Tesla (#33035) 2020-03-22 22:33:55 -05:00
Eugenio Panadero
8d2e72cdf6
Add pvpc electricity prices integration (#32092)
* Add new integration: pvpc_hourly_pricing

to add a sensor with the current hourly price of electricity in Spain.
Configuration is done by selecting one of the 3 reference tariffs, with
1, 2, or 3 billing periods.

* Features config flow, entity registry, RestoreEntity, options flow
  to change tariff, manual yaml config as integration or sensor platform
* Cloud polling sensor with minimal API calls (3/hour at random times)
  and smart retry; fully async
* Only 1 state change / hour (only when the price changes)
* At evening, try to download published tomorrow prices, to always store
  prices info for a window of [3, 27] hours in the future.
* Include useful state attributes to program automations to be run
  at best electric prices.
* Add spanish and english translations.

* Requires `xmltodict` to parse official xml file with hourly prices
for each day.

* Update requirements and add to codeowners

* Avoid passing in hass as a parameter to the entity

Instead, create time change listeners in async_added_to_hass and
call async_generate_entity_id before async_add_entities

* Fix lint issues

* Add tests for config & options flow

* Add tests for manual yaml config

with entity definition as integration and also as a sensor platform

* Fix placement of PLATFORM_SCHEMA and update generated config_flows

* Store prices internally linked to UTC timestamps

- to deal with days with DST changes
- and work with different local timezones

* Add availability to sensor

to 'expire' the sensor if there is no connection available
 and current hour is not in the stored prices.

Also, turn off logging and retrying if prices can't be downloaded
repeatedly, by flagging `data_source_available` as False, so there is no
log-flood mess.

* Add more tests

- to cover behavior in DST changes and complete coverage of sensor logic
- to cover abort config flow

* fix linter

* Better handling of sensor availability and minor enhancements

- Emmit 1 error if data source is marked as unavailable
  (after some retries), and be silent until cloud access is recovered,
  then emmit 1 warning.
- Follow standard of camel_case keys in attributes

* Mock aiosession to not access real API, store fixture data

- Store a set of daily xml files to test sensor logic for all situations
- Mock time and session to run tests with stored API responses
- Add availability test to simulate a lost + recovery of cloud access,
  checking that logging is reasonable: 1 error to flag the continued
  disconnection + 1 warning in recovery.

* Change API endpoint to retrieve JSON data

and remove xmltodict from reqs.

It seems that this endpoint is more reliable than the XML.

* Adapt tests to new API endpoint

* Translate tariff labels to plain English

and sync the default timeout value for all ways of configuration.

* Relax logging levels to meet silver requirements

- 1 warning when becoming unavailable, another warning when recovered.
- Warnings for unexpected TimeoutError or ClientError
- Move the rest to debug level, leaving info for HA internals

Also reduce number of API calls from 3 to 2 calls/hour.

* Fix requirements

* Mod tests to work with timezone Atlantic/Canary

and fix state attributes for timezones != reference, by using 3 price
prefixes: 'price_last_day_XXh', 'price_next_day_XXh' and 'price_XXh',
all generated with local time (backend timezone)

* Try to fix CI tests

* Externalize pvpc data and simplify sensor.py

* add new `aiopvpc` to requirements
* Remove data parsing and price logic from here
* Replace some constant properties with class variables

* Simplify tests for pvpc_hourly_pricing

* Fix updater for options flow

* Updater always reloads
* `tariff` value comes 1st from entry.options, 2nd from entry.data

* Fix lint

* Bump aiopvpc

* Remove options flow and platform setup

- Remove PLATFORM_SCHEMA and async_setup_platform
- Generate config_entry.unique_id with tariff instead of entity_id, in flow step.
- Remove TariffSelectorConfigFlow
- Adapt tests to maintain full coverage

* Fix docstring on test

and rename SENSOR_SCHEMA to SINGLE_SENSOR_SCHEMA to avoid confusion

* Remove timeout manual config, fix entry.options usage, simplify unique_id

* Simplify tests

- No need for a test_setup now, as platform setup is removed and integration
  setup is already used in `test_availability`
- Simplified `_process_time_step`: only one async_fire(EVENT_TIME_CHANGED)/hour

* Fix possible duplicated update

when source is not available.

* Do not access State last_changed for log messages

* Do not update until entity is added to hass

and call to async_update after 1st download or when recovering access, so
async_write_ha_state is not called twice on those.

* minor changes

* Rename method to select current price and make it a callback
2020-03-22 14:25:31 -05:00
Raman Gupta
ca3a22b5a3
Filter out duplicate app names from vizio's source list (#33051)
* filter out additional app config names from pyvizios app list

* add test

* change where filtering app list occurs

* fix test

* fix mistake in change

* hopefully final test fix

* fix test scenario that unknowingly broke with test change
2020-03-22 17:34:00 +01:00
Austin Mroczek
c79b3df73f
Handle generic_thermostat state unavailable (#32852)
* fix sensor unavailable error

* fix climate.py
2020-03-22 09:35:58 -05:00
Paulus Schoutsen
f95c3e265d
Fix script logging with name (#33120) 2020-03-22 13:29:50 +01:00
On Freund
66402b9b38
Monoprice PR followups (#33133) 2020-03-22 13:25:27 +01:00
On Freund
e8bd1b9216
Config Flow and Entity registry support for Monoprice (#30337)
* Entity registry support for monoprice

* Add test for unique_id

* Add unique id namespace to monoprice

* Config Flow for Monoprice

* Update monoprice tests

* Remove TODOs

* Handle entity unloading

* Fix update test

* Streamline entity handling in monoprice services

* Increase coverage

* Remove devices cache

* Async validation in monoprice config flow
2020-03-21 18:12:32 -07:00
guillempages
99d732b974
Revert "Validate UUID for tankerkoenig (#32805)" (#33123)
This reverts commit 49c2a4a4e3.
The validation was causing more problems than it was fixing, so removed
it completely
2020-03-21 17:48:18 -07:00
Alexei Chetroi
991afccbd4
Refactor ZHA EventChannels (#32709)
* Refactor EventChannels.

* Rename EventRelayChannel.

* Fully rename EventRelayChannel.

- update docstrings
- rename all references from "relay" to "client"

* Remove CHANNEL_NAME.

* Update stale docstring.
2020-03-21 19:59:32 -04:00
Franck Nijhof
6d4fa76107
Add Wi-Fi sensors to WLED integration (#33055) 2020-03-21 15:14:41 -07:00
escoand
2bb29485be
Try all Samsung TV websocket ports (#33001)
* Update bridge.py

* add test

* silence pylint

* correct pylint

* add some tests

* Update test_media_player.py
2020-03-21 16:50:18 +01:00
guillempages
49c2a4a4e3
Validate UUID for tankerkoenig (#32805)
* Validate UUIDs against custom validator

Instead of just validating against strings, use a custom validator,
so that the format can be checked.

* Add tests for custom UUID4 validator
2020-03-21 09:43:12 -05:00
Ville Skyttä
ffc9bcb4d7
Use PEP 526 syntax with NamedTuples (#33081) 2020-03-21 11:18:32 +02:00
Paulus Schoutsen
b6d9454b54
Fix package default extraction (#33071) 2020-03-20 20:27:37 -07:00
J. Nick Koston
85328399e0
Add support for nexia automations (#33049)
* Add support for nexia automations

Bump nexia to 0.7.1

Start adding tests

Fix some of the climate attributes that were wrong (discovered while adding tests)

Pass the name of the instance so the nexia UI does not display "My Mobile"

* fix mocking

* faster asserts, scene

* scene makes so much more sense

* pylint

* Update homeassistant/components/nexia/scene.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* docstring cleanup

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-20 18:49:42 -05:00
Paulus Schoutsen
d16d44d3e7
Add negative tests for identify schema for packages (#33050) 2020-03-20 13:34:56 -07:00
J. Nick Koston
37687561c0
Add config flow for myq (#32890)
* Add a config flow for myq

* Discovered by homekit

* Fix gates being treated as garage doors

* Offline devices now show as unavailable

* Homekit flow

* strip out icon

* return -> raise
2020-03-20 15:28:14 -05:00
J. Nick Koston
92d373055f
Modernize nuheat for new climate platform (#32714)
* Modernize nuheat for new climate platform

* Home Assistant state now mirrors the
  state displayed at mynewheat.com

* Remove off mode as the device does not implement
  and setting was not implemented anyways

* Implement missing set_hvac_mode for nuheat

* Now shows as unavailable when offline

* Add a unique id (serial number)

* Fix hvac_mode as it was really implementing hvac_action

* Presets now map to the open api spec
  published at https://api.mynuheat.com/swagger/

* ThermostatModel: scheduleMode

* Empty commit to re-run ci

* Revert test cleanup as it leaves files behind.

Its going to be more invasive to modernize the tests so
it will have to come in a new pr
2020-03-20 11:01:51 -07:00
cgtobi
eb77b94315
Fix netatmo webhook registration issue (#32994)
* Wait for cloud connection

* Just wait

* Remove redundant entry

* Drop webhook before unloading other platforms

* Add missing scope

* Update homeassistant/components/netatmo/__init__.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Fix test

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-20 15:22:27 +01:00
Maciej Bieniek
3461f3a1ed
Tests improvements to the Brother integration (#32982)
* Add tests for states of the sensors

* Revert async_update method

* Tests improvement

* Fix icon name

* Tests improvement

* Simplify tests

* Test improvement

* Patch the library instead of the coordinator

* Suggested change

* Remove return_value
2020-03-20 10:21:43 +01:00
Aaron Bach
d8e3e9abaa
Fix RainMachine not properly storing data in the config entry (#33002)
* Fix bug related to RainMachine's default config flow

* A

* Fix tests

* Code review
2020-03-19 20:54:41 -07:00
Paulus Schoutsen
c3c5cc9ae7
Fix zones in packages (#33027) 2020-03-19 20:45:26 -07:00
J. Nick Koston
5db1a67c20
Make powerwall unique id stable (#33021)
* Update powerwall unique id

* Fix somfy optimistic mode when missing in conf (#32995)

* Fix optimistic mode when missing in conf #32971

* Ease code using a default value

* Client id and secret are now inclusive

* Bump aiohomekit to fix Insignia NS-CH1XGO8 and Lennox S30 (#33014)

* Axis - Fix char in stream url (#33004)

* An unwanted character had found its way into a stream string, reverting f-string work to remove duplication of code and improve readability

* Fix failing tests

* deCONZ - Add support for Senic and Gira Friends of Hue remote… (#33022)

* Update the test

* Harmony config flow improvements (#33018)

* Harmony config flow improvements

* Address followup review comments from #32919

* pylint -- catching my naming error

* remove leftovers from refactor

* Update powerwall unique id

* Update the test

Co-authored-by: tetienne <thibaut@etienne.pw>
Co-authored-by: Jc2k <john.carr@unrouted.co.uk>
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2020-03-19 20:43:09 -07:00
Alexei Chetroi
8cb1d630c8
Poll Hue lights in ZHA (#33017)
* Weighted ZHA entity matching.
* Poll ZHA Hue lights in 5 min intervals.
* Add comment.
* Spelling.
2020-03-19 22:14:07 -04:00
J. Nick Koston
f275b7e5ed
Add Nexia thermostat support (Trane / American Standard) (#32826)
* Merge nexia

* Restore original work

* Merge cleanups

* config flow

* Add config flow

* Add missing files

* Fix import of old yaml config

* More cleanups from self review

* Additional self review

* Update homeassistant/components/nexia/services.yaml

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* fix io in event loop

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* avoid using ternary statements if they span multiple

* Cleanup strings and remove unneeded attributes

* more cleanup

* more cleanup of yaml

* remove coordinator boiler plate

* nuke services for now for the inital pr, add back later

* remove copy pasta

* this can be reduced more

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* review

* comments

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/nexia/climate.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* more review adjustments

* nuke unused constants

* Update homeassistant/components/nexia/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* map states

* add update

* zone id is unique

* Fix humidfy check

* target_humidity should be a property instead of in attributes

* remove aux heat as its already there

Co-authored-by: Ryan Nazaretian <ryannazaretian@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 21:03:51 -05:00
J. Nick Koston
c9592c1447
Harmony config flow improvements (#33018)
* Harmony config flow improvements

* Address followup review comments from #32919

* pylint -- catching my naming error

* remove leftovers from refactor
2020-03-19 20:43:44 -05:00
J. Nick Koston
d33a3ca90f
Config flow for harmony (#32919)
* Config flow for harmony

* Fixes unique ids when using XMPP

Co-authored-by: Bram Kragten <mail@bramkragten.nl>

* Find the unique id for the config flow

* move shutdown to init

* Add test for ssdp (still failing)

* Fix ssdp test

* Add harmony to MIGRATED_SERVICE_HANDLERS (this is a breaking change)

* more cleanups

* use unique id for the config file

Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-03-19 11:29:51 -05:00
J. Nick Koston
5b4d2aed64
Add Powerwalls integration (#32851)
* Create an integration for Powerwalls

* Self review :: remove unused code

* Remove debug

* Update homeassistant/components/powerwall/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* _call_site_info to module level

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update tests/components/powerwall/test_binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/binary_sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* remove sensors that I added tests for from the comment

* Update homeassistant/components/powerwall/config_flow.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/powerwall/sensor.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Switch to UNIT_PERCENTAGE

* reduce code

* Add test for import

* Adjust tests

* Add missing file

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-19 10:50:17 -05:00
MatthewFlamm
445ef861c0
Add pending to template alarm (#31614) 2020-03-19 02:38:24 -05:00
Erik Montnemery
e0d2e5dcb0
Remove deprecated features from MQTT platforms (#32909)
* Remove deprecated features

* Lint
2020-03-18 22:39:15 -07:00
Paulus Schoutsen
5c1dc60505 Fix mobile app test 2020-03-18 22:13:37 -07:00
Paulus Schoutsen
5123baba3f
Fix zone config (#32963)
* Fix zone config

* Add zone as dependency again to device tracker

* Fix tests
2020-03-18 18:14:25 -07:00
Jc2k
34e44e7f3a
Add support for homekit valve accessories to homekit_controller (#32937) 2020-03-18 21:20:40 +00:00
Franck Nijhof
4517f0d59a
Handle unique WLED device using zeroconf properties (#32897) 2020-03-18 11:10:40 +01:00
Maciej Bieniek
c1ceab09e5
Migrate Brother to use DataUpdateCoordinator (#32800)
* Use DataCoordinator to update Brother data

* Simplify error text

* Improve tests

* Rename DEFAULT_SCAN_INTERVAL to SCAN_INTERVAL

* Add entity_registry_enabled_default property

* Add quality_scale to manifest.json file

* Remove misleading coordinator.data.data
2020-03-17 22:21:56 -05:00
Paulus Schoutsen
82c8f18bc7
Fix hassio panel load (#32922)
* Fix loading hassio panel

* Remove blacklist
2020-03-17 17:54:57 -07:00
Erik Montnemery
505de3dce3
Add attributes and availability to MQTT camera (#32908) 2020-03-17 16:49:50 -07:00
Erik Montnemery
52a4c16980
Improve MQTT light test coverage (#32907) 2020-03-17 18:29:12 -05:00
Chris Talkington
9146f76b01
Apply recommendations from roku code review (#32883)
* avoid patching integration methods

* Update config_flow.py

* apply recommendations from roku code review

* Update config_flow.py
2020-03-17 21:15:41 +01:00
Franck Nijhof
aece76f6cd
Bump wled 0.3.0, reduce calls stability improvements (#32903) 2020-03-17 20:17:59 +01:00
Paulus Schoutsen
7bbffa6e6d
Blacklist auto_backup (#32912)
* Blacklist auto_backup

* Mock with a set
2020-03-17 12:14:17 -07:00
Paulus Schoutsen
abd1909e2b
Make zone dependency of device tracker an after dep (#32880)
* Make zone dependency of device tracker an after dep

* Fix test
2020-03-17 06:59:39 -04:00
Erik Montnemery
86d48c608e
Deduplicate MQTT tests (#32874) 2020-03-17 02:09:19 -05:00
Kevin Eifinger
2cda7bf1e7
Add Here travel time arrival departure (#29909)
* here_travel_time: Add modes arrival and departure

* convert arrival/departure from datetime to time

* Default departure is set by external lib on None

* Use cv.key_value_schemas
2020-03-16 21:16:49 -07:00
springstan
51b9afe3c1
Add device condition for alarm_control_panel (#29063)
* Initial commit

* Restricting conditions by supported_features, drop pending condition

* Added tests for no and minimum amount of conditions

* Address review comments

* Sort impors with isort

* Sort impors with isort v2
2020-03-16 18:08:06 -05:00
Bram Kragten
2f1824774f
Lovelace: storage key based on id instead of url_path (#32873)
* Fix storage key based on url_path

* Fix test
2020-03-16 20:08:00 +01:00
Paulus Schoutsen
999c5443c1
Fix abode test (#32871) 2020-03-16 10:03:44 -07:00
Knapoc
7ec7306ea8
Update deconz/cover.py to adapt rest-api changes (#32351)
* Update cover.py to adapt rest-api changes

* adjust test to reflect max brightness changes

* implement test for rest-api cover position of 255
2020-03-16 15:44:59 +01:00
Robert Svensson
fa63dc1e25
UniFi - Improve expected SSID filter behavior (#32785)
* Improve expected ssid filter behavior

* Fix tests
2020-03-16 12:10:45 +01:00
Jason Lachowsky
77b3f31e9b
Corrected minor misspellings (#32857) 2020-03-16 11:58:12 +01:00
Chris Talkington
cf8dfdae47
Add config flow to roku (#31988)
* create a dedicated const.py

* add DEFAULT_PORT to const.py

* work on config flow conversion.

* remove discovery.

* work on config flow and add tests. other cleanup.

* work on config flow and add tests. other cleanup.

* add quality scale to manifest.

* work on config flow and add tests. other cleanup.

* review tweaks.

* Update manifest.json

* catch more specific errors

* catch more errors.

* impprt specific exceptions

* import specific exceptions

* Update __init__.py

* Update config_flow.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update media_player.py

* Update remote.py

* Update config_flow.py

* Update config_flow.py

* Update media_player.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Update test_config_flow.py

* Update config_flow.py

* Update __init__.py

* Update test_config_flow.py

* Update remote.py

* Update test_init.py

* Update test_init.py

* Update media_player.py

* Update media_player.py

* Update media_player.py
2020-03-15 21:13:04 -07:00
shred86
d36259f067
Add Abode tests (#32562)
* Add tests for several devices

* Update coveragerc

* Code review changes and minor clean up

* More code review changes

* Update manifest and minor test updates

* Add test for locks and covers

* Add tests for switch on and off

* Add more complete test for alarms

* Fix for camera test

* Patch abodepy.mode for tests

* Add test for unknown alarm state and minor cleanup

* Update to make tests more robust

* More specific tests

* Update quality scale to silver

* Remove integration quality scale
2020-03-16 03:05:10 +01:00
Kit Klein
ef54f33af7
Ignore the ignored konnected config entries (#32845)
* ignore the ignored konnected config entries

* key off data instead of source
2020-03-16 01:11:26 +01:00
Paulus Schoutsen
2889067ece
Make sure panel_custom won't crash on invalid data (#32835)
* Make sure panel_custom won't crash on invalid data

* Add a test
2020-03-15 11:51:02 -07:00
Bram Kragten
f4bf66aecd
Require a hyphen in lovelace dashboard url (#32816)
* Require a hyphen in lovelace dashboard url

* Keep storage dashboards working

* register during startup again

* Update homeassistant/components/lovelace/dashboard.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Comments

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-03-15 11:50:23 -07:00
SukramJ
2f80489428
Add SF transition to HmIP-BSL and remove obsolete code in HMIPC (#32833) 2020-03-15 19:01:50 +01:00