Commit Graph

4810 Commits (2cda7bf1e7e160d996359188f1fa25265914650b)

Author SHA1 Message Date
J. Nick Koston 17f3332c89
Audit state handling off august bridges and sensors (#31935)
* Audit state handling of august bridges and sensors

This addresses issue #29980

* Prevent setting up august locks that do not have a bridge as they will never work

* Prevent locks showing available when their bridge is offline

* Prevent door sensors from showing available when their bridge is offline

* Prevent creating door sensors for locks that do not have them

* Prevent doorbells showing unavailable when they are in standby mode

* Set SCAN_INTERVAL for binary_sensors to 5 seconds as
  data comes in from the activity endpoint more frequently

* Update homeassistant/components/august/__init__.py

raise if the detail is missing when checking doorsense

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

* Handle another place where the lock detail could not exist

* Address review comments

* Handle lock detail update failing and add test

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-18 12:11:05 -08:00
Paulus Schoutsen beee1298c5
Extend safe mode (#31927)
* Extend safe mode

* Add safe mode boolean to config JSON output and default Lovelace

* Add safe mode to frontend

* Update accent color
2020-02-18 11:52:38 -08:00
Markus Pöschl 245482d802
Add Twitch subscription and additional stats (#31122)
* add oauth functionality and additional attributes

* Add tests WIP

* Make mocks work the correct way

* Use CONF_TOKEN constant for config

* Remove twitch from .coveragerc

* Update homeassistant/components/twitch/sensor.py

Lets be consistent

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

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-02-18 11:51:37 -08:00
Paulus Schoutsen 7be3a4cd37
Fix entity registry not saving name/icon (#31932) 2020-02-18 08:32:34 -08:00
Paulus Schoutsen a6b5d73f1c
Report which data causes JSON serialization error (#31901) 2020-02-17 10:49:42 -08:00
J. Nick Koston 00ac7a7d70
Provide user consumable errors when lock operations fail (#31864)
* Provide user consumable errors when lock operations fail

This resolves issue #26672

* include from in raise

* pylint

* Cleanup of mocking.
2020-02-17 10:30:14 -08:00
Victor Guimarães 93a844b1d5
Hue Group features based on the bulbs in it (#31897)
* Computes the features of a hue group as the union of the features of the bulbs in the group

* Moved create item to a function

* Added test for hue group features
2020-02-17 10:22:34 -08:00
Paulus Schoutsen 81701f7e4c
Start safe mode if invalid core conf (#31904) 2020-02-17 10:20:05 -08:00
Paulus Schoutsen 1b7dd6c603
Add icons to scripts (#31899) 2020-02-17 08:44:36 -08:00
Paulus Schoutsen c788946430
Allow specifying an icon for a scene (#31898) 2020-02-17 08:41:33 -08:00
Paulus Schoutsen 3da136b034
Add logger name to system log (#31902) 2020-02-17 17:26:25 +01:00
Martin Hjelmare 2ce7561343
Clean soundtouch (#31888)
* Clean up soundtouch tests

* Remove not needed updates
2020-02-16 15:34:44 -08:00
Martin Hjelmare e3adbc336d
Fix check_real location guard (#31890) 2020-02-16 15:33:09 -08:00
SukramJ 32f25a8484
Adjust tests after speed up to restore coverage for HomematicIP Cloud (#31836)
* Adjust tests after speed up to restore coverage for HomematicIP Cloud

* Fix test data

* Fixes after review

* remove duplicate cade

* remove service marker
2020-02-16 10:09:26 +01:00
J. Nick Koston 096e7cceed
Support XML conversion for RESTful sensors (#31809)
* Support XML conversion for RESTful sensors

Many devices continue to use XML for RESTful
APIs.  Interfacing with these APIs requires custom
integrations or command line fork()/exec() overhead
which many of these devices can work with as if
they were JSON using xmltojson via this spec:
https://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html

This change implements converting XML output to
JSON via xmltojson so it can work with the existing
rest sensor component.  As the attributes that
usually need to be scraped are deeper in the document
support for passing in a template to find the
JSON attributes that have been added.  JSON APIs that
do not have their attributes at the top level
can also benefit from this change.

* Auto convert xml, change out the template for jsonpath

* Address review items and potentially unexpected normalize behavior with jsonpath

* Revert "Address review items and potentially unexpected normalize behavior with jsonpath"

This reverts commit fe9e179092.

* json_dict[0] turned out to be needed
2020-02-15 21:10:23 -08:00
J. Nick Koston f6d9e6b6c5
Convert august to async so a token refresh lock can be used (#31848)
* Convert august to async so a token refresh lock can be used

* Update comment since we now have a lock

* Do not mock the lock

* Address review items
2020-02-15 21:08:52 -08:00
Philip Rosenberg-Watt fb8cbc2e93
Fix CalDAV recurring events (#31805)
* Fix CalDAV parsing of recurring events

Some CaDAV servers (see: SOGo) return the original event that contains
the recurrence rules. The CalDAV calendar component sorts and filters
events based on their start and end dates, and was failing to properly
show recurring events based on these recurrence rules.

This this change checks if an event has recurrence rules and changes the
start/end dates of the event to today if the event is set to occur
today. This allows the rest of the component logic to function properly.

* Use date from nextmost occurence

* Adding unit tests

* Add endless event unit test

* Create new vevent for each event recurrence today

* Remove redundant unit test

* Add timezone to events that have none

Python cannot compare them otherwise.

* Simplify code, add comments & guard clause

* Add test for recurring all day event

* Account for all-day events

* Remove redundant code

* Remove redundant code

* Remove unnecessary deepcopy

* Add hourly recurring tests

* Add tests for hourly repeating event

* Fix unit test

* Use event.copy()
2020-02-15 19:31:36 -08:00
Moshe Kaplan 7dff5e79d1
Add support for displaying Daf Yomi (#30628)
* Add support for displaying Daf Yomi

* Ran black --fast

* Added docstring to get_daf

* Further lint fixes

* Remove unnecessary else

* clarify code

* Use fstrings

* pull daf yomi from hdate

* Update manifest version for daf_yomi support

* fix variable usage

* Update requirements

* Also pass in today's date as well

* Rename date variable to daytime_date

* Add tests for daf yomi sensor

* Update stale test IDs
2020-02-16 00:00:17 +01:00
Paulus Schoutsen 4501471b8c
Google Assistant: Remove speaker type and earlier filter out devices from being locally exposed (#31830)
* Remove speaker type

* Do not expose locks or alarms to Google Local
2020-02-14 15:28:11 -08:00
Paulus Schoutsen 52b045ed30
Fix person device_trackers null (#31829) 2020-02-14 15:27:31 -08:00
Robert Svensson 043d36f7c6
Change multi_select config validator to class (#31828)
* Move multi_select to class

* Fix serializer and add test

* Serializer should also return options
2020-02-14 11:09:40 -08:00
Abílio Costa e6148d223a
Allow hourly forecast in IPMA (#30979)
* update ipma component for pyipma 2.0
* fix wind speed; refactor forecast
* update requirements*.txt
* fix tests; update CODEOWNERS; update pyipma to 2.0.1
* minor changes as suggested in PR
* make lint happy
* fix mocking coroutines
* restore old unique id
* fix station lat/lon; update pyipma version
* add hourly forecast option to IPMA
* add forecast tests
* use for instead of lambda
2020-02-14 12:04:41 -05:00
SukramJ 9eb0415234
Speed up tests of HomematicIP Cloud (#31810)
* Speed up tests of HomematicIP Cloud

* load the json once
2020-02-13 22:56:17 -08:00
jjlawren 408b41ea02
Add device registry support for Plex (#31797)
* Add device registry support for Plex

* Fix model

* Use Plex server as sensor device identifier
2020-02-13 16:37:52 -08:00
SukramJ 2f3ab15268
Remove force from async_schedule_update_ha_state for HMIPC (#31796)
* remove force from async_schedule_update_ha_state if HMIPC

* Fix lint
2020-02-13 16:24:43 -08:00
Paulus Schoutsen fbbb29a6ec
Catch unexpected exceptions when validating config (#31795) 2020-02-13 22:43:07 +01:00
Robert Svensson 6211a2bb98
Add multi select support to config validation and to custom serializer (#31798) 2020-02-13 13:12:09 -08:00
Paulus Schoutsen 9e7185c676
Write state if schedule update state from async context (#31758)
* Write state if schedule update state from async context

* Fix most tests

* Fix test and PS4 I/O in event loop

* Fix ps4 better
2020-02-13 10:22:06 -08:00
Ville Skyttä 3e23a3a860
Add and use bunch of data size and rate related constants (#31781)
Also fix a few units to match the corresponding data.
2020-02-13 08:52:57 -08:00
Franck Nijhof 0173c61fee
Spelling: Config(uration) (#31782) 2020-02-13 08:27:00 -08:00
Robert Svensson 4cac0443e2
UniFi - Change handling of updated options (#31762)
* Change handling of updated options

* Add tests
2020-02-12 16:15:08 -08:00
J. Nick Koston 6879105b14
Cleanup August activity processing and add tests (#31774)
* Update py-august to 0.12.0

* Upstream update also resolves issue #28960
2020-02-12 15:35:07 -08:00
Alexei Chetroi 52fe1328f6
ZHA tests refactoring (#31744)
* Refactor ZHA fixtures.
Patch Zigpy radio libs instead of ZHA when setting up fixtures.
Use new fixtures for binary_sensor.zha platform.

* Update ZHA api tests.
* Update ZHA channels and discovery tests.
* Update ZHA cover tests.
* Update device action/trigger tests.
* Update device_tracker.zha platform tests.
* Update fan.zha platform tests.
* Update ZHA gateway tests.
* Update lock.zha platform tests.
* Update switch.zha platform tests.
* Update sensor.zha platform tests.
* Update light.zha platform tests.
* Use MockConfigEntry.
* Address PR comments.
2020-02-12 16:12:14 -05:00
Daniel Shokouhi 43256ebd83
Add device name to sensor name for mobile_app (#31756)
* Add device name to sensor name

* Update test to include device name
2020-02-12 11:40:39 -08:00
Emanuel Winblad 3e05fc1c11
Add initial version of Vilfo Router integration (#31177)
* Initial implementation of Vilfo router integration.

This commit is a combination of several commits, with commit messages in bullet form below.

* Added additional files to Vilfo integration.
* Added generated files.
* Fixed alphabetic order in generated config_flows.
* Continued implementation of config flow for Vilfo integration.
* Continued work on config_flow for Vilfo.
* Updated requirements in manifest for Vilfo Router integration.
* Some strings added to Vilfo Router integration.
* Vilfo Router integration updated with sensor support.
* Code style cleanup.
* Additional cleanup of config flow.
* Added additional UI strings for Vilfo Router
* Updated tests of config flow and fixed formatting
* Updated requirement upon vilfo-api-client.
* Sensor refactoring including support for icons
* Code style changes for Vilfo Router integration
* Code cleanup
* Fixed linting issues in Vilfo Router integration
* Fixed import order in test for Vilfo integration.

* Updates to Vilfo Router integration based on feedback

Based on the feedback received, updates have been made to the Vilfo Router integration.

A couple of the points mentioned have not been addressed yet, since the appropriate action has not yet been determined. These are:

* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371124477
* https://github.com/home-assistant/home-assistant/pull/31177#discussion_r371202896

This commit consists of:

    * Removed unused folder/submodule
    * Fixes to __init__
    * Fixes to config_flow
    * Fixes to const
    * Refactored sensors and applied fixes
    * Fix issue with wrong exception type in config flow
    * Updated tests for Vilfo integration config_flow
    * Updated dependency upon vilfo-api-client to improve testability
    * Import order fixes in test
    * Use constants instead of strings in tests

* Updated the VilfoRouterData class to only use the hostname as unique_id when it is the default one (admin.vilfo.com).

* Refactored based on feedback during review.

* Changes to constant names,
* Blocking IO separated to executor job,
* Data for uptime sensor changed from being computed to being a timestamp,
* Started refactoring uptime sensor in terms of naming and unit.
* Updated constants for boot time (previously uptime) sensor.
* Refactored test of Vilfo config flow to avoid patching code under test.
* UI naming fixes and better exception handling.

* Removed unused exception class.

* Various changes to Vilfo Router integration.

* Removed unit of measurement for boot time sensor,
* Added support for a sensor not having a unit,
* Updated the config_flow to handle when the integration is already configured,
* Updated tests to avoid mocking the code under test and also to cover the aforementioned changes.

* Exception handling in Vilfo Router config flow refactored to be more readable.

* Refactored constant usage, fixed sensor availability and fix API client library doing I/O in async context.

* Updated signature with hass first

* Update call to constructor with changed order of arguments
2020-02-12 19:11:15 +01:00
jjlawren 1b2f4fa19f
Improve Plex media_player entity naming (#31755) 2020-02-12 09:55:18 -08:00
Bas Nijholt 8498ca37cd
Fix moving average test for discrete derivative sensor (#31750)
* fix test_data_moving_average_for_discrete_sensor

After https://github.com/home-assistant/home-assistant/pull/31717 the test
didn't actually test anything anymore.

This fixes that.

* make the test faster
2020-02-12 09:53:06 -08:00
Robbie Trencheny 0700d38d1f
Add new webhook action to allow enabling encryption in an exis… (#31743)
* Add new webhook action to allow enabling encryption in an existing registration

* Harden tests

* Make requested fixes
2020-02-11 23:56:22 -08:00
J. Nick Koston f5be9ef7fb
Refresh the august access token when needed (#31735)
* Refresh the august access token
when needed.

Currently august will stop working when the token
expires about every six month.

This resolves issue #23788

* Make refresh_access_token_if_needed private since we do not want additional callers

* Add init
2020-02-11 22:13:54 -08:00
Kit Klein 3435281bd1
Support Konnected Pro alarm panel, embrace async, leverage latest HA features/architecture (#30894)
* fix unique_id computation for switches

* update konnected component to use async, config entries, registries. Pro board support and tests

* clean up formatting comments from PR

* use standard interfaces in tests

* migrate config flow to use options

* address latest pr feedback

* format for import as part of config schema validation

* address pr feedback

* lint fix

* simplify check based on pr feedback

* clarify default schema validation

* fix other schema checks

* fix translations

Co-authored-by: Nate Clark <nate@nateclark.com>
2020-02-11 22:04:42 +01:00
Paulus Schoutsen 51c35ab9a8
Entity Registry to store and restore name/icon (#31714)
* Entity Registry to store and restore name/icon

* Update test_entity_registry.py

* Add original name/icon to JSON result
2020-02-11 09:40:50 -08:00
Paulus Schoutsen 81b159f424
Disable Hue groups for new setups (#31713) 2020-02-11 08:50:07 -08:00
Paulus Schoutsen 6fcf5472a5
Limit derivative test (#31717) 2020-02-11 09:03:52 +01:00
Paulus Schoutsen 5a0f21cbe3
Adjust entity slow warning for custom component (#31711) 2020-02-10 16:32:47 -08:00
Rami Mosleh c66106ee98
Add Glances sensors dynamically (#28639)
* Add temp_sensors to glances dynamically

* unsub from updates when sensor is disabled

* dynamicall add sensors

* change "device_name" to "mnt_point"

* remove unnecessary logging

* update sensor.py

* update test_config_flow.py

* remove commented code
2020-02-10 15:02:14 -08:00
Raman Gupta 284fd46ea8
For vizio integration, set unique ID early to prevent multiple zeroconf discovery items for the same device to appear (#31686)
* set unique ID early to prevent multiple zeroconf discovery items for the same device to appear

* add test
2020-02-10 14:54:52 -08:00
Ziv 4467409e5c
Dynalite Integration (#27841)
* Initial commit

* ran hassfest and gen_requirements_all scripts

* fixes per request from Paulus Schoutsen

* ran gen_requirements_all

* updated library version - removed some debug leftover

* get_requirements again...

* added documentation URL

* ran isort

* changed storage in hass.data[DOMAIN] to use entry_id instead of host

* adopted unit tests to latest fix

* Update const.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-10 13:16:04 -08:00
Vilppu Vuorinen b78d156f0e
Add MELCloud integration (#30712)
* Add MELCloud integration

* Provides a climate and sensor platforms. Multiple platforms on one go
is not the best option, but it does not make sense to remove them and
commit them later either.

* Email and access token are stored to the ConfigEntry. The token can be
updated by adding the integration again with the same email address. The
config flow is aborted and the update is performed on the background.

* Run isort

* Fix pylint errors

* Run black

* Increase coverage

* Update pymelcloud dependency

* Add HVAC_MODE_OFF emulation

* Remove print

* Update pymelcloud to enable device type filtering

* Collapse except blocks and chain ClientNotReadys

* Add preliminary documentation URL

* Use list comp for creating model info

Filters out empty model names form units.

* f-string galore

Dropped 'HVAC' from AtaDevice name template.

* Delegate fan mode mapping to pymelcloud

* Fix type annotation

* Access AtaDevice through self._device

* Prefer list comprehension

* Update pymelcloud to leverage device type grouping

The updated backend lib returns devices in a dict grouped by the device
type. The devices do not necessarily need to be in a single list and
this way isinstance is not required to extract devices by type.

* Remove DOMAIN presence check

This does not seem to make much sense after all.

* Fix async_setup_entry

Entry setup used half-baked naming from few experimentations back.
The naming conventiens were unified to match the platforms.

A redundant noneness check was also removed after evaluating the
possible return values from the backend lib.

* Simplify empty model name check

* Improve config validation

* Use config_validation strings.

* Add CONF_EMAIL to config schema. The value is not strictly required
when configuring through configuration.yaml, but having it there makes
things more consistent.

* Use dict[key] to access required properties.

* Add DOMAIN in config check back to async_setup. This is required if an
integration is configured throught config_flow.

* Remove unused manifest properties

* Remove redundant ClimateDevice property override

* Add __init__.py to coverage exclusion

* Use CONF_USERNAME instead of CONF_EMAIL

* Use asyncio.gather instead of asyncio.wait

* Misc fixes

* any -> Any

* Better names for dict iterations

* Proper dict access with mandatory/known keys

* Remove unused 'name' argument

* Remove unnecessary platform info from unique_ids

* Remove redundant methods from climate platform

* Remove redundant default value from dict get

* Update ConfigFlow sub-classing

* Define sensors in a dict instead of a list

* Use _abort_if_unique_id_configured to update token

* Fix them tests

* Remove current state guards

* Fix that gather call

* Implement sensor definitions without str manipulation

* Use relative intra-package imports

* Update homeassistant/components/melcloud/config_flow.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-02-10 22:09:12 +01:00
Quentame 9e41ee49cb
Fix Météo-France I/O while testing (#31695)
* Fix Météo-France I/O while testing

* Review
2020-02-10 17:00:22 +01:00
Paulus Schoutsen 5092971452
Add brightness light device actions (#31567) 2020-02-09 19:47:59 -08:00
Paulus Schoutsen 12de3f1e47 Clean up frontend services and events (#31654)
* Clean up frontend services and events

* Fix bug in core instead

* Add test that core works correctly with callback marked async funcs
2020-02-09 19:47:16 -08:00
Alexei Chetroi 28eeed1db3
ZHA tests refactoring (#31682)
* Fixtures for restoring/joning a device.

* binary_sensor.zha tests.

* cover.zha platform tests.

* device_tracker.zha platform tests.

* fan.zha platform tests.

* switch.zha platform tests.

* Update light.zha platform tests.

* Update sensor.zha platform tests.

* ZHA api tests refactoring.

* Update lock.zha platform tests.

* Update ZHA gateway tests.

* Update zha device action tests.

* Update zha device trigger tests.

* Cleanup.
2020-02-09 21:45:35 -05:00
Jonathan Østrup 150b376cf9
Add recorder vars db_max_retries and db_retry_wait (#31561)
* added recorder vars db_max_retries and db_retry_wait

* fixed test_recorder_setup_failure

I failed because it was missing the two new variables. I simply added these with default values.

* fixed syntax error in test_recorder_setup_failure

* fixed formatting error in test_init_py for recorder component

* fixed typo in test case

* Updated the way the default keys for db_,max_wait and db_retry_wait is set

Implemented based on suggestions from @springstan

* Updated config_schema call to adhere to Black

* changed conf.get to conf[dict] for var retrieval

* removed 2 blank lines
2020-02-09 17:43:09 +01:00
Paulus Schoutsen 989dd32258
Hue to retry if hub errors out (#31616)
* Respect semaphore

* Add retries when connection reset

* Also catch OSError from aiohttp when authenticating
2020-02-08 13:20:37 -08:00
Paulus Schoutsen 111050bea9
Clean up core services (#31509)
* Clean up core services

* Fix conversation test
2020-02-08 13:10:59 +01:00
escoand 0823ee4385
Fix exceptions when using newer Samsung TVs (#31602)
* try to fix websocket problems

* use tuple

* catch websocket exceptions

* typo
2020-02-08 12:03:35 +01:00
elmurato 699d6ad658
Add Minecraft Server Integration (#30992)
* Add Minecraft Server integration

* Add unit test for config flow

* Fixed some review findings and increased unit test coverage

* Fixed docstrings of new test cases

* Removed unnecessary debug log messages

* Added unique IDs and device infos and removed duplicate name validation

* Attempt to fix unit test on CI

* Return state OFF instead of UNAVAILABLE in case connection to server drops

* Added property decorator to server properties, even less debug messages, improved sensor dispatcher connection and other review findings fixed

* Moved special property handling to sensors, fixed name confusion in sensor entity, switch to HA const for scan_interval, simplified building players list string

* Improved periodic update, speeded up unit tests

* Added type hints, added callback decorator to entity update callback, added const.py to unit test exclusions

* Changed state sensor to binary sensor, removed empty unit test file, added constants for icons and units

* Let HA handle unknown state, check for None in description and players list sensor

* Removed periods at end of log messages, removed constant for default host

* Updated requirements_test_pre_commit.txt, fixed codespell findings

* Use localhost as default host

* Removed passing hass to entities, moved log message from init, moved host lower to vol, use proper patch library, patch library instead of own code

* Replaced server properties with global instance attributes, removed config option scan_interval, switch back to async_track_time_interval

* Removed description and players list sensors, added players list as state attributes to online players sensor, raise OSError instead of deprecated IOError, other minor review findings fixed

* Use MAC address for unique_id in case of an IP address as host, added getmac to manifest.json, added invalid_ip to strings.json, added new test cases for changes in config_flow, replace all IOError's with OSError, other review findings fixed

* Removed double assignment

* Call get_mac_address async safe

* Handle unavailable and unknown states to reach silver quality scale, added quality scale to manifest.json
2020-02-08 09:28:35 +01:00
Paulus Schoutsen 0d474e1183
Update the update coordinator API to make it easier to use (#31471)
* Update the update coordinator API to make it easier to use

* failed_last_update -> last_update_success
2020-02-06 09:29:29 -08:00
Franck Nijhof 7233048fea
Limit OAuth scopes for Netatmo and Home Assistant Cloud (#31538)
* Limit OAuth scopes for Netatmo and Home Assistant Cloud

* Fix tests by making order of scopes predictable
2020-02-06 17:00:27 +01:00
Paulus Schoutsen a3b3924e21
Update link when IO in event loop (#31519) 2020-02-06 11:37:35 +01:00
Malte Franken 8d429d7676
Add GDACS feed integration (#31235)
* initial version of gdacs integration

* updated translations

* generated files

* added abbreviation

* bumped library version

* small feed entry attribute fixes

* add unit tests

* need to use original mdi name

* bumped library version

* improved entity name for earthquakes

* round vulnerability number

* typo

* support for categories

* testing support for categories

* tie longitude and latitude together

* validating categories

* simplifying setup

* passing domain as parameter

* simplified test setup

* moved test code

* simplified test code

* removed superfluous code

* changed approach to unique identifier

* changed code structure

* simplified unit system handling

* made schema a constant

* comment added

* simplifying code

* added message if location already configured

* removed unnecessary code

* simplified test code

* avoid mocking __init__

* pylint

* simplified code

* fetch categories from integration library

* setting PARALLEL_UPDATES

* setting PARALLEL_UPDATES to zero/unlimited

* added quality scale
2020-02-06 11:32:30 +01:00
Paulus Schoutsen 8d2086d076
Sonos services to work without admin access (#31506) 2020-02-05 15:50:20 -08:00
Paulus Schoutsen 481ea0aa5b
Check for known Hue vulnerability (#31494) 2020-02-05 13:57:17 -08:00
dupondje 557f5763df
Add belgian meter and rename some dsmr sensors (#30121)
* Add support for belgian meter and rename some sensors

* DSMR Fixes

* Add test

* More tests

* Adjust test to latest dev

* Remove unused code

* Depend on dsmr_parser 0.18
2020-02-05 22:14:03 +01:00
Paulus Schoutsen 472fe7a0fa
Fix Google API key test (#31492) 2020-02-05 09:50:00 -08:00
Paulus Schoutsen 84cbcb4d16
Remove tests for deprecated key (#31491) 2020-02-05 09:00:20 -08:00
Paulus Schoutsen 67680bcfa8
Automation device/entity extraction to include triggers + conditions (#31474)
* Add support for extracting triggers

* Add support for extracting triggers

* Fix test
2020-02-05 16:52:21 +01:00
Franck Nijhof 431a3a6b44
Re-branding of Hass.io panel to Supervisor (#31480) 2020-02-05 11:04:17 +01:00
Paulus Schoutsen c85a7934ed
Add brightness_step to light.turn_on (#31452)
* Clean up light turn on service

* Add brightness_step to turn_on schema

* Fix import

* Fix imports 2

* Fix RFLink test
2020-02-04 16:13:29 -08:00
Paulus Schoutsen e970177eeb
Use entity.async_request_call in service helper (#31454)
* Use entity.async_request_call in service helper

* Clean up semaphore handling

* Address comments

* Simplify call entity service helper

* Fix stupid rflink test
2020-02-04 15:30:15 -08:00
Paulus Schoutsen f41623ca64
Log warning when entities referenced in service call not found (#31427)
* Raise entities not found error

* Make it a warning, not an error

* Add support for MATCH_ENTITY_NONE

* Fix lint

* Fix tests
2020-02-04 14:42:07 -08:00
Quentame 201ea2557e
Add config flow to Meteo-France (#29927)
* Add config flow to Meteo-France

* Review 1

* Use config_entry.unique_id

* Fix config_flow _show_setup_form + init

* Remove empty *_setup_platform()

* Avoid HomeAssistantError: Entity id already exists: sensor.[city_name]_[sensor_type]. Platform meteo_france does not generate unique IDs

- when multiple district in one city

* Review + abort when API error

* Fix I/O

* Remove monitored_conditions

* Add async_unload_entry

* Review 3

* Fix pipe

* alert_watcher is already None

* Review 4

* Better fix for "Entity id already exists"

* Whoops, fix tests

* Fix string
2020-02-04 22:37:59 +01:00
Raman Gupta 1efea50654
Update vizio host check to handle entries that don't have port (#31463)
* Update vizio host check to handle entries that don't have port

* add comment explaining no_port test for future

* remove _name_is_same function and support user updating name in config

* Update strings.json

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-02-04 11:31:03 -08:00
ochlocracy 4602d7370c
Remove Alexa.InputController from devices without supported inputs in Alexa (#31450)
* Yield Alexa.InputController only for supported inputs.

* Add Comment.

* Comment fix.
2020-02-03 16:19:40 -08:00
Bas Nijholt 119566f280
Keep track of the derivative for unit_time (#31397)
* keep track of the derivative for unit_time

In this way, you will get a better estimate of the derivate during
the timescale that is relavant to the sensor.

This solved a problem where sensors have a low output resolution.
For example a temperature sensor that can only be integer numbers.

It might report many values that are the same and then suddenly go up one value.
Only in that moment (with the current implementation) the derivative will be finite.

With my proposed implementation, this problem will not occur, because it takes the average
derivative of the last `unit_time`.

* only loop as much as needed

* treat the special case of 1 entry

* add option time_window

* use cv.time_period

* fix comment

* set time_window=0 by default

* rephrase comment

* use timedelta for time_window

* fix the "G" unit_prefix and add more prefixes

https://en.wikipedia.org/wiki/Unit_prefix

* add debugging lines

* simplify logic

* fix bug where the there was a division of unit_time instead of multiplication

* simplify tests

* add test_data_moving_average_for_discrete_sensor

* fix test_dataSet6

* improve readability of the tests

* better explain the test

* remove debugging log lines
2020-02-03 14:22:47 -08:00
ochlocracy c8d9b83b24
Update StepSpeaker and Speaker interfaces in Alexa (#31444)
* Yield only one Speaker interface.

* Yield PowerController only is supported.

* Revert "Yield PowerController only is supported."

This reverts commit c0dbf7e4

* Add Alexa.Speaker interface properties.

* Refactor tests for Alexa.Speaker and Alexa.StepSpeaker.

* Code Smell Change.

* Fix R1705: Unnecessary "elif" after "return".
2020-02-03 14:20:39 -08:00
escoand 4550968316
Samsung TV refinements (#31248)
* use st not deviceType

* show model in flow title

* Update strings.json

* add re-auth to entity

* add re-auth to config_flow

* handle auth popup better

* use media player domain const

* fix tests

* rename not_found to not_successful

* authz not authn

* Update media_player.py

* Update config_flow.py

* Update media_player.py

* Update test_media_player.py

* finalize re-auth

* fix ssd tests

* better naming

* fix ip-address-mock serialization

* fix turn_on_action serialization

* add type of hass object

* fix acces denied test

* remove half-added typing

* async get ip address

* fix pylint
2020-02-03 20:34:02 +01:00
tetienne 8bc77f0421
Add color to light template (#31435)
* Add color support to light template

* Add tests about color support
2020-02-03 08:27:01 -08:00
Raman Gupta ee927fbc9e
Bump pyvizio version and add additional device info (#31417)
* bump pyvizio version and add additional device info

* add patches for get_model and get_version

* change keywrod argument to positional for _test_service
2020-02-03 08:41:58 +01:00
Paulus Schoutsen 7687ac8b91
Fix service annotations (#31402)
* Fix service annotations

* Filter area_id from service data

* Fix services not accepting entities

* Typo
2020-02-02 15:36:39 -08:00
Paulus Schoutsen 81dbdc6b9c
Add dump service to MQTT integration (#31370)
* Add dump service to MQTT integration

* Lint
2020-02-02 15:01:51 -08:00
Martin af105d2d61
Emulated Hue + Alexa: Fix devices not discovered and error response (#30013 & #29899) (#31413)
* Revert "Emulated Hue: changed the reported fallback device-type to fix Alexa compatibility issues (#30013)"

This reverts commit ddc8d9e25c.

* Revert "Emulated Hue: updated tests (#30013)"

This reverts commit 90df461e75.

* Emulated Hue + Alexa: changed the fallback device-type again to "Dimmable Light" (#30013) after collective debugging; fixed brightness for on/off-devices and scripts to prevent "device malfunction" response from Alexa (#29899)

* Emulated Hue + Alexa: lint (#30013, #29899)
2020-02-02 14:52:00 -08:00
Franck Nijhof 826433b680
Fix device name Google Assistant when using aliases (#31416)
* Fix device name Google Assistant when using aliases

* Adjust cloud tests
2020-02-02 14:48:13 -08:00
Robert Svensson 883b8f21ce
deCONZ - Library cleanup (#31410)
* Follow library changes

* Bump dependency to v70

* Fix test
2020-02-02 19:07:20 +01:00
Paulus Schoutsen 7127310f10
Catch device not found in device automations (#31401) 2020-02-02 07:13:07 -08:00
FrengerH 704cfcf235
deCONZ - Fix magic cube awake gesture (#31403) 2020-02-02 12:54:59 +01:00
ochlocracy e796de6c59
Filter int in fan speed_list when yielding RangeController in Alexa (#31375)
* Allow for int in fan speed_list.

* Test for int in fan speed_list.

* prevent yielding preset for int labels.
2020-02-01 16:44:40 -08:00
Bernhard B 294c6a713f
Support multiple attachments in signal messenger integration (#31141)
* added support for multiple attachments to signal_messenger integration

* updated pysignalclirestapi version in requirements_all.txt

* reworked multiple attachments feature in signal_messenger integration

* stay backwards compatible by both allowing the "attachment" and
  the "attachments" attribute.

* reworked multiple attachments feature in signal_messenger integration

* stay backwards compatible by both allowing the "attachment" and
  the "attachments" attribute.

* small change in signal_messenger integration

* added deprecation warning for 'attachment' attribute

* small changes in signal_messenger integration

* use 'warning' instead of 'warn' when logging the warning message

* re-generated requirements_test_pre_commit.txt

* added tests for signal_messenger integration

* regenerated requirements_test_all.txt for signal_messenger integration

* added more signal_messenger tests

* remove signal_messenger integration files from .coveragerc
2020-02-01 14:21:16 -08:00
Paulus Schoutsen c67f53dc43
Remove hour delay before checking for updates (#31368)
* Check for updates at startup

* Add 100% test coverage for update_coordinator

* Address comments
2020-02-01 08:14:28 -08:00
Robert Svensson b373c202c9
deCONZ - Add support for new switch type (#31362) 2020-02-01 17:08:49 +01:00
Paulus Schoutsen 166d770ddd
Update Hue data fetching (#31338)
* Refactor Hue Lights to use DataCoordinator

* Redo how Hue updates data

* Address comments

* Inherit from Entity and remove pylint disable

* Add tests for debounce
2020-01-31 14:47:40 -08:00
Robert Svensson 44f0728c60
Axis - Use core to start component tests (#31328)
* Fix test according to Martins comment in 31286

* Use core features rather than integration specific

* Fix populate options test
2020-01-31 20:23:51 +01:00
Robert Svensson 958a867c11
UniFi integration move to push messaging (#31086)
* Rewrite UniFi integration to use push messaging

* Add signalling for new clients/devices

* Update list of known wireless clients when we get events of them connecting

* Reconnection logic for websocket

* Fix failing tests

* Bump requirement to v12

* Add new tests

* Update homeassistant/components/unifi/controller.py

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2020-01-31 20:23:25 +01:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Martin b22dfa119b
Emulated Hue: changed fallback device-type to fix Alexa compatibility issues (#30013) (#31330)
* Emulated Hue: changed the reported fallback device-type to fix Alexa compatibility issues (#30013)

* Emulated Hue: updated tests (#30013)
2020-01-30 23:30:13 -08:00
Robert Svensson a8374cf423
UniFi - Try to discover local controller (#31326)
* Its working

* Use "unifi" as default host if a controller can be found

* Fix tests

* Make a fixture of patching the discovery function
2020-01-30 23:06:43 +01:00
Robert Svensson 56657fa859
Axis - config flow use new helper functions (#31286)
* Make use of new config flow helpers
Simplify Axis entry config to work with config flow helpers

* Keep old device data for rollback purposes
2020-01-30 22:20:30 +01:00
Raman Gupta 73ea34e417
Update media_player and add tests to qualify vizio integration for platinum quality score (#31187)
* add media player test and update media player logic to qualify vizio for platinum quality score

* add SCAN_INTERVAL and log message once when device goes from available to unavailable and vice versa

* move test constants into one file to avoid defining dupes in each test file

* move constant to shrink diff

* move pytest fixtures to conftest.py

* remove commented out code

* move unload test to test_init

* updates to tests and logging based on review

* bypass notification service

* add fixture so component setup makes it through config flow

* split failure tests into two

* fix setup and entity check for test_init and setup failures in test_media_player

* make domain references consistent across test files

* remove logging steps that were introduced to help debug

* move common patches out to new fixture and use config entry everywhere appropriate

* fix docstring

* add test for update options to increase code coverage

* add one more assert

* refactor test_media_player to move boiler plate logic out of each test into _test_init function

* final refactor of test_media_player to move repeat logic into separate function

* update docstrings

* refactor setup failure tests to move shared logic into private function

* fix last new functions code to use variable instead of static config variable

* remove trailing comma

* test that volume_step gets properly passed to Vizio volume function

* fix comment language

* assert with unittest.mock.call in _test_service and use config_entries.async_setup instead of config_entries.async_add

* replace config_entries.async_add with config_entries.async_setup everywhere

* simplify if statement for argument assertion

* fix logging based on style guide

* remove accidentally committed changes

* update scan interval to something more reasonable and add tests for availability changes

* change filter function to list comprehension, simplify log messages, remove default entity id from logs since it is user configurable, fix docstrings
2020-01-30 22:13:45 +01:00
Rick 3718b25bd9
Add opening and closing states to MQTT covers (#31259)
* Added support for the opening and closing states to MQTT covers

* Processed PR feedback on MQTT cover changes

* Add missing MQTT abbreviation to fix failing tests

* Fixed typo in MQTT abbreviations

* Added mqtt set cover position optimistic test
2020-01-30 21:14:46 +01:00
Rami Mosleh 9432054066
Rework Mikrotik device scanning following Unifi (#27484)
* rework device scanning, add tests

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* rework device scanning, add tests

* update requirements and coverage

* fix description comments

* update tests, fix disabled entity updates

* update librouteros to 3.0.0

* fix sorting

* fix sorting 2

* revert to 2.3.0 as 3.0.0 requires code update

* fix requirements

* apply fixes

* fix tests

* update hub.py and fix tests

* fix test_hub_setup_failed

* rebased on dev and update librouteros to 3.0.0

* fixed test_config_flow

* fixed tests

* fix test_config_flow
2020-01-30 10:21:51 -08:00
Paulus Schoutsen 33361f8580
Fix HTTP config serialization (#31319) 2020-01-30 09:47:16 -08:00
Paulus Schoutsen d24e397a80
Handle service calls that do not refer entity IDs (#31317) 2020-01-30 09:28:06 -08:00
Paulus Schoutsen da14e2927f
Removes I/O from linky tests (#31299) 2020-01-29 21:59:24 -08:00
Alan Tse cf0e467150
Change scan_interval defaults for Tesla (#31194) 2020-01-29 20:15:47 -05:00
Paulus Schoutsen 01dad31adc
Fix service helper not handling sync methods (#31254)
* Fix service helper not handling sync methods

* Add legacy support for returning coroutine objects

* Fix tests

* Fix tests

* Convert demo cover to async
2020-01-29 16:27:25 -08:00
Robert Svensson 111fc1fa8e
Use all new helper functions (#31278) 2020-01-29 16:21:23 -08:00
Paulus Schoutsen 424e15c7a7
Find related items scripts/automations (#31293)
* Find related items scripts/automations

* Update manifest
2020-01-29 16:19:13 -08:00
Paulus Schoutsen 881437c085
Catch error when searching for scenes or automations (#31288) 2020-01-29 14:46:48 -08:00
Paulus Schoutsen e9e44dbd97
Fix callback and async (#31281)
* Fix callback and async

* Fix a return

* Fix test

* Fix mqtt tests

* Fix some more callbacks
2020-01-29 13:59:45 -08:00
Jeff Irion 31dc2ad284
Allow filtering of sources for Android TV (#30994) 2020-01-29 14:13:09 -06:00
David F. Mulcahey f4a4c6bea5
ZHA group and device cleanup (#31260)
* add dispatching of groups to light
* added ha device registry device id
* added zha group object
* add group event listener
* add and remove group members
* get group by name
* api cleanup
* clean up get device info
* create and remove zigpy groups
* clean up create and remove group api
* use device id
* use device id
* cleanup
* update test
* update tests to allow group events to flow
2020-01-29 12:24:43 -05:00
Pascal Vizeli 6bbb713013
Fix tests for opnsense (#31277) 2020-01-29 18:18:24 +01:00
ochlocracy 83dff16e1e
Add support for rangeValueDeltaDefault in Alexa AdjustRangeValue directive (#31258)
* Update tests with rangeValue and rangeValueDelta to use int.

* Add support for rangeValueDeltaDefault for covers.

* Update tests for range changes.

* Test for AdjustRangeValue with rangeValueDeltaDefault True.

* Update tilt error.
2020-01-29 09:04:57 -08:00
ochlocracy 7116c7404a
Add PowerController to covers in Alexa (#31265)
* Add PowerController to covers.

* Comment Fix.

* Update test device_class.

* Update Comment.
2020-01-29 09:03:20 -08:00
Matthew Treinish 85dbf1ffad
Add OPNSense device tracker (#26834)
* Add OPNSense device_tracker

This commit adds a new component for using an OPNSense router as a
device tracker. It uses pyopnsense to query the api to look at the
arptable for a list of devices on the network.

* Run black formatting locally to appease azure

* Apply suggestions from code review

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Fix issues identified during code review

This commit updates several issues found in the module during code
review.

* Update homeassistant/components/opnsense/__init__.py

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>

* Update CODEOWNERS for recent changes

* Fix lint

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>

* More fixes from review comments

This commit fixes several issues from review comments, including
abandoning all the use of async code. This also completely reworks the
tests to be a bit clearer.

* Revert tests to previous format

* Add device detection to opnsense device_tracker test

This commit adds actual device detection to the unit test for the setup
test. A fake api response is added to mocks for both api clients so that
they will register devices as expected and asserts are added for that.

The pyopnsense import is moved from the module level to be runtime in
the class. This was done because it was the only way to make the
MockDependency() call work as expected.

* Rerun black

* Fix lint

* Move import back to module level

* Return false on configuration errors in setup

This commit updates the connection logic to return false if we're unable
to connect to the configured OPNsense API endpoint for any reason.
Previously we would not catch if an endpoint was incorrectly configured
until we first tried to use it. In this case it would raise an unhandled
exception. To handle this more gracefully this adds an api call early in
the setup and catches any exception raised by that so we can return
False to indicate the setup failed.

* Update tests

* Add pyopnsense to test requirements

* Rerun gen_requirements script

* Fix failing isort lint job step

Since opening the PR originally yet another lint/style checker was added
which failed the PR in CI. This commit makes the adjustments to have
this pass the additional tool's checks.

* Fix comment

* Update manifest.json

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-01-29 16:20:43 +01:00
Quentame ec4ccb10ec
Bump iCloud to 0.9.2 + fix setup log (#31273)
- pyicloud to 0.9.2
- fix log `ERROR (MainThread) [homeassistant.config_entries] icloud.async_setup_entry did not return boolean`
2020-01-29 15:16:54 +01:00
Rafał Słota 080827fb62
Fix light.turn_on for emulated_hue (#31195)
* Fix light.turn_on for emulated_hue

HarmonyHub sends `{'xy': [0, 0], 'on': True, 'bri': 0}` when turning on lights that do not support brightness control. Unfortunately current logic always uses  brightness value to control on/off state which makes no sense for lights that don't support brightness at all. This change fixes that behavior, making light without brightness control usable with HarmonyHub and probably some other remotes.

* Test 'no_brightness' lights
2020-01-29 12:11:22 +01:00
Alexei Chetroi 37af2170ec
Mark device unavailable when it leaves Zigbee network. (#31264) 2020-01-28 21:21:33 -05:00
Franck Nijhof fd4f8d92d2
Upgrade dsmr_parser to 0.18, re-enable tests (#31256) 2020-01-28 23:35:28 +01:00
Paulus Schoutsen 8ceef72853
Google Assistant: Track if request is local (#31226)
* Track if request is local

* Cancel early if 2FA disabled

* Allow disabling 2FA for ack

* Do not mark devices with 2FA as reachable

* Add request source to GA events
2020-01-28 10:54:39 -08:00
SukramJ ec2d378a19 Add test for adding a device to HomematicIP Cloud (#31224)
* Add test for adding a hmip device

* refactor get_mock_hap to use config_entry setup

* remove unused parameters
2020-01-28 08:44:30 +01:00
Alexei Chetroi 9d8b4de09c Update ZHA entity discovery tests (#31191)
* ZHA registry test fixtures refactoring.

* Update ZHA test devices list.

* Use channel.id for event relay channels test.

* Add zigpy_device factory fixture.

* Add node descriptor to mock zigpy devices.

* Use node descriptor for ZHA device tests.

* Update ZHA discovery test.

check for unique_id and channels passed into each entity.

* Address comments.
2020-01-27 19:43:26 -05:00
Paul Daumlechner ed970797be Fix attribute in Alexa service call for cover tilt (#31223)
* Update attribute in Alexa service call for cover tilt

* Update Tests to fix Tilt Position call.

Co-authored-by: ochlocracy <5885236+ochlocracy@users.noreply.github.com>
2020-01-27 19:28:40 -05:00
SukramJ 1dbfc66669 Cleanup of HomematicIP Cloud tests (#31181)
* CleanUp tests for HomematicIP_Cloud

* Remove not required CoroutineMock

* remove None return in mocks, add asserts

* rewrite test
2020-01-27 21:34:15 +01:00
Christian Clauss 1d537ad416 Fix typo: serivce --> service (#31217) 2020-01-27 19:56:26 +01:00
Ron Klinkien 4e2737bfb7 Add Garmin Connect integration (#30792)
* Added code files

* Correctly name init file

* Update codeowners

* Update requirements

* Added code files

* Correctly name init file

* Update codeowners

* Update requirements

* Black changes, added to coveragerc

* Removed documentation location for now

* Added documentation url

* Fixed merge

* Fixed flake8 syntax

* Fixed isort

* Removed false check and double throttle, applied time format change

* Renamed email to username, used dict, deleted unused type, changed attr name

* Async and ConfigFlow code

* Fixes

* Added device_class and misc fixes

* isort and pylint fixes

* Removed from test requirements

* Fixed isort checkblack

* Removed host field

* Fixed coveragerc

* Start working test file

* Added more config_flow tests

* Enable only most used sensors by default

* Added more default enabled sensors, fixed tests

* Fixed isort

* Test config_flow  improvements

* Remove unused import

* Removed redundant patch calls

* Fixed mock return value

* Updated to garmin_connect 0.1.8 fixed exceptions

* Quick fix test patch to see if rest is error free

* Fixed mock routine

* Code improvements from PR feedback

* Fix entity indentifier

* Reverted device identifier

* Fixed abort message

* Test fix

* Fixed unique_id MockConfigEntry
2020-01-27 09:12:18 -08:00
Quentame a73a1a4489 Use config_entry.unique_id in Linky (#31051)
* Use config_entry.unique_id in Linky

* Reviews

* _show_setup_form not async
2020-01-27 08:57:36 -08:00
ktnrg45 d3ac3e48a3 Fix ps4 errors if pin begins with a 0 (#31198)
* Fix errors if pin begins with a 0

* Test PIN leading with zero

* Edit tests
2020-01-27 10:32:14 -05:00
Ron Klinkien 50b0e938e1 Added missing file (#31189) 2020-01-27 12:52:58 +01:00
Franck Nijhof 050e4afdc0
Disable failing dsmr tests (#31202)
* Disable failing dsmr tests

* Disable module, disable import of missing dep
2020-01-27 11:13:36 +01:00
Paulus Schoutsen 1f0f62de7f
Add unique IDs to automation/scenes (#31150)
* Add unique IDs to automation and scenes

* Fix typo
2020-01-26 23:01:35 -08:00
SukramJ 1b3c4ed4b3 Use unique_id for config_entries of HomematicIP Cloud (#31133)
* use hapid as unique_id for config_entry of HomematicIP Cloud

* Add qualita_scale to manifest

* Update config_flow

* use core interface for config_flow tests

* refactor to fail earlier

* use asynctest

* rewrite tests

* rewrite tests

* fix test

* add assert
2020-01-26 14:54:33 +01:00
Jeff Irion cd72128a80 Implement 'volume_set' service for Android TV devices (#31161) 2020-01-26 10:39:19 +01:00
Alexei Chetroi 217e280f8b Update ZHA remotes registry to proper identify "remotes (#31146)
* Update ZHA remote device types.

* Remove `binary_sensor` entity from affected devices.

* Update ZHA Profiles.

Prevent DeviceType.ON_OFF_LIGHT_SWITCH from creating entities.

* Update tests and remove unused entities.
2020-01-25 12:42:19 -05:00
Ville Skyttä 98ac84349c
Fix Huawei LTE SMS recipient setting from options UI (#31117)
* Fix Huawei LTE SMS recipient setting from options UI

Refs https://github.com/home-assistant/home-assistant/issues/30827

* Use core interfaces in tests

* ...more
2020-01-25 13:09:43 +02:00
ochlocracy 0eee152386 Include supported states in Alexa SecurityPanelController configuration object (#31120)
* Update Security Panel Controller.

* Update Security Panel Controller.

* Sort imports.
2020-01-24 17:57:58 -08:00
Franck Nijhof 7e4b9adc3d
Rewrite of Spotify integration (#30717)
* Rewrite of Spotify integration

* Update homeassistant/components/spotify/config_flow.py

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

* Remove configurator dependency

* Strip whitespace from device model in case Spotify product is missing

* Ensure domain dict exists in hass data on setup entry

* Simply config validation for client id and secret

* Abort flow on any exception from spotipy

* Add tests for config flow

* Gen requirements all

* Add test package __init__

* Remove Spotify from coveragerc

* Made alias handling more robuust

* Fix supported_features for Spotify free and open accounts

* Improve error message in the logs

* Re-implement Spotify media_player

* Change media content type when play a playlist

* Process review suggestions

* Move Spotify init, static current user and supported_features

* Remove unneeded me call

* Remove playlist content type due to frontend issues

* Improve playlist handling, when context is missing

* Handle entity disabled correctly

* Handle being offline/unavailable correctly

* Bump Spotipy to 2.7.1

* Update coverage RC, mark integration silver

* Remove URI limitation, lib supports all Spotify URI's now

* Final cleanup

* Addresses Pylint error

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-24 18:47:22 +01:00
Franck Nijhof 4571cf01e2 Update Hue existing config entry with discovery data (#31087)
* Update Hue existing config entry with discovery data

* Updated method documentation comments

* Update implementation to match latest dev

* Use named argument for clarity
2020-01-24 09:07:53 -08:00
Desausoi Laurent 6ff572d1dd Add Buienradar camera for Belgium (#30399)
* Buienradar Camera for Belgium

* Voluptuous check for country code

* Black formatting

* Testing for Buienradar Belgium

* Changed MULTIPLE CHOICE variable name

* Changes from frenck review
2020-01-24 12:38:35 +01:00
Markus Pöschl 7fed328e1c Use speak2mary for MaryTTS integration and enable sound effects (#30805)
* Use speak2mary for MaryTTS integration and enable sound effects

* Replace static defaults for effects with user configured ones
2020-01-23 22:45:06 +01:00
Paolo Tuninetto fc95744bb7 Change Samsung TV state detection (#30236)
* Changed Samsung TV state detection

* Trying codecov fix

* Update Rewritten

* Changed update method

* Timeout handling

* Fixed autodetect tests

* Fixed last test

* Added test to complete codecov

* Removed state settings in send_key method

* Fixed pylint

* Fixed some tests

* codecov fix
2020-01-23 21:43:30 +01:00
Franck Nijhof b743f9b8f6 Add update_entry dict to unique ID flow abort helper (#31090)
* Add update_entry dict to unique ID flow abort helper

* Process review suggestions

* Process review suggestions

* Add additional test
2020-01-23 11:21:19 -08:00
tetienne 1a1ef7680d Add temperature support to light template (#30595)
* Add temperature support

* Use guard clause
2020-01-23 09:18:59 -08:00
Michael Dokolin 894b841a15 Fix HomeKit window covering to support float numbers in the position (#31081)
* Fix HomeKit window covering to support float numbers in the position

* Fix HomeKit window covering to cast current position to an integer value
2020-01-23 09:02:44 -08:00
Robin c71ae090fc Add sighthound integration (#28824)
* Add component files

* Add test state

* Adds person detected event

* Update CODEOWNERS

* Updates requirements

* remove unused datetime

* Bump sighthound version

* Update CODEOWNERS

* Update CODEOWNERS

* Create requirements_test_all.txt

* Address reviewer comments

* Add test for bad_api_key
2020-01-23 09:30:06 +01:00
Raman Gupta 192b656635 Code Cleanup for Vizio component (#31076)
* code cleanup

* dont use named arguments for positional arguments

* remove extra comma
2020-01-23 01:55:34 +01:00
Paulus Schoutsen 0fba9e44ed
Migrate zone to use collection helpers (#30774) 2020-01-22 12:36:25 -08:00
Maciej Bieniek 4c27d6b9aa Add zeroconf discovery support to Brother Printer integration (#30959)
* Add zeroconf discovery support

* Fix data for config_entry

* Add sting for zeroconf confirm dialog

* Add and fix tests

* Fix pylint errors

* Suggested changes

* Tests

* Remove unnecessary object

* Add error handling

* Remove unnecessary objects

* Suggested change

* Suggested change

* Use core interfaces for tests
2020-01-22 11:34:11 -08:00
ochlocracy 4015a046d2 Update AdjustRange Handler Service Calls. (#31016)
Add a AlexaGlobalCatalog value to all labels.
2020-01-22 11:04:31 -08:00
Josh Bendavid fae74f7ed7 Improve state tracking for WebOsTV (#31042)
* upgrade to aiopylgtv 0.3.0 and corresponding simplification and cleanup of webostv state tracking

* properly handle case where Live TV is not reported in list of apps

* fix tests (entity state is no longer linked to source id)

* fix pylint checks

* avoid unnecessary retrieval of channel list

* use only standard home assistant states
2020-01-22 19:06:08 +01:00
Paulus Schoutsen e5365779fe
Allow unloading mobile app (#30995) 2020-01-22 09:57:47 -08:00
Franck Nijhof db76b91ffa
Add disabled entities support to WLED (#31040) 2020-01-22 10:45:38 +01:00
Raman Gupta 463d949ee0 Add zeroconf discovery support for vizio integration (#30949)
* add missing tests

* readd removed test

* add zeroconf discovery support for vizio integration

* no mock_coro_func needed

* add reasonable timeout and don't log exceptions from pyvizio due to timeout

* add test to test options update and bump pyvizio to avoid timeout issues

* update requirements_*

* fix gaps in coverage

* change return hint for async_setup_entry

* use source variables instead of strings

* only get unique ID if about to create entry

* update based on review

* Revert "update based on review"

This reverts commit 0d612a90eb7d02c92061f902973e527267e3110a.

* f-string

* fix last review

* revert cleanup changes to simplify PR

* remove unnecessary ConfigFlow object variables to simplify logic

* revert cleanup changes to make review easier, noted for future cleanup

* revert cleanup changes to make review easier, noted for future cleanup

* move zeroconf service type constant to test module
2020-01-22 10:13:35 +01:00
Raman Gupta ee74f95371 Enhance info_from_service function in zeroconf integration (#31059)
* enhance zeroconf service info decoding to include raw bytes

* Update homeassistant/components/zeroconf/__init__.py

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

* fix test based on last commit

* fix test based on last commit

* remove .keys() when asserting processed and raw service info properties

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-21 21:24:59 -08:00
Joe Gross 3b4c3e6e17 Fix prometheus component to fully sanitize Unicode characters (#31037)
* Fix prometheus component to fully santize Unicode characters.

Sanitization used isdigit() to match numerics but that also matches 
Unicode "digit" characters that require special handling, like 
superscripts. Failures would look like this:

ValueError: Invalid metric name: sensor_unit_u0x23_per_m³

Changed sanitize to use string.digits, which matches only ascii digits, 
and added test.

See 
https://stackoverflow.com/questions/44891070/whats-the-difference-between-str-isdigit-isnumeric-and-isdecimal-in-python 
for discussion.

https://docs.python.org/3/library/stdtypes.html#str.isdigit

https://docs.python.org/3.7/library/string.html#string.digits

* fix formatting to comply with black
2020-01-22 01:03:42 +01:00
Abílio Costa 2aff913d9b Update pyipma to 2.0 (#30746)
* update ipma component for pyipma 2.0

* fix wind speed; refactor forecast

* update requirements*.txt

* fix tests; update CODEOWNERS; update pyipma to 2.0.1

* minor changes as suggested in PR

* make lint happy

* fix mocking coroutines

* restore old unique id

* fix station lat/lon; update pyipma version
2020-01-21 17:04:22 +01:00
Franck Nijhof fb35d382e1
Remove all empty *_setup_platform() from integrations (#31025)
* Remove all empty *_setup_platform() from integrations

* Fix tests for smartthings

* Fix tests for heos
2020-01-21 12:38:38 +01:00
Quentame 8c22858ae3
Use config_entry.unique_id in iCloud (#30984)
* Use unique_id in iCloud

* Remove missed self._configuration_exists()

* Avoid breaking change

* Almost fix tests

* Add missing test

* Fix tests
2020-01-20 18:59:29 +01:00
Ville Skyttä 5e2ba2eb77
Enable some more bandit checks (#30857)
* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Aaron Bach 9993333bf9 Add state reproduction to remotes (#30990) 2020-01-19 23:08:32 -08:00
Faucogney Anthony b2212ad445 Add Derivative component (#26456)
* create derivation component

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

add test case
fix test values
still a prefix issue that should not

* create derivation component

based on integration component
remove left and right

* Update test

(was'n saved)

* add some functionnal point test

* Change derivation to derivative

* Continue migration from derivation to derivative

* Add codeowners info

* fix tests typo and values

* Improve code from reviewer

add test case
fix test values
still a prefix issue that should not

* Update homeassistant/components/derivative/sensor.py

Fix test issue with unit of measurement

Co-Authored-By: Santobert <tobhaase@gmail.com>

* Fix review

Move ValueError to SyntaxError

* precise state test

* un comment original tests and remove error tests

* Fix isort issue

* Fix review

- update doc link
- migrate to general const import

* Rollback import conf_unit, just defined localy

Co-authored-by: Santobert <tobhaase@gmail.com>
2020-01-19 22:17:06 -08:00
Raman Gupta e535133016 Fix options update during import config flow step for vizio component (Bugfix for #30653) (#30977)
* fix options update logic during import

* add missing tests

* fix abort reasons and strings, add missing test

* combine steps when testing esn already exists

* readd removed test

* no mock_coro_func needed

* add block_until_done and assert entry options
2020-01-19 20:13:15 -08:00
Paulus Schoutsen 0c3ffbe282
Add foundation for integration services (#30813)
* Add foundation for integration services

* Fix tests

* Remove async_get_platform

* Migrate Sonos partially to EntityPlatform.async_register_entity_service

* Tweaks

* Move other Sonos services to media player domain

* Move other Sonos services to media player domain

* Address comments

* Remove lock

* Fix typos

* Use make_entity_service_schema

* Add area extraction to async_extract_entities

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-01-19 17:55:18 -08:00
Quentame 7c155731fc
Fix can't add multiple iCloud accounts (remove account name) (#30898)
* Fix can't add multiple iCloud accounts (remove account name)

* Update tests with flow.async_init()
2020-01-19 14:19:46 +01:00
Raman Gupta 8630a076a7 Use default media player device classes for vizio component (#30802)
* use media player defined device classes instead of custom ones, add options flow test, add timeout options parameter

* make options update error more generic

* fix config flow options update logic

* simplify logic for options update during import

* use platform list for load and unload

* update private config flow function name and description

* fix grammar in strings.json

* update mock config variable names to be more accurate

* remove timeout conf option, create device_class property

* update requirements

* update .coveragerc to indicate that config_flow has tests

* fix source of device_class property and move constants to const.py

* fix grammar in error message

* remove redundant device check in async_setup_entry since device connection is checked during config flow

* revert change to async_setup_entry, raise ConfigEntryNotReady if device can't be connected to

* update error text

* add more context to error text
2020-01-18 09:15:05 +01:00
Alexei Chetroi 3bf657284c
Refactor rounding for ZHA electrical measurement sensor (#30923) 2020-01-17 20:53:31 -05:00
Paulus Schoutsen 9f20185cee
Fix hue accepting filename (#30924) 2020-01-17 15:38:38 -08:00
Robert Svensson 7b29a498c6 Fix issue with group unique id when normalising bridge id (#30904) 2020-01-17 15:28:34 -08:00
ochlocracy 1d41cf96ca Fix Alexa semantics for covers with tilt support. (#30911)
* Fix Alexa semantics for covers with tilt support.

* Clarify wording.

* Korrect grammar.
2020-01-17 15:04:46 -08:00
Joakim Sørensen a5a69bdf71 Adds icon endpoint to NO_AUTH (#30910)
* Adds icon endpoint to NO_AUTH

* Add test for no_auth icon get

* Blackout
2020-01-17 13:54:28 -08:00
Aaron Bach 847196dbe8
Remove option to configure SimpliSafe scan interval (#30909)
* Enforce minimum scan interval for SimpliSafe

* Remove scan interval all together

* Fix tests
2020-01-17 13:43:41 -07:00
Alexei Chetroi 8a78b65f0d
Extract collection entity registry cleaner into a helper (#30844)
* Extract entity_registry_keeper into separate helper
* Refactor input_*, timer and person to use new helper.
* Make Mypy happy.
* Better name.
2020-01-17 11:41:46 -05:00
Paulus Schoutsen 7da84dca76
Reinstate and deprecate filename option for hue config (#30846) 2020-01-16 11:28:35 -08:00
Paulus Schoutsen e1205409f3 Handle location API being exhausted (#30798) 2020-01-16 17:31:12 +01:00
Alexei Chetroi d9d5e06baf
Use collection helpers for input_datetime component (#30815)
* Refactor input_datetime.
Keep the state as datetime, but format accordingly to has_time and
has_date.

* Use config dict for input_datetime.
* Add tests.
* Lint
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-16 09:16:57 -05:00
MatthewFlamm b8feaba5cb Update pynws to v0.10.1 (#30662)
* update to pynws 0.10.1

* remove unneeded raw json files

* move test helper module to const
2020-01-15 12:01:47 -08:00
ochlocracy bb42ff93f4 Add support for vacuums to Alexa. (#30764) 2020-01-15 09:15:31 -08:00
Paulus Schoutsen 1e82813c3b
Refactor Ring data handling (#30777)
* Refactor Ring data handling

* Add async_ to methods
2020-01-15 08:10:42 -08:00
Jc2k de26108b23 Restore unit_of_measurement from entity registry (#30780)
* Restore unit_of_measurement from entity registry

* Lint fix
2020-01-15 08:09:05 -08:00
Raman Gupta ac771addc1 Add Config Flow support, Device Registry support, available property to vizio component (#30653)
* add config flow support, device registry support, available property

* raise PlatformNotReady if HA cant connect to device

* remove test logging statement and fix integration title

* store import and last user input values so user can see errors next to value that caused error

* add PARALLEL_UPDATES

* add missing type hints

* add missing type hints to tests

* fix options config flow title

* changes based on review

* better key name for message when cant connect

* fix missed update to key name

* fix comments

* remove logger from test which was used to debug and update test function names and docstrings to be more accurate

* add __init__.py to vizio tests module

* readded options flow and updated main component to handle options updates, set unique ID to serial, fixes based on review

* pop hass.data in media_player unload instead of in __init__ since it is set in media_player

* update requirements_all and requirements_test_all

* make unique_id key name a constant

* remove additional line breaks after docstrings

* unload entries during test_user_flow and test_import_flow tests to hopefully reduce teardown time

* try to speed up tests

* remove unnecessary code, use event bus to track options updates, move patches to pytest fixtures and fix patch scoping

* fix comment

* remove translations from commit

* suppress API error logging when checking for device availability as it can spam logs

* update requirements_all and requirements_test_all

* dont pass hass to entity since it is passed to entity anyway, remove entity unload from tests, other misc changes from review

* fix clearing listeners

* use config_entry unique ID for unique ID and use config_entry entry ID as update signal

* update config flow based on suggested changes

* update volume step on config import if it doesn't match config_entry volume step

* update config_entry data and options with new volume step value

* copy entry.data and entry.options before updating when updating config_entry

* fix test_import_entity_already_configured
2020-01-15 11:43:55 +01:00
Alexei Chetroi 5fa7d6f22a Allow input_* and timer component setup without config (#30772)
* Allow input_boolean setup without config.

* Allow input_number setup without config.

* Allow input_select setup without config.

* Allow input_text setup without config.

* Allow timer setup without config.
2020-01-14 22:15:59 -05:00
Alexei Chetroi 0a7feba855 Use storage based collections for Timer platform (#30765)
* Use config dict for timer entity.

* Manage timer entities using collection helpers.

* Add tests.

* Make Timer duration JSON serializable.
2020-01-14 15:32:48 -08:00
Pascal Vizeli 4731f7c721
Hass.io allow to reset password with CLI (#30755)
* Hass.io allow to reset passwort with CLI

* Add improvments

* fix comments

* fix lint

* Fix tests

* more tests

* Address comments

* sort imports

* fix test python37
2020-01-14 23:49:56 +01:00
Paulus Schoutsen 5fdc60e067
Add Safe Mode (#30723)
* Store last working HTTP settings

* Add safe mode

* Fix tests

* Add cloud to safe mode

* Update logging text

* Fix camera tests leaving files behind

* Make emulated_hue tests not leave files behind

* Make logbook tests not leave files behind

* Make tts tests not leave files behind

* Make image_processing tests not leave files behind

* Make manual_mqtt tests not leave files behind
2020-01-14 13:03:02 -08:00
Paulus Schoutsen c4673ddee1
Update Ring to 0.6.0 (#30748)
* Update Ring to 0.6.0

* Update sensor tests

* update -> async_update

* Delete temp files

* Address comments

* Final tweaks

* Remove stale print
2020-01-14 12:54:45 -08:00
Franck Nijhof 6b49bea6c4 Fix HomeKit behavior with lights supporting color and temperature (#30756) 2020-01-14 07:09:35 -08:00
Maciej Bieniek 15645ab0c9 Add unique ID to Airly config entries (#30681)
* Add unique ID to Airly config entries

* Update tests

* Update tests

* Fix typo

* Remove unnecesary and undo changes in first test

* Suggested change
2020-01-13 13:28:07 +01:00
Franck Nijhof 6729902010 Fix discovery for oauth2 flow implementations (#30700)
* Fix discovery for oauth2 flow implementations

* Fix user step

* Add tests
2020-01-12 07:37:34 -08:00
SukramJ 4c5ea54df9 Fix Error with HomematicIP Cloud Cover (#30667) 2020-01-11 20:01:13 -08:00
Martin Hjelmare 030a399b09 Make hue config flow tests more robust (#30678)
* Make hue config flow tests robust

* Fix io on setup

* Update last tests
2020-01-11 20:00:49 -08:00
Martin Hjelmare 91f738127d Make met config flow tests robust (#30689)
* Make met config flow tests more robust

* Fix test with default form values

* Remove not needed test

* Clean create entry test

* Clean double test

* Clean last tests

* Fix docstring
2020-01-11 20:00:02 -08:00
Paulus Schoutsen 117efb5a04
Fix update person validation (#30691) 2020-01-11 19:59:43 -08:00
Bill Durr 4d6417295b ZHA cover device support (#30639)
* ZHA cover device support
* flake8
* flake8, black
* isort
* pylint
* more test
* use zigpy provided functions
* black
* handle command errors, better state handling
* black
* more test
* lint
* Update ZHA cover tests coverage.
Co-authored-by: Alexei Chetroi <lexoid@gmail.com>
2020-01-11 22:42:14 -05:00
Robert Van Gorkom a0b0dc0aca Optimistically set tplink light states (#30189)
* Optimistically handling state changes.
Using retries when command fail.

* Fixing endless update loop.

* Address PR comments.
2020-01-12 03:45:01 +01:00
Paulus Schoutsen abe727fbbc
Log error when integration is missing platform setup (#30690) 2020-01-11 18:21:57 -08:00
Robert Van Gorkom 672db9cfe9 Fixing unit of measure for withings hydration. Fixes #30570 (#30685) 2020-01-11 20:58:06 -05:00
Paulus Schoutsen 7073b0eb88
Upgrade Ring to new version (#30666)
* Upgrade Ring to new version

* Move legacy cleanup down

* Fix test
2020-01-11 16:04:39 -08:00
Alexei Chetroi 4972b249bf
Use collection helpers for input_text entities (#30633)
* Refactor input_text to use config dict.
* Use collections for input_text.
* Update homeassistant/components/input_text/__init__.py
Better logging names.
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/input_text/__init__.py
Correct artifacts.
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/input_text/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Cleanup.
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-11 17:37:39 -05:00
Ville Skyttä 62f53b656d Fix test_scenes_with_entity (#30684)
Don't assume any particular order for returned scenes; it's undefined
(currently uses dict values()).
2020-01-11 22:25:59 +01:00
Alexei Chetroi 7d506bc38b
Use storage collections for input_select entity management (#30604)
* Refactor input_select to use _config dict.
* Use collections for input_select.
* Add tests.
* Move async_setup to top.
* Cleanup.
* async_write_ha_state()
* Update homeassistant/components/input_select/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-11 11:37:57 -05:00
cgtobi e793ed9ab0 Refactor Netatmo integration (#29851)
* Refactor to use ids in data class

* Use station_id

* Refactor Netatmo to use oauth

* Remove old code

* Clean up

* Clean up

* Clean up

* Refactor binary sensor

* Add initial light implementation

* Add discovery

* Add set schedule service back in

* Add discovery via homekit

* More work on the light

* Fix set schedule service

* Clean up

* Remove unnecessary code

* Add support for multiple entities/accounts

* Fix MANUFACTURER typo

* Remove multiline inline if statement

* Only add tags when camera type is welcome

* Remove on/off as it's currently broken

* Fix camera turn_on/off

* Fix debug message

* Refactor some camera code

* Refactor camera methods

* Remove old code

* Rename method

* Update persons regularly

* Remove unused code

* Refactor method

* Fix isort

* Add english strings

* Catch NoDevice exception

* Fix unique id and only add sensors for tags if present

* Address comments

* Remove ToDo comment

* Add set_light_auto back in

* Add debug info

* Fix multiple camera issue

* Move camera light service to camera

* Only allow camera entities

* Make test pass

* Upgrade pyatmo module to 3.2.0

* Update requirements

* Remove list comprehension

* Remove guideline violating code

* Remove stale code

* Rename devices to entities

* Remove light platform

* Remove commented code

* Exclude files from coverage

* Remove unused code

* Fix unique id

* Address comments

* Fix comments

* Exclude sensor as well

* Add another test

* Use core interfaces
2020-01-11 12:20:00 +01:00
etheralm 5ffbf55170 Add support for Dyson TP06 fan (#30611)
* initial commit

* update manifest.json

* update CODEOWNERS

* remove unnecessary else

* add rest of asserts for TP06 state test
2020-01-11 10:41:52 +01:00
Alexei Chetroi 9c551ae85d
Use storage based collections for input_number entities (#30576)
* Use collections for input_number.
* Add tests.
* Typo fix.
* Make editable a public attribute.
* Move async_setup to top.
* Update homeassistant/components/input_number/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/input_number/__init__.py
Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>

* Cleanup.
* async_write_ha_state()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-10 23:27:41 -05:00
Alexei Chetroi 008dddb17c Fix ZHA temperature sensor restoration (#30661)
* Add test for restoring state for zha temp.

* Don't restore unit of measurement for ZHA sensors.

Properly restore ZHA temperature sensor state.
2020-01-10 20:30:58 -05:00
ochlocracy 605b0ceb5f Add support for variable fan speed list length. (#30574) 2020-01-10 17:26:37 -08:00
Jc2k 669c89e8c0 Fix HomeKit with entity registry restoration where supported_features is a non-None falsey (#30657)
* Fix homekit with #30094

* Fix test
2020-01-10 16:33:48 -08:00
ochlocracy 74a198e37b Implement TimeHoldController Interface in Alexa (#30650)
* Implement Alexa.TimeHoldController Interface

* Add test for timer resume directive.
2020-01-10 23:11:50 +01:00
Paulus Schoutsen 3f29c234b8
Add Ring config flow (#30564)
* Add Ring config flow

* Address comments + migrate platforms to config entry

* Migrate camera too

* Address comments

* Fix order config flows

* setup -> async_setup
2020-01-10 21:35:31 +01:00
Paulus Schoutsen 3348f4f6d1
Add search integration (#30511)
* Add search integration

* Add scenes and config entry support

* Update comments

* Add support for groups

* Allow querying config entry

* Update manifest

* Fix scene tests
2020-01-10 19:57:37 +01:00
Robert Svensson d883ee62f8 deCONZ - Disable daylight sensor by default (#30625)
* Dont enable daylight sensor by default

* Fix tests
2020-01-10 19:57:08 +01:00
escoand ef05aa2f39 Add Samsung TV config flow (#28306)
* add config flow

* add tests

* add user step error handling

* remove unload function

* add missing test file

* handle authentication correctly

* remove old discovery mode

* better handling of remote class

* optimized abort messages

* add already configured test for user flow

* Import order

* use ip property instead context

* Black

* small syntax

* use snake_case

* Revert "use ip property instead context"

This reverts commit 91502407eb216f8a0b1b90e3e6fb165b81406f8f.

* disable wrong pylint errors

* disable wrong no-member

* Try to fix review comments

* Try to fix review comments

* Fix missing self

* Fix ip checks

* methods to functions

* simplify user check

* remove user errors

* use async_setup for config

* fix after rebase

* import config to user config flow

* patch all samsungctl

* fix after rebase

* fix notes

* remove unused variable

* ignore old setup function

* fix after merge

* pass configuration to import step

* isort

* fix recursion

* remove timeout config

* add turn on action (dry without testing)

* use upstream checks

* cleanup

* minor

* correctly await async method

* ignore unused import

* async call send_key

* Revert "async call send_key"

This reverts commit f37057819f.

* fix comments

* fix timeout test

* test turn on action

* Update media_player.py

* Update test_media_player.py

* Update test_media_player.py

* use async executor

* use newer ssdp data

* update manually configured with ssdp data

* dont setup component directly

* ensure list

* check updated device info

* Update config_flow.py

* Update __init__.py

* fix duplicate check

* simplified unique check

* move method detection to config_flow

* move unique test to init

* fix after real world test

* optimize config_validation

* update device_info on ssdp discovery

* cleaner update listener

* fix lint

* fix method signature

* add note for manual config to confirm message

* fix turn_on_action

* pass script

* patch delay

* remove device info update
2020-01-10 03:19:10 +01:00
tiagofreire-pt 7052cdded1 Change nomenclature for Roborock fan speeds (#30614)
* Change nomenclature for Roborock fan speeds 

* Update test_vacuum.py

* Update test_vacuum.py
2020-01-09 23:49:13 +01:00
Malte Franken 4149bd653d Fix statistics sensor honouring max_age (#27372)
* added update listener if max_age is set

* remove commented out code

* streamline test code

* schedule next update based on the next state to expire

* fixed update process

* isort

* fixed callback function

* fixed log message

* removed logging from test case
2020-01-09 14:03:27 +01:00
Watchfox 6b7be35f4a Fix aurora sensor not converting latitude and longitude correctly (#28643) 2020-01-09 08:40:10 +01:00
Alistair Galbraith fe0b537291 Template alarm panel (#30487)
* Added support for template alarm panel

* Rewrote tests in new async format

* Fix stale docstring

* Update to tests, standardization on NAME vs FRIENDLY_NAME
2020-01-09 06:03:26 +01:00
Paulus Schoutsen ed6aef2fd7
Implement capability attributes (#30545)
* Implement capability attributes

* Fix HeOS update order

* Fix test
2020-01-08 21:22:56 +01:00
Santobert 3d7488d188 Trigger automation without skipping condition (#28484)
* Trigger automation without skipping condition

* [] instead of .get()

* Update __init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-08 10:36:11 +01:00
Robert Svensson 84a1afc785
deCONZ - Fix device automations (#30577) 2020-01-08 10:06:33 +01:00
Bram Kragten 16199b7a52 Add command to delete lovelace config (#30558)
* Add command to delete lovelace config

* Test + decorator for WS
2020-01-07 22:59:04 +01:00
Paulus Schoutsen 9aa02e35a7
Entity Component to no longer generate automatic groups (#23789) 2020-01-07 17:30:53 +01:00
tetienne 13e6479b6e Ease code before adding color and temperature to light template (#30455)
* Split async_update

* Use pytest parameters to avoid duplicate code

* Fix UnboundLocalError

* Test error rendering for template state

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-07 17:22:42 +01:00
SukramJ a4c830b5e4 Add reset_energy_counter service to Homematic IP Cloud (#30256)
* Add reset_energy_counter service to Homematic IP Cloud

* Fix isort

* Register service as admin service
2020-01-07 10:24:46 -05:00
Jeff Irion 73af75cb41 Catch UnicodeDecodeError exceptions in 'androidtv.adb_command' service (#30538)
* Catch UnicodeDecodeError exceptions in 'androidtv.adb_command' service

* Replace "adb_command" with SERVICE_ADB_COMMAND
2020-01-07 13:30:34 +01:00
Paulus Schoutsen c963128306 Upgrade to use new version of HASS-nabucasa (#30506)
* Upgrade to use new version of HASS-nabucasa

* Update hass-nabucasa to 0.31
2020-01-07 13:25:57 +01:00
Alexei Chetroi 6740249bef Use collection helpers for input_boolean (#30514)
* Refactor input_boolean to use config dict for instantiation.

* Refactor input_boolean to use YamlCollection.

* Add storage collection to input_boolean.

* Update homeassistant/components/input_boolean/__init__.py

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

* Doh.

* Address comments.

* Add editable device state attribute.

* Clean up entities from entity registry on removal.

Reload yaml from correct source.

* Add tests.

* Update homeassistant/components/input_boolean/__init__.py

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

* Don't reset entity state on updates.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-07 08:53:43 +01:00
Markus Nigbur 453f7c7294 Fire restarted event on restarting active timer (#30475)
* Fire restarted event on restarting active timer

* Added test for the restart event
2020-01-07 00:00:23 +01:00
Jeff Irion 5ec5df77cc Register 'androidtv.download' and 'androidtv.upload' services (#30086)
* Add tests

* Add FileSync test

* Fill in services.yaml for 'androidtv.adb_filesync' service

* Update example paths in services.yaml

* Bump androidtv to 0.0.37

* Bump androidtv to 0.0.37

* Bump androidtv to 0.0.37

* Import LockNotAcquiredException

* Import LockNotAcquiredException from androidtv.exceptions

* Rename 'host' to 'address'

* Add a logging statement when an ADB command is skipped

* Check hass.config.is_allowed_path(local_path)

* Add return

* Fix pylint

* Reduce duplicated code (AndroidTVDevice vs. FireTVDevice)

* Split 'adb_filesync' service into 'download' and 'upload' services

* Don't use '.get()' for required data; return if the services are already registered

* Replace "command" with ATTR_COMMAND

* Don't try to connect to a device if it is a duplicate
2020-01-06 23:10:13 +01:00
Paulus Schoutsen 05374d7c85
Fix google sync (#30524) 2020-01-06 22:00:39 +01:00
Maciej Bieniek 21029b1d7b Add Brother Printer integration (#30359)
* Init entities as unavailable when offline

* Initial commit

* Fix CODEOWNERS

* CODEOWNERS

* Run script.hassfest

* Add initial test

* Bump library

* More tests

* Tests

* Add new sensors and fix KeyError

* Fix unique_id and device_info

* Fix check for configured device

* More tests

* Bump library version

* Add uptime sensor

* Use config entry unique ID

* Run python3 -m script.gen_requirements_all

* Fix pylint error

* Remove pysnmp dependency

* Raise ConfigEntryNotReady when device offline at HA start

* Remove period from logging message

* Generator simplification

* Change raise_on_progress

* Rename data to printer

* Move update state to async_update

* Remove unused _unit_of_measurement

* Remove update of device_info

* Suggested change for tests

* Remove unnecessary argument

* Suggested change
2020-01-06 11:06:16 -06:00
Jc2k 8257ea30c0 Set required_features field when registering fan services (#30516)
* Set required_features on fan services

* Fix mqtt fan test

* Update fan.py
2020-01-06 17:10:51 +01:00
Jc2k a58c796641 Add support for homekit air quality sensors (#30510)
* Add air quality sensor

* Fix comment from review

* Fix comment from review

* Lint fix
2020-01-06 16:35:10 +01:00
SukramJ 0971c681af Add HmIP-PMFS and HmIP-WHS2 to HomematicIP Cloud (#30325)
* update test data

* Update homematicip_cloud.json

* Add HmIP-WHS2

* Add HmIP-PMFS
2020-01-06 08:35:41 -05:00
FrengerH 0d1da9f5cb deCONZ - Rotation support for Xiaomi magic cube (#30472)
* Added rotation to deconz magic cube event

* Device trigger support
2020-01-06 12:34:27 +01:00
Franck Nijhof e642d95d0f Migrate collection of component tests from coroutine to async/await (#30504) 2020-01-06 01:22:22 +01:00
Ville Skyttä f400b77837
Preserve new BLE tracker item name if seen before adding discovery (#30318)
* Preserve new BLE device name if one seen before the last scan but not on it

* Save an indented else block

* Use async_fire_time_changed and mock_device_tracker_conf in tests
2020-01-05 23:13:54 +02:00
Jc2k fffc5a5fbb Add support for v1 and v2 HomeKit fans. (#30503)
* Add support for v1 and v2 HomeKit fans.

* Lint fix
2020-01-05 15:56:46 +01:00
Franck Nijhof 0a9ac91dec Migrate automatic tests from coroutine to async/await (#30371)
* Migrate automatic tests from coroutine to async/await

* Remove unneeded side effect

* Replace unittest with asynctest, add additional asserts to tests
2020-01-05 07:23:22 -06:00
Ville Skyttä 5216477353
Be consistent with Home Assistant and Hass.io spelling (#30500)
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Paulus Schoutsen 24b25b8917
Restore state helper to work with entity registry restoration (#30451)
* Restore state helper to work with entity registry restoratino

* Update restore_state.py
2020-01-05 11:58:59 +01:00
Paulus Schoutsen 30076d1843
Add person reload service (#30493) 2020-01-05 11:16:37 +01:00
Robert Svensson 35e19eec18
Axis - Allow manual configuration to update existing configuration (#30467)
* Allow manual configuration to update existing configuration

* Harmonize tests

* Understand what Elupus means...
2020-01-05 10:11:17 +01:00
Paulus Schoutsen 95cd0a2c68
Mobile App add device tracker to person registering app (#30460) 2020-01-04 23:15:50 +01:00
Phil Bruckner e233dd7cbe Fix timer with empty config (#30463) 2020-01-04 23:01:58 +01:00
Robert Svensson 967fe89f6d deCONZ - Allow manual configuration to update existing configuration (#30469)
* Allow manual configuration to update existing configuration

* Harmonize tests
2020-01-04 22:55:57 +01:00
Franck Nijhof 4e62da9c8e Improve WLED pure white support for RGBW (#30477) 2020-01-04 22:52:10 +01:00
Franck Nijhof 51db9bdfce Add unique ID to WLED config entries (#30480)
* Add unique ID to WLED config entries

* Improve robustness of the tests
2020-01-04 22:48:31 +01:00
Franck Nijhof 3b14d9f375 Add unique ID to elgato config entries (#30486) 2020-01-04 22:45:11 +01:00
Franck Nijhof 4ea0754094 Fix WLED light transition (#30490) 2020-01-04 22:44:28 +01:00
Paulus Schoutsen 2f362b44c4 Allow adding unique device ID to mobile app registration (#30457)
* Allow adding unique device ID to mobile app registration

* Remove unknown data

* Better fix
2020-01-04 13:45:03 +01:00
Paulus Schoutsen 6e909ab3f1 Only return remote UI url if remote UI enabled (#30453) 2020-01-04 13:43:59 +01:00