1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00
Commit Graph

20345 Commits

Author SHA1 Message Date
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
Ron Klinkien
774b1d1663
Enable KNX tunnel auto_reconnect by default (#33387)
* Added tunnel reconnect functionality

* Code improvements

* Update homeassistant/components/knx/__init__.py

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

* Enable auto_reconnect for tunnels by default

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-04-01 00:22:20 +02:00
J. Nick Koston
90dd796644
Prepare rachio for cloudhooks conversion (#33422)
Reorganize code in order to prepare for webhooks
2020-03-31 14:46:30 -07:00
J. Nick Koston
a473ae6711
Ignore link local addresses during doorbird ssdp config flow (#33401) 2020-03-31 14:20:29 -07:00
Chris Caron
be99f3bf32
Bumped Apprise version to v0.8.5 (#33473) 2020-03-31 22:30:27 +02:00
Raman Gupta
5047635224
update VIZIO name to match brand guidelines (#33465) 2020-03-31 22:28:08 +02: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
f085a0c54a
Retry sense setup later if listing devices times out. (#33455) 2020-03-31 11:59:03 -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
Bram Kragten
ffefdcfe22
Require admin to manage lovelace (#33435) 2020-03-31 11:43:21 +02:00
Aaron Bach
23668f3c5e
Overhaul the Slack integration (async and Block Kit support) (#33287)
* Overhaul the Slack integration

* Docstring

* Empty commit to re-trigger build

* Remove remote file option

* Remove unused function

* Adjust log message

* Update homeassistant/components/slack/notify.py

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

* Code review

* Add deprecation warning

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-30 21:32:29 -06: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
Balazs Sandor
7330e30fd3
bump version zigpy-cc (#33448) 2020-03-30 20:33:07 -04:00
Franck Nijhof
a9cbd355ca
Correct FortiOS integration name in manifest (#33454) 2020-03-30 17:20:37 -07:00
HomeAssistant Azure
3e0eaa3c87 [ci skip] Translation update 2020-03-31 00:02:51 +00: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
evoblicec
0e3c1dc031
Add new mapped weather condition classes to Météo France (#33450)
* Update Meteo_France Weather constants

Updating Meteo_France integration with more weather "condition" returned by the web service.

Adding: 
- "Nuit claire" (note the lower 'c') mapped to "clear-night"
- "Brume" mapped to "fog"

* Black formatting update
2020-03-31 00:05:18 +02:00
Erik Montnemery
9508c51403
Fix change of entity_id for discovered MQTT entities (#33444) 2020-03-30 14:26:59 -07:00
Bram Kragten
531207e005
Updated frontend to 20200330.0 (#33449) 2020-03-30 14:20:14 -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
Bas Nijholt
3e0ccd2e86
Add KEF services for DSP (#31967)
* add services for DSP

* add homeassistant/components/kef/const.py

* add services.yaml

* fix set_mode

* fix services

* media_player.py fixes

* bump aiokef to 0.2.9

* update requirements_all.txt

* add basic sensor.py

* add DSP settings as attributes

* add message about kef.update_dsp

* remove sensor.py

* fix pylint issues

* update_dsp inside async_added_to_hass

* use {...} instead of dict(...)

* get DSP settings when connecting to HA or once on update

* simplify condition

* do not get mode twice

* remove async_added_to_hass

* use async_register_entity_service

* remove entity_id from schema and prepend _value

* invalidate self._dsp after setting a DSP setting

* schedule update_dsp every hour

* subscribe and unsubscribe on adding and removing to HA

* don't pass hass and set _update_dsp_task_remover to None after removing
2020-03-30 10:45:24 -07: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
vwir
eee0a6e9f4
Fix for nissan_leaf component getting stuck (#33425)
* Fix for nissan_leaf component getting stuck

* Remove dots from error messages in nissan_leaf component
2020-03-30 09:35:50 +02: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
J. Nick Koston
d59209ff47
Prevent nut from doing I/O in the event loop (#33420)
* Prevent nut from doing I/O in the event loop

device_state_attributes would call for an update if the
throttle happened to expire.

* _format_display_state no self use
2020-03-29 20:53:25 -05:00
jan iversen
ad8cf2d0d0
Remove Modbus legacy code (#33407)
* Modbus: remove legacy code

flexit and stiebel_el are updated to import modbus.const,
therefore legacy code can be removed.

* Flexit: update const reference from modbus

climate.py imports from modbus direct, this is legacy and will
result in errors.

update import to be modbus.const.

* Stiebel_el: update reference to modbus

__init.py references modbus directly, this is legacy and will
give errors.

Update import to be modbus.const.
2020-03-30 01:35:58 +02:00
Aaron Bach
fe0db80fb8
Bump aioambient to 1.1.0 (#33414) 2020-03-30 00:28:37 +02:00
David F. Mulcahey
ef61118d49
fix ZHA IASWD commands (#33402) 2020-03-29 17:42:37 -04: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
Jc2k
ad3c5240c2
Bump aiohomekit version to fix Ecobee Switch (#33396) 2020-03-29 22:38:52 +02:00
Anders Liljekvist
0f9790f5f1
Bluesound volume stepper bugfix (#33404) 2020-03-29 22:38:03 +02:00
jjlawren
68e86c5e3a
Handle Ecobee service timeouts (#33381)
* Bump pyecobee to 0.2.4

* Bump pyecobee to 0.2.5
2020-03-29 22:15:12 +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
cgtobi
d45c386149
Bump opencv to 4.2.0.32 (#33391)
* Bump opencv to 4.2.0.32
2020-03-29 21:30:00 +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
tiagofreire-pt
21098bc3e5
Upgrade broadlink to 0.13.0 (#33240)
* Upgrading the broadlink library version to 0.13.0

As stated here: https://pypi.org/project/broadlink/

* Update requirements_test_all.txt

* Update requirements_all.txt

* Delete requirements_test_all.txt

* Revert "Delete requirements_test_all.txt"

This reverts commit 008f6f2030.

* Revert "Revert "Delete requirements_test_all.txt""

This reverts commit 73e22fd0ff.

* Revert "Revert "Revert "Delete requirements_test_all.txt"""

This reverts commit 7662119c89.
2020-03-29 13:03:46 +02:00
bangom
1f9f5bfaa8
Fix wrong SI unit_prefix in Integration component (#33227) (#33228)
* wrong SI metric prefixes
2020-03-29 11:17:53 +01: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
Colin Harrington
42cb5a5239
Calculate Plum Lightpad brightness and glowIntensity correctly (#33352)
* Plum Lightpad - glowIntensity is represented as a float/percentage
Calculate brightness from the glowIntensity instead of the glowIntensity from brightness.

* Renamed `_glowIntensity` to `_glow_intensity`

* Added Rounding, converting to an int, min and max boxing

* Added codeowners to the Plum Lightpad manifest.json
2020-03-28 21:01:22 -07:00
Austin Mroczek
d832ce0b26
Fix openweathermap sensor.py so no KeyError if raining is miss… (#33372) 2020-03-28 20:59:57 -07:00
Richard de Boer
f32ae95ef4
Fix media_player supported features default value (#33366)
I looked at all media_player components and these were the only ones returning None:
- bluesound
- emby
- mpd
2020-03-28 20:59:04 -07:00
Maciej Bieniek
de2f506585
Migrate GIOS to use DataUpdateCoordinator (#33306)
* Migrate to DataUpdateCoordinator

* Simplify code
2020-03-28 20:57:06 -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
HomeAssistant Azure
5bedc4ede2 [ci skip] Translation update 2020-03-29 00:04:45 +00:00
Anders Melchiorsen
03a090e384
Fixes for Sonos media position (#33379) 2020-03-28 16:15:32 -07:00
Ziv
dd232a3507
Fix uncaught exceptions in dynalite (#33374) 2020-03-28 22:19:43 +01:00
Colin Harrington
03a9e3284c
Fix broken supported_features in Plum Lightpad (#33319) 2020-03-28 21:21:28 +01:00
Malte Franken
c08ca8a439
Fix GDACS tests (#33357)
* enable tests

* only remove entity if exists
2020-03-28 21:18:15 +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
Hans Oischinger
4a2236fe85
:vicare: Improve scan_interval (#33294)
This upgrades to PyVicare 0.1.10 which allows to combine multiple
requests into a single HTTP GET. This in turn allows us to increase
the scan_interval to 60 seconds by default.
Additionally scan_interval has been introduced as a config parameter.
2020-03-28 12:12:27 +01:00
J. Nick Koston
95cefd1acc
Fix nuheat unexpectedly switching to a permanent hold (#33316)
When in run schedule mode, setting the temperature will switch
the device to a temporary hold.  If you set the temperature
again, we should stay in temporary hold mode and not switch
to permanent hold.

The underlying nuheat package contains a default to a
permanent hold if no setting was passed.  We now always
pass the setting.
2020-03-27 23:01:59 -07:00
David F. Mulcahey
5ce31cb383
Fix ZHA light group on state (#33308) 2020-03-27 23:01:17 -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
HomeAssistant Azure
5f72ad8da6 [ci skip] Translation update 2020-03-28 00:08:09 +00:00
J. Nick Koston
00c38c5f70
Bump nexia to 0.7.3 (#33311)
* Resolves not being able to see the compressor speed.
2020-03-27 15:40:54 -05: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
Adam Michaleski
c629e7dc0e
Add integration for Schluter (#31088)
* Add integration for Schluter
New integration for Schluter DITRA-HEAT thermostats. Interacts with Schluter API via py-schluter to implement climate platform.

* Fix for manifest issue on build
Removed unnecessary configurator logic

* Flake8 & ISort issues fixed

* Code review modifications for Schluter integration
- Removed unnecessary strings.json file
- Removed unnecessary DEFAULT_SCAN_INTERVAL from __init__.py
- Removed persistent notification for authentication error in __init__.py
- Removed string casts from log statements in __init__.py
- Removed unnecessary logging of entity creations in climate.py
- Removed unnecessary lookup for hvac_mode in climate.py

* Work started on Update Coordinator

* Further Coordinator work

* Update to DataUpdateCoordinator complete

* Flake8 fix

* Removal of unnecessary SchluterPlatformData
Coordinator also now using SCAN_INTERVAL

* Disable polling, use coordinator listeners

* Isort on climate.py

* Code review modifications
- Hass data stored under domain
- Since platform only likely to be climate, removed array, load explicitly
- Remove unnecessary fan mode implementation

* Switch to HVAC action for showing current heating status

* Isort fix

* HVAC Mode return list, set_hvac_mode function added

* __init__.py modifications from code review

* Climate.py code review modifications
- Device info property removed
- Write state function on set temp failure
- Add "available" property
- Delegate sync function in coordinator update to the executor

* Serial number as unique identifier
- Now using serial number & thermostat dictionary to protect against scenarios where a device is removed and enumerable index is no longer accurate
- Removed async_write_ha_state() from set temp exception, not needed
- Removed unnecessary SCAN_INTERVAL definition

* Linting

* Update homeassistant/components/schluter/climate.py

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

* Update homeassistant/components/schluter/climate.py

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

* Changed timeout from config, load platform discover to None

* Proposed change for discover info issue

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-03-27 10:53:36 -07:00
Paulus Schoutsen
73c52e668e
Fix dispatcher logging (#33299) 2020-03-26 20:44:44 -07:00
Paulus Schoutsen
6cafc45d2b
Fix ZHA light crashing on color loop effect (#33298) 2020-03-26 20:23:01 -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
HomeAssistant Azure
c89975adf6 [ci skip] Translation update 2020-03-27 00:46:57 +00:00
Erik Montnemery
867630a4a7
Remove state when entity is removed from registry (#32184) 2020-03-26 16:33:50 -07: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
Daniel Høyer Iversen
262ed9ed2a
Upgrade tibber to 0.13.6 (#33293) 2020-03-26 22:27:05 +01:00
jjlawren
f1e58d0784
Handle empty Plex client username (#33271) 2020-03-26 21:18:23 +01:00
Jaryl Chng
6c6318d18f
Update PySwitchbot to 0.8.0 and add password configuration option (#33252)
* Update PySwitchbot to 0.8.0 and added password configuration

* Removed unchanged retry_count attribute

* Fix dependencies and formatting

* Removed default value for password and use config.get instead
2020-03-26 20:55:00 +01:00
Kris Bennett
3dc6612cd9
Add Android TV cover art (screen content) (#33232)
* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV

* Android TV
2020-03-26 11:31:23 -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
Fabian Affolter
558cccc68c
Upgrade pyyaml to 5.3.1 (#33246) 2020-03-26 16:14:07 +01:00
Fabian Affolter
b598ff94d1
Upgrade jinja2 to >=2.11.1 (#33244) 2020-03-26 16:12:12 +01:00
Fabian Affolter
c267946284
Upgrade discord.py to 1.3.2 (#33280) 2020-03-26 12:58:11 +01:00
HomeAssistant Azure
6c4b4ad1e0 [ci skip] Translation update 2020-03-26 00:47:06 +00:00
Maciej Bieniek
815d153e55
Bump gios library to version 0.0.5 (#33266) 2020-03-25 16:24:28 -07:00
jjlawren
5650b390b9
Schedule Unifi shutdown callback earlier (#33257) 2020-03-25 16:03:26 -07:00
Pascal Vizeli
8f4d3146c1
Revert "Fix issue with smhi-pkg" (#33259)
* Revert "Fix issue with smhi-pkg (#33248)"

This reverts commit 6990c70123.

* Bump version to 1.0.13
2020-03-25 21:43:29 +01:00
Fabian Affolter
2647296475
Refactor API documentation (#33217)
* Upgrade Sphinx to 2.4.4

* Refactor API documentation

* Remove left-over

* Remove Markdown from docstring

* Update titels
2020-03-25 13:21:04 -07:00
J. Nick Koston
6d311a31dd
Ensure recorder event loop recovers if the database server dis… (#33253)
If the database server disconnects there were exceptions
that were not trapped which would cause the recorder event
loop to collapse.  As we never want the loop to end
we trap exceptions broadly.

Fix a bug in the new commit interval setting which caused
it to always commit after 1s
2020-03-25 13:08:20 -07:00
Paulus Schoutsen
4bbc0a03ca
Activate asyncio debug when HA run in debug mode (#33251) 2020-03-25 13:03:56 -07:00
Maciej Bieniek
16670a38a4
Dynamic update interval for Airly integration (#31459)
* Initial commit

* dynamic update

* Don't update when add entities

* Cleaning

* Fix MAX_REQUESTS_PER_DAY const

* Fix pylint errors

* Fix comment

* Migrate to DataUpdateCoordinator

* Cleaning

* Suggested change

* Change try..except as suggested

* Remove unnecessary self._attrs variable

* Cleaning

* Fix typo

* Change update_interval method

* Add comments

* Add ConfigEntryNotReady
2020-03-25 11:13:28 -07: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
Fabian Affolter
4a0a56ebdc
Upgrade hole to 0.5.1 (#33249) 2020-03-25 17:22:34 +01:00
Eugenio Panadero
bb68e7a532
Bump aiohue version to 2.1.0 (#33234) 2020-03-25 09:11:00 -07:00
Franck Nijhof
1fa996ed68
Fix ONVIF camera snapshot with auth (#33241) 2020-03-25 13:32:28 +01: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
Alexei Chetroi
28c2f9caa9
Refactor ZHA platform setup (#33226)
Setup ZHA platforms only after successful gateway startup.
2020-03-24 20:32:46 -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
brefra
46985bba0d
Fix velbus dimming control (#33139)
* Fix light control

* Optimize conversion logic
2020-03-24 21:58:50 +01:00
Balazs Keresztury
3f4a7ec396
Fix minor bmp280 issues mentioned in late review (#33211)
* Fix minor issues mentioned in #30837 after it was closed

* Update homeassistant/components/bmp280/sensor.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-24 21:52:49 +01: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
Ron Klinkien
109f083c5d
Add Body Composition data to Garmin Connect (#32841)
* Added support for Garmin index smart scale

* Added body composition data

* Added keyerror exception

* Code optimization

* Update library, changed logger errors to exception

* Fixed manifest
2020-03-24 10:29:40 -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
roleo
aec2fe86e4
Add onvif snapshot uri (#33149)
* Add onvif snapshot uri

If the cam supports http snapshot uri, use it instead of ffmpeg.

* Code formatting

* Fix to pass pre-commit
2020-03-24 09:57:14 -07:00
HomeAssistant Azure
763ed0dc7b [ci skip] Translation update 2020-03-24 13:18:47 +00:00
Diogo Gomes
f150c9c65c
Increase timeout setting up IPMA (#33194) 2020-03-24 13:17:31 +01:00
Josef Schlehofer
d979648c01
Upgrade youtube_dl to version 2020.03.24 (#33202) 2020-03-24 13:04:16 +01:00
Oliver
9226589bcd
Bump to version 0.8.1 of denonavr (#33169)
* Bump to version 0.8.1 of denonavr

* Update CODEWONERS file
2020-03-24 13:03:22 +01:00
Pascal Vizeli
e616ab5fb2
Bump OZW fork to 0.1.10 (#33205) 2020-03-24 12:04:33 +01:00
MeIchthys
3c59791b2e
Add Nextcloud Integration (#30871)
* some sensors working in homeassistant

* bring up to date

* add codeowner

* update requirements

* overhaul data imports from api & sensor discovery

* remove print statement

* delete requirements_test_all

* add requrements_test_all.txt

* Update homeassistant/components/nextcloud/sensor.py

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

* Update homeassistant/components/nextcloud/sensor.py

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

* describe recursive function

* clarify that dict is returned

* remove requirements from requirements_test_all

* improve and simplify sensor naming

* add basic tests

* restore pre-commit config

* update requirements_test_all

* remove codespell requirement

* update pre-commit-config

* add-back codespell

* rename class variables as suggested by @springstan

* add dev branch to no-commit-to-branch git hook

Because my fork had the same 'dev' branch i wasn't able to push. Going forward I should probably name my branches differently.

* move config logic to __init__.py

* restore .pre-commit-config.yaml

* remove tests

* remove nextcloud test requirement

* remove debugging code

* implement binary sensors

* restore .pre-commit-config.yaml

* bump dependency version

* bump requirements files

* bump nextcloud reqirement to latest

* update possible exceptions, use fstrings

* add list of sensors & fix inconsistency in get_data_points

* use domain for config

* fix guard clause

* repair pre-commit-config

* Remove period from logging

* include url in unique_id

* update requirements_all.txt

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-24 11:11:35 +01: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
Franck Nijhof
2d002f3ef6
Fix minut point updating frozen config entry data (#33148)
* Fix minut point updating frozen config entry data

* Update webhooks handling for configuration entry
2020-03-24 01:20:39 +01: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
Maciej Bieniek
5c2bd8b743
Add unique ID propery to braviatv entity (#33037)
* Add unique_id property

* Use cid to generate unique_id

* Remove debug file

* Add _unique_id declaration

* Suggested change

* Remove unused self._id
2020-03-23 22:16:17 +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
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
jasperro
c8d4cf08d9
Add Tado set presence (#32765)
* Updated tado integration climate.py to allow for presence change

* Updated tado integration __init__.py to allow for presence change

* Black formatting

* Added missing docstring

* Added missing period to docstring

* Using constants from climate component

* Filter out other preset_modes

* Linting error fix

* Isort error fix

* Filtering of unwanted presence mode in init

* Bumped python-tado version to 0.5.0

Removed unnecessary preset mode check

* Update requirements_all.txt
2020-03-23 10:40:15 -05:00
Balazs Keresztury
df67ab995f
Add support for Bosch BMP280 Sensor (#30837)
* Implement support for Bosch BMP280 Sensor

* Fixed linting errors

* Fixed case of the requirement RPi.GPIO so it is ignored in requirements

* Update homeassistant/components/bmp280/manifest.json

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

* Update homeassistant/components/bmp280/sensor.py

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

* Fix linting errors

* Implemented changes suggested by code review

* Fixed incomplete refactoring

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-03-23 09:12:59 -05:00
Vegetto
df2351b920
Support for COLOR_TEMP in Homematic dimmers (#31207)
* Support for COLOR_TEMP in Homematic dimmers

* Fix lint issues

* Added pre-checks

* Fix review feedback

* Remove unneded code
2020-03-23 10:56:44 +01:00
Olivier B
4332cbe112
Add Tesla sentry mode switch (#32938)
* Add Tesla sentry mode switch

* add available property, fix is_on

* bump teslajsonpy to 0.6.0
2020-03-23 10:52:59 +01: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
Jason Swails
49ebea2be3
Add support for occupancy/vacancy groups in Lutron Caseta component (#33032)
* Add support for Lutron Caseta occupancy/vacancy sensors

This follows updates to pylutron-caseta to add support for these
devices. This code works for me as a custom component in Home Assistant
Core with pylutron-caseta 0.6.0 (currently unreleased).

* black formatting

* Update requirements_all.txt

* Apply black formatting

* Resolve some review comments

* serial -> unique_id

* Black formatting

* Resolve linting errors

* Add code owner...

* Fix isort complaint

* Fix remaining isort complaints

* Update codeowners

* Resolve outstanding review comments

* Remove caseta_
2020-03-23 07:51:24 +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
fa60e9b03b
Improve sense timeout exception handling (#33127)
asyncio.Timeout needs to be trapped as well
2020-03-22 21:41:59 -07: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
J. Nick Koston
e344c2ea64
Add gate support to myq, fix bouncy updates (#33124)
* Add gate support to myq, fix bouncy updates

Switch to DataUpdateCoordinator, previously
we would hit the myq api every 60 seconds per device.

If you have access to 20 garage doors on the account it means
we would have previously tried to update 20 times per minutes.

* switch to async_call_later
2020-03-22 16:28:55 -07:00
Ivan Dyedov
ab8c50895e
Add fahrenheit support in miflora sensor (#33136)
* add support for fahrenheit in miflora sensor

* fix error introduced when resolving merge conflict

* fix formatting
2020-03-22 21:58:35 +01:00
Matt Snyder
f0472f2dc2
Fix QVR Pro connection error and add port option (#33070)
* Allow port specification.  Handle connection error gracefully.

* Allow port specification.  Handle connection error gracefully.

* Alias exception. Requested changes.
2020-03-22 21:43:45 +01:00
Quentame
0249daef2e
Bump iCloud to 0.9.6.1 (#33161) 2020-03-22 21:05:27 +01: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
Jason Swails
2a3d688923
General code cleanups for lutron_caseta component (#33144)
* General code cleanups for lutron_caseta component

* black

* Update homeassistant/components/lutron_caseta/__init__.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-22 17:35:01 +01: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
Christian Ferbar
8423d18d8d
Add Miflora go_unavailable_timeout (#31156)
* Clear state on exception

Clear state if querying the device fails. The state is then set to unknown, so it can be tracked if a miflora device isn't responding any more.

* Add available()

Signal valid data via available()

* miflora: add timeout to go unavailable

* code cleanup

* miflora: tox cleanup
2020-03-22 14:00:09 +01:00
Maciej Bieniek
9d87c1ab1a
Bump gios to 0.0.4 (#33141) 2020-03-22 13:44:57 +01: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
jjlawren
99877c32b1
Bump pyecobee to 0.2.3 (#33130) 2020-03-22 13:19:26 +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
Eugenio Panadero
d5e606640c
Fix scheduled update time-drift in data update coordinator (#32974)
* Fix scheduled update time-drift in data update coordinator

As next schedule is calculated **after** the update is done,
setting now + update_interval makes 1 second drift in practice,
as the tick is 1Hz.

* Floor the utcnow timestamp

to remove sub-second error precision, and generate constant frequency updates
as long as the update takes < 1s.
2020-03-21 16:57:12 -07:00
Franck Nijhof
6d4fa76107
Add Wi-Fi sensors to WLED integration (#33055) 2020-03-21 15:14:41 -07:00
Austin Mroczek
ba2558790d
Fix totalconnect AttributeError introduced in 0.107 (#33079)
* Fit git

* Remove period from loggging message

* Remove tests for now

* Add const.py

* Fix lint error
2020-03-21 15:14:19 -07:00
guillempages
79f6d55fe8
Fix tankerkoenig with more than 10 stations (#33098)
* Fix tankerkoenig with more than 10 stations

There seemed to be a problem, if more than 10 fuel stations were tracked.
Added a warning in this case, and split the calls to the API in chunks of
10, so that the data can be fetched anyway.

* Update homeassistant/components/tankerkoenig/__init__.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-03-21 15:12:14 -07:00
Aaron Bach
403b4a2e0b
Bump simplisafe-python to 9.0.5 (#33116) 2020-03-21 16:01:39 -06:00
Franck Nijhof
8272c71811
Handle query and anchors in Spotify URI's (#33084)
* Handle query and anchors in Spotify URI's

* Use yarl for cleaning up the URL
2020-03-21 12:24:23 -07:00
Anders Melchiorsen
699ca44260
Clean up Sonos attributes for radio streams (#33063) 2020-03-21 12:17:00 -07:00
Franck Nijhof
5893f6b14b
Fix Extend ONVIF unique ID with profile index (#33103) 2020-03-21 11:36:35 -07:00
Franck Nijhof
a7b08c48f3
Upgrade spotipy to 2.10.0 (#33083) 2020-03-21 19:25:29 +01:00
J. Nick Koston
0148708613
Add DEVICE_CLASS_GATE (#33074)
Gates are found outside of a structure and are typically part of a fence.
2020-03-21 11:17:06 -07:00
Alexei Chetroi
81cef9a281
Split ZHA device loading and entities adding (#33075)
* Split ZHA device loading and entities adding.
Load zha devices from ZHA gateway, but add entities after integration
was setup.

* Use hass.loop.create_task()
* Split ZHA device initialization from loading.
Restore and initialize ZHA devices separately.

* Use hass.async_create_task()
Load devices prior group initialization.
2020-03-21 13:25:43 -04: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
Jonas Kohlbrenner
57820be92a
Add scan_interval support for NUT integration (#31167)
* Added scan_interval support

* Changed to config[key] for required keys and optional keys with default value

* Removed usage of Throttle
2020-03-21 16:45:10 +01:00
Balazs Sandor
e18bea0215
bump version zigpy-cc (#33097) 2020-03-21 10:43:55 -04: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
Franck Nijhof
e87fab6b5f
Remove mopar integration (ADR-0004) (#33066) 2020-03-21 07:09:48 +01: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
Aaron Bach
836413a4a8
Bump simplisafe-python to 9.0.4 (#33059) 2020-03-20 14:59:01 -06:00
Paulus Schoutsen
d16d44d3e7
Add negative tests for identify schema for packages (#33050) 2020-03-20 13:34:56 -07:00
Knapoc
c2ac8e813a
Bump aioasuswrt to 1.2.3 and fix asuswrt sensor (#33064)
* Bump aioasuswrt to 1.2.3

* Fix asuswrt connection setup parameters

* fix typo
2020-03-20 21:34:17 +01: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
Franck Nijhof
acf41d03db
Remove alarmdotcom integration (ADR-0004) (#33056) 2020-03-20 20:21:20 +01: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
James Nimmo
c00f04221f
Add IntesisHome support for air to water heat pumps (#32250)
* Add Intesis support for air to water heat pumps

* Bump to pyIntesisHome 1.7.1

* Fix

* Re-order HVAC modes
2020-03-20 10:17:50 -07:00
GaryOkie
414559f018
Enable incremental Pan/Tilt/Zoom capability to Amcrest/Dahua cameras (#32839)
Add new "amcrest.ptz_control" service to specify a PTZ camera movement or zoom direction (up, down, right, left, right_up, right_down, left_up, left_down, zoom_in, zoom_out). An optional travel_time attribute specifies the amount of movement between start/stop.
2020-03-20 11:34:42 -05:00
Franck Nijhof
661101df08
Fix packages for schemas without a default (#33045) 2020-03-20 08:17:43 -07:00
Steven Rollason
ecbcdee934
Bump pyhaversion to 3.3.0 (#33044) 2020-03-20 15:58:23 +01: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
cgtobi
6ab14a3729
Fix discovery issue with netatmo climate devices (#33040) 2020-03-20 15:20:42 +01:00
Jason Swails
f81464161a
Break dependency on lutron component (#33031)
* Break dependency on lutron component

* Fix isort complaint
2020-03-20 10:42:34 +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
Phil Bruckner
0ed7bc3b8e
Convert amcrest binary sensors from poll to stream (#32818)
* Convert amcrest binary sensors from poll to stream

- Bump amcrest package to 1.6.0.
- For online binary sensor poll camera periodically to test communications in case
  configuration & usage results in no other communication to camera.
- Start a separate thread to call camera's event_stream method since it never returns.
- Convert all received events into signals that cause corresponding sensors to update.
- Use camera's generic event_channels_happened method to update sensors at startup,
  and whenever camera comes back online after being unavailable.

* Changes per review

* Changes per review 2

* Changes per review 3

- Move event stream decoding to amcrest package.
- Change name of event processing threads so global
  counter is no longer required.
- Bump amcrest package to 1.7.0.
2020-03-19 21:07:21 -07: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
1a4199c485
Handle zigpy clusters without ep_attribute attribute. (#33028) 2020-03-19 22:47:08 -04: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
Robert Svensson
ff2367fffb
deCONZ - Add support for Senic and Gira Friends of Hue remote… (#33022) 2020-03-19 16:40:50 -07:00
Robert Svensson
4c9303bbd5
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
2020-03-19 16:30:38 -07:00