Compare commits

..

413 Commits

Author SHA1 Message Date
Franck Nijhof
b2cd6707b6 0.105.0 (#31489)
0.105.0
2020-02-05 20:02:36 +01:00
Paulus Schoutsen
6a4d9d3a73 Fix Google API key test (#31492) 2020-02-05 18:57:43 +01:00
Paulus Schoutsen
1ee1a43fb9 Remove tests for deprecated key (#31491) 2020-02-05 18:02:53 +01:00
Franck Nijhof
f1d5fcac75 Bumped version to 0.105.0 2020-02-05 17:01:57 +01:00
Franck Nijhof
97250d8225 Re-branding of Hass.io panel to Supervisor (#31480) 2020-02-05 16:59:29 +01:00
Paulus Schoutsen
8b6b8f1994 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:59:24 +01:00
Quentame
2d393b8f8b Fix iCloud device battery level can be None (#31468) 2020-02-05 16:59:19 +01:00
Paulus Schoutsen
6d79898926 Fix coordinator reference (#31467) 2020-02-05 16:59:14 +01:00
Raman Gupta
2509518950 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-05 16:59:07 +01:00
Paulus Schoutsen
d411ae2503 Bumped version to 0.105.0b7 2020-02-04 09:29:39 -08:00
Bram Kragten
e5b6fbf374 Updated frontend to 20200130.1 (#31460) 2020-02-04 09:29:21 -08:00
etheralm
af75a4bc85 Update libpurecool upstream library to latest version (#31457)
* Update upstream library to latest version

* update version in requirements_all.txt

* update version in requirements_all.txt
2020-02-04 09:27:04 -08:00
Bas Nijholt
10d5ce24f6 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-04 09:27:03 -08:00
quthla
1008ab20ba Fix theme color (#31366) 2020-02-04 09:27:02 -08:00
escoand
2f2146c989 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-04 09:27:01 -08:00
Yarmo Mackenbach
9bb8b2bc00 Update NSAPI to 3.0.2 (#30971)
* Bump NSAPI version to 3.0.1

* Compatibility with NSAPI 3.0.1 response

* Removed commented code

* Obsolete setups receive an upgrade notification

* Bump NS-API to 3.0.2

* Assign platform values directly

* Removed obsolete config warning

* Improved reference to obsolete password
2020-02-04 09:27:00 -08:00
Paulus Schoutsen
13aae8b5ec Bumped version to 0.105.0b6 2020-02-02 20:31:39 -08:00
Rami Mosleh
04cb2e9fd5 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-02-02 20:25:45 -08:00
Paulus Schoutsen
4f79ec0c78 Bumped version to 0.105.0b5 2020-02-02 15:39:51 -08:00
Josh Bendavid
9dfc00898b always call set_volume with integer values (#31418) 2020-02-02 15:39:41 -08:00
Franck Nijhof
67e7541016 Fix device name Google Assistant when using aliases (#31416)
* Fix device name Google Assistant when using aliases

* Adjust cloud tests
2020-02-02 15:39:40 -08:00
Martin
2c1b465215 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 15:39:39 -08:00
akasma74
3cbd426c52 Fix rflink commands containing equals sign (#31412)
* new lib verson available

* new rflink lib version

* new rflink lib version
2020-02-02 15:39:38 -08:00
FrengerH
a54d5f0bc4 deCONZ - Fix magic cube awake gesture (#31403) 2020-02-02 15:39:37 -08:00
Paulus Schoutsen
5b7a65c5ea Fix service annotations (#31402)
* Fix service annotations

* Filter area_id from service data

* Fix services not accepting entities

* Typo
2020-02-02 15:39:37 -08:00
springstan
fb26dd3028 Revert "Bump alarmdecoder to 1.13.9 (#30303)" (#31385)
This reverts commit f11d39f8eb.
2020-02-02 15:39:36 -08:00
Robert Svensson
aaea55efed deCONZ - Services normalize bridge id (#31378)
* Services should also make sure to normalize bridge id since users do not know to manage themselves
2020-02-02 15:39:35 -08:00
ochlocracy
d91f9fc2f5 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-02 15:39:35 -08:00
Paulus Schoutsen
3b93065568 Add dump service to MQTT integration (#31370)
* Add dump service to MQTT integration

* Lint
2020-02-02 15:39:34 -08:00
Robert Svensson
59a9ca71ce deCONZ - Add support for new switch type (#31362) 2020-02-02 15:39:33 -08:00
springstan
11fcb2cc7f Fix auto_bypass in alarmdecoder (#30961)
* Fix auto_bypass in alarmdecoder

* Address review comments: used dict[key] and renamed variable

* Use dict[key] for required or optional config keys with default values
2020-02-02 15:39:32 -08:00
Paulus Schoutsen
d382b0ba42 Bumped version to 0.105.0b4 2020-02-01 00:29:29 -08:00
Dan Lehman
e1fd46d6db Updated wemo lights fix for #31360 (#31369) 2020-02-01 00:29:21 -08:00
Paulus Schoutsen
7ef352701c Bumped version to 0.105.0b3 2020-01-31 14:48:26 -08:00
Paulus Schoutsen
25d6bc348c Fix wemo device types for lights (#31360) 2020-01-31 14:48:20 -08:00
David F. Mulcahey
8f8468f016 bump quirks (#31355) 2020-01-31 14:48:19 -08:00
ochlocracy
f26cb83fd5 Protect for unknown state attributes. (#31354) 2020-01-31 14:48:18 -08:00
Franck Nijhof
7ee741d424 Partially Revert "Deprecate hide_if_away from device_tracker (#30833) (#31348) 2020-01-31 14:48:17 -08:00
Johann Kellerman
ec3dc3dd16 Upgrade pysma, fix #27154 (#31346) 2020-01-31 14:48:16 -08:00
Paulus Schoutsen
283cc5c8c3 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:48:16 -08:00
Pascal Vizeli
1aa322f2f0 Bump version to 0.105.0b0 2020-01-31 10:26:09 +00:00
Paulus Schoutsen
7b3dc42673 Fix incorrect annotation async flock notify (#31342)
* Fix incorrect annotation async flock notify

* Update notify.py

* Update notify.py

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-01-31 09:58:54 +00:00
Paulus Schoutsen
c6baf026a7 Guard for callbacks in service helper (#31339) 2020-01-31 09:24:02 +00:00
Phil Bruckner
a53c3d10fe Fix async bug in amcrest when registering services (#31334) 2020-01-31 09:24:00 +00:00
Martin
3635c4df50 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-31 09:23:58 +00:00
Paulus Schoutsen
73f27c728c Fix wemo lights (#31323) 2020-01-31 09:23:56 +00:00
Paulus Schoutsen
6b95e98eeb Guard Z-Wave light HS conversion on None (#31320) 2020-01-31 09:23:54 +00:00
Paulus Schoutsen
202fd4197b Bumped version to 0.105.0b1 2020-01-30 09:48:00 -08:00
Paulus Schoutsen
e91c32cb00 Fix HTTP config serialization (#31319) 2020-01-30 09:47:50 -08:00
Bram Kragten
af8b63fe31 Updated frontend to 20200130.0 (#31318) 2020-01-30 09:47:49 -08:00
Paulus Schoutsen
afe869bee9 Handle service calls that do not refer entity IDs (#31317) 2020-01-30 09:47:49 -08:00
Paulus Schoutsen
f55193c2da Add zone to defaul config (#31303) 2020-01-30 09:47:48 -08:00
Paulus Schoutsen
9db2ad1fd7 Add zones services.yaml (#31298) 2020-01-30 09:47:47 -08:00
Alexei Chetroi
268430a61d ZHA dependencies bump (#31295)
* ZHA dependencies bump.

* Bump bellows-homeassistant.
2020-01-30 09:47:47 -08:00
Paulus Schoutsen
6499feffa3 Bumped version to 0.105.0b0 2020-01-29 16:30:03 -08:00
Paulus Schoutsen
c4a8af06e0 Merge remote-tracking branch 'origin/master' into dev 2020-01-29 16:29:36 -08: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
ktnrg45
ee602e40a6 Add command 'ps_hold' to PS4 (#31283) 2020-01-29 22:57:40 +01:00
Bram Kragten
67b73bd74c Updated frontend to 20200129.0 (#31279) 2020-01-29 21:40:41 +01:00
Jeff Irion
31dc2ad284 Allow filtering of sources for Android TV (#30994) 2020-01-29 14:13:09 -06:00
Phil Bruckner
61e41f0ddc Add code owner for amcrest integration (#31276) 2020-01-29 11:50:18 -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
Jeff Irion
9312d06fe4 Catch 'ConnectionResetError' exceptions for Android TV integra… (#31274) 2020-01-29 15:18:57 +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
tetienne
fa15bead94 Remove useless assignment (#31272) 2020-01-29 14:08:53 +01:00
Alan Tse
a1e1610a69 Add device_class to Tesla sensors (#31231) 2020-01-29 13:22:04 +01:00
Thibault Maekelbergh
64edf2fe33 Create truly live unique id (#31078)
* Create truly live unique id

* Do not generate unique id on basis of name

* Add the station to the default station live name
2020-01-29 12:12:40 +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
Thomas
56c235d4f2 Fix example for set_datetime service (#31159) 2020-01-29 12:09:19 +01:00
Matthias Alphart
9ff9614d0b fix knx light turn_on with ct (#31184)
process both brightness and color_temperature in a turn_on call.
2020-01-29 12:07:25 +01:00
Franck Nijhof
c2f1d6aa19 Upgrade pre-commit to 2.0.0 (#31267) 2020-01-29 12:04:25 +01:00
Pascal Vizeli
28bfc6ae76 Update homeassistant-pyozw to 0.1.8 (#31270) 2020-01-29 12:04:05 +01:00
Daniel Perna
9902b648fb Add channel-mapping for HomeMatic (#31178)
* Update entity.py

* Fix Black

* Fix Black

* Update entity.py

* Use new style python

* Simplify

* Allow multible attribute with different channels

* Black

Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
2020-01-29 12:02:36 +01:00
Alan Tse
bcdef4e500 Fix reporting of battery sensor for Tesla (#31232)
* Fix reporting of battery sensor for Tesla

* Remove try
2020-01-29 08:58:43 +01:00
Bouwe Westerdijk
61a8618010 Fix Plugwise climate issues (#31209)
* Fix Plugwise climate issues

* Remove showing None-state for available_schemas, as requested by reviewer.
2020-01-29 08:57:25 +01:00
Bas Nijholt
89ae255de7 Bump pyhaversion to 3.2.0 (#31241)
* upgrade to pyhaversion=3.2.0

* bump to pyhaversion==3.2.0 in manifest.json
2020-01-29 08:54:21 +01:00
shred86
3ae5735e12 Bump abodepy version to 0.17.0 (#31250) 2020-01-29 08:53:30 +01:00
Robert Svensson
36675fe4fa deCONZ - New light level sensor attribute (#31255) 2020-01-29 07:40:42 +01:00
Alexei Chetroi
37af2170ec Mark device unavailable when it leaves Zigbee network. (#31264) 2020-01-28 21:21:33 -05:00
HomeAssistant Azure
2c02334c1f [ci skip] Translation update 2020-01-29 00:31:54 +00:00
Franck Nijhof
fd4f8d92d2 Upgrade dsmr_parser to 0.18, re-enable tests (#31256) 2020-01-28 23:35:28 +01:00
Franck Nijhof
747f5fd62c Upgrade iaqualink to 0.3.1 (#31257) 2020-01-28 23:33:27 +01:00
John Hollowell
c3cef7227c Add proxmoxve SSLError check and remove log spam (#30818)
* Add SSLError check and remove log spam

* Update homeassistant/components/proxmoxve/manifest.json

remove unnecessary requirement

* Remove log level change

Moved to proxmoxer library

* Update homeassistant/components/proxmoxve/__init__.py

* Update manifest.json

Update to new version of dependency which fixes log issue

* Run formatter and requires updates

* oops, tabs

* Fix quote marks

When you can't get black running, just fix whatever CI says is wrong!
2020-01-28 22:52:59 +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
brefra
03954be12d Add brefra to codeowners list Velbus integration (#31245)
* Add myself to codeowners list

* Add myself to CODEOWNERS file
2020-01-28 09:25:15 -05:00
Daniel Høyer Iversen
a9c43c6c62 Mill, correct hvac_mode. Fixes #31236 (#31242) 2020-01-28 11:58:37 +01:00
Pascal Vizeli
259a7e8490 Add gammu to wheels (#31239) 2020-01-28 09:41:50 +01:00
Oscar Calvo
d813618d0d Add Gammu based local SMS notifications (#31233)
* Add sms integration

Committer: ocalvo <oscar@calvonet.com>

* Fix PyLint

* Update requirements
2020-01-28 09:35:41 +01: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
HomeAssistant Azure
6daec557b4 [ci skip] Translation update 2020-01-28 00:31:59 +00: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
aaska
1f7ab9091b Bump python-synology to 0.4.0 : Add support for DSM v5 + fix sensors unknown for 15 min (#31049)
* updating new api version

* Added new configuration option for updated API
2020-01-27 22:38:00 +01: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
Paulus Schoutsen
ab8b94382e Update Hue discovery (#31215) 2020-01-27 10:54:38 -07:00
Aaron Bach
f95a072877 Constrain SimpliSafe's check for emergency token usage (#31214) 2020-01-27 10:50:16 -07: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
David F. Mulcahey
7d9c8fdfa0 update remove service (#31164) 2020-01-27 08:54:31 -05:00
Ron Klinkien
50b0e938e1 Added missing file (#31189) 2020-01-27 12:52:58 +01:00
Franck Nijhof
6be9a45333 Upgrade HAP-python to 2.7.0 (#31201) 2020-01-27 11:42:09 +01:00
Alan Tse
4f07ccd350 Fix unnecessary regeneration of access token in Tesla component (#31193)
* Fix unnecessary regeneration of access token

* Add manifest.json
2020-01-27 11:30:35 +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
Rohan Kapoor
52c1bc9c26 Check that documentation urls are valid (#31188)
* Check that documentation urls are valid

* Validate documentation url in pieces
2020-01-27 10:42:26 +01:00
starkillerOG
1278f32306 Add webostv sound_output capability (#31121)
* Webostv: add sound_output capability

Add the ability to read and set the sound_output

* Webostv: add sound_output capability

* Webostv: add sound_output capability

* fix blank spaces

* fix to long line

* add ,

* Import ATTR_SOUND_OUTPUT

Do not have the ability to test this change right now

* Add white space

* Create const.py

* Use const import

* Use import from const.py

* Add docstring

* Change order

* Change order

* Fix import

* Fix import

* Fix typo

* Change order again

* Change order again

* Change order of attributes
2020-01-27 10:40:48 +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
Ville Skyttä
8fff6462a1 Upgrade huawei-lte-api to 1.4.7 (#31155)
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.7
2020-01-27 08:50:01 +02:00
Aaron Bach
ac2172333c Use non-deprecated method of instantiating RainMachine client (#31149) 2020-01-26 18:01:59 -07:00
finnysamuel
9ba1a4a91a Bump aiobotocore to 0.11.1 (#30951)
* Bumped aiobotocore version to 0.11.1
* New dependencies are added to requirements_all.txt
2020-01-26 18:25:42 -05:00
Franck Nijhof
aa390efd69 Add hassfest URL validation to documentation link (#31143) 2020-01-26 21:32:20 +01:00
Tom Harris
4311b1ae65 Bump insteonplm to 0.16.6 (#31182) 2020-01-26 19:53:31 +01:00
brefra
51e032a7ca Add counters sensors for Velbus (#31165)
* Add counter sensor

* Apply black formatting

* Move all counter logic to sensor.py

* Code cleanup
2020-01-26 18:48:20 +01: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
Maikel Punie
3f03848a07 Fix Velbus covers (includes velbus lib upgrade) (#31153)
* Fix velbus covers

* Update python-velbus lib

* flake8 and black fixes

* Fix comments

* fix codeowner
2020-01-26 14:36:29 +01:00
Malachi Soord
bc196a3c9f Introduce unique_id for lastfm to allow changing entity_id in backwards compatible way (#31163)
* Replace . with _ for lastfm entity_id

* lint

* double quotes

* Rollback change, add unique_id

* Expose prop

* Generate unique ID from user

* Linty

* FIx linter

* Revert changes for splitting entity_id

* Simplify
2020-01-26 14:28:42 +01:00
Jeff Irion
cd72128a80 Implement 'volume_set' service for Android TV devices (#31161) 2020-01-26 10:39:19 +01:00
Aaron Bach
4c4f726323 Refactor RainMachine switch platform (#31148)
* Import constants sanely

* Linting

* Rename data constants for consistency

* Refactor RainMachine switch platform

* Comments

* Cleanup

* Refactor switch and sensor API calls to be separate

* Linting

* Make sure zones are updated in appropriate service calls

* Correctly decrement

* Linting

* Don't do weird inheritance

* Ensure service calls update data properly

* Docstring

* Docstring

* Errors can be logged without string conversion

* Code review comments
2020-01-25 20:27:35 -07:00
Aaron Bach
37d1cdc4cb Add additional alarm states to SimpliSafe (#31060)
* Add additional alarm states to SimpliSafe

* Remove unused constant

* Remove redundant local variable
2020-01-25 18:41:49 -07:00
HomeAssistant Azure
d3511a3496 [ci skip] Translation update 2020-01-26 00:33:06 +00:00
Jens Østergaard Nielsen
353a014496 Fix the ihc.set_runtime_value_int service function not working with templates (#31145)
* Make the set_runtime_value_int function work with template values

* Use newest version of the ihcsdk library

* Make the set_runtime_value_int function work with template values

* Use newest version of the ihcsdk library

* Updated to the newest ihcsdk 2.5.0

* Formatted changes to make it pass CI tests
2020-01-26 00:37:31 +01:00
Matt Snyder
e4832ee4d0 Remove Owlet component (#31160)
* Remove owlet component

* Remove owlet from requirements_all.txt
2020-01-25 21:08:36 +01:00
Quentame
c481a48e3a Separate iCloud class (#31022)
* Separate iCloud class

* Update .coveragerc

* Fix pipe
2020-01-25 13:24:50 -05:00
Josh Bendavid
6f1c45257a Fix state handling for older webos versions (#31099)
* fix state handling for older webos versions

* update aiopylgtv to 0.3.2
2020-01-25 13:24:21 -05:00
Bill Durr
e16e192b3c improvements to zha cover (#31144) 2020-01-25 13:20:59 -05: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ä
80a55360dc Remove no longer used Hound config (#31154) 2020-01-25 12:48:32 +01: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
Aaron Bach
a007835293 Fix RainMachine update action (#31147) 2020-01-24 23:42:59 -07:00
Aaron Bach
550aa6a0a5 Add smarter API usage for RainMachine (#31115)
* Make RainMachine smarter with API usage

* Remove debug statements

* Fix deregistration

* Code review comments

* Code review

* Use an asyncio.Lock

* Remove unnecessary guard clause

* Ensure registation lock per API category
2020-01-24 21:31:14 -08:00
Aaron Bach
cf165cc35f Make SimpliSafe integration more resilient to SimpliSafe cloud issues (#31116)
* Make SimpliSafe integration more resilient to SimpliSafe cloud issues

* Clear emergency refresh token

* Stop listening when appropriate

* Cleanup

* Saving refresh token should happen after all updates

* Code review
2020-01-24 21:19:40 -07: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
HomeAssistant Azure
71ae4b2623 [ci skip] Translation update 2020-01-25 00:31:41 +00:00
Paulus Schoutsen
f4626375f3 Fix when you have two wemo devices (#31139) 2020-01-24 14:59:54 -08:00
Franck Nijhof
c0bc4bb550 Add logo & icon support to Manifest (#31131)
* Add logo & icon support to Manifest

* Add URL validation
2020-01-24 14:36:22 -08:00
Ville Skyttä
9795449d22 Make pylint fail on informational messages too (#31136)
Refs https://github.com/PyCQA/pylint/issues/3250
2020-01-24 23:27:15 +02:00
Paulus Schoutsen
98bac43228 Validate coveragerc with hassfest (#31112)
* Validate coveragerc

* Test if files exists

* Print progress

* Flush
2020-01-24 10:25:46 -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
SukramJ
1effd605a5 Remove unused async_setup_platform (#31132) 2020-01-24 17:33:23 +01:00
Michael Dokolin
30249d1428 Fix Template components to process entity_id configuration option (#31084)
* Fix Template Cover component to process entity_id configuration option

* Fix Template Light component to process entity_id configuration option

* Empty commit to re-trigger build

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-01-24 12:40:00 +01: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
Paulus Schoutsen
b4f3415eb9 Update cast to 4.1.1 (#31113) 2020-01-24 09:20:47 +01:00
Josef Schlehofer
ca591d591f Upgrade youtube_dl to version 2020.01.24 (#31124) 2020-01-24 00:07:36 -08:00
Raman Gupta
1de003487e Fix connection failure log message in async_setup_entry for Vizio component (#31097)
* remove connection check during setup since it is already done during config flow

* revert change and fix log message

* demote connection setup to warning
2020-01-24 07:39:28 +01:00
HomeAssistant Azure
6da2904e12 [ci skip] Translation update 2020-01-24 00:31:41 +00:00
Franck Nijhof
47b708974d Add disabled entities support to AdGuard (#31106) 2020-01-24 00:50:59 +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
Fabian Affolter
bdd73b03b5 Upgrade shodan to 1.21.3 (#31111) 2020-01-23 19:49:01 +01:00
uvjustin
910a0bc870 Allow framerates less than 1 (#31108) 2020-01-23 10:14:47 -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
mindigmarton
bfea9863f1 Update emulated_roku to 0.2.1 (#31100) 2020-01-23 17:12:20 +01:00
Franck Nijhof
e9eaa6536d Upgrade sqlalchemy to 1.3.13 (#31101) 2020-01-23 17:10:40 +01:00
Franck Nijhof
c563652574 Cleanup of PR and issue templates (#31070)
* Remove old issue template

* Small wording improvement

* Consistency

* Configuration fix

* Process review suggestions
2020-01-23 11:55:29 +01: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
Aaron Bach
73a55825af Remove monitored conditions from RainMachine (#31066)
* Remove monitored conditions from RainMachine

* Migrate config entry

* Revert "Migrate config entry"

This reverts commit 84fcf5120f.

* Code review comments

* Disable some entities by default
2020-01-22 20:49:47 -08:00
Fredrik Erlandsson
3fc86988fa pydaikin version bump (#31080) 2020-01-22 18:09:52 -08:00
James Hilliard
d8eca8e303 Add keep-alive which is required for some hlk-sw16 variants (#31062) 2020-01-22 17:57:55 -08:00
springstan
b7678f526c Deprecate hook integration (#31046) 2020-01-22 17:50:24 -08:00
Jonathan Keljo
572b81e7e0 Add myself to owners for components I contributed (#31020)
* Add myself to owners for components I contributed

* Update CODEOWNERS
2020-01-22 17:49:00 -08:00
Aaron Bach
288574b8d1 Remove monitored conditions from OpenUV (#31019)
* Remove monitored conditions from OpenUV

* Code review comments
2020-01-22 17:48:20 -08:00
Paulus Schoutsen
80887d757a Simplify automation services (#30996)
* Simplify automation services

* Empty commit to re-trigger build

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2020-01-22 17:46:12 -08: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
HomeAssistant Azure
a0d2a3c6c5 [ci skip] Translation update 2020-01-23 00:31:52 +00: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
thoscut
93d109e524 Add DIRECTORY and PLUGIN to kodi media types (#28336) 2020-01-22 19:31:03 +01: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
David F. Mulcahey
3c44a1353a change group id creation (#31075) 2020-01-22 09:23:35 -05:00
Franck Nijhof
db76b91ffa Add disabled entities support to WLED (#31040) 2020-01-22 10:45:38 +01:00
Dougal Matthews
96dba7b91f Add the Home Assistant version as a Sentry release (#31065)
This helps make it easier to identify which version of Home Assistant
first introduces a error.
2020-01-22 10:38:24 +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
Quentame
bc600995c1 Do not stop fetching iCloud data after service error (#31069) 2020-01-22 01:39:12 +01:00
Leon Knauer
58973d5265 Fix luftdaten broken icon for "Pressure at sealevel" (#31053) 2020-01-22 01:34:19 +01:00
HomeAssistant Azure
7e604bed7d [ci skip] Translation update 2020-01-22 00:31:43 +00:00
springstan
c3888330c1 Fix fan_modes in tuya climate (#30942) 2020-01-22 01:28:19 +01:00
Jens
15f6e28a04 Add tahoma io:AwningValanceIOComponent (#30944) 2020-01-22 01:09:59 +01: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
Franck Nijhof
ff7d2ac681 Iteration on issue and PR templates (#31058)
* Iteration on issue and PR templates

* Some small improvements to make it look better in the PR editor

* Better English

* Please keep template

* Consistency

* Adds www to website link, to make more clear it is our website

* Process review suggestion by Martin

* Added dep bump as type of change

* English
2020-01-21 23:24:01 +01:00
Franck Nijhof
e8e7e66e2b Bump pytest to 5.3.4 (#31045) 2020-01-21 15:44:39 -05:00
David Bonnes
e00388eea0 switch evohome to use a whitelist for valid zonetype (#31047) 2020-01-21 18:49:15 +00:00
Franck Nijhof
19d30f0a1b Update issue and PR templates (#31056)
* Update issue and PR templates

* Empty commit to re-trigger build
2020-01-21 18:38:50 +01:00
zhumuht
27c25b6f44 Add xiaomi miio sensors cgllc.airmonitor.s1 & cgllc.airmonitor.b1 (#30345)
* support xiaomi miio sensor: cgllc.airmonitor.s1 & cgllc.airmonitor.b1

* support xiaomi miio sensor: cgllc.airmonitor.s1 & cgllc.airmonitor.b1

* rollback sensor,  modify air_quality

* only set air_quality props

* remove set state from "zhimi.airmonitor.v1"

* unit_of_measurement return None when the pm25 isn't reported

* import libs by isort
2020-01-21 17:06:17 +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
James Nimmo
c2df4f56a3 Bump pyintesishome to v1.6 (#31044) 2020-01-21 16:57:27 +01:00
Franck Nijhof
a3bcf69adf 0.104.3 (#31048)
0.104.3
2020-01-21 13:25:53 +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
Franck Nijhof
cfa74039bb Bumped version to 0.104.3 2020-01-21 12:18:07 +01:00
Franck Nijhof
ccf6ce71cf Fix deCONZ update entry from Hassio discovery (#31015)
* Fix deCONZ update entry from Hassio discovery

* Empty commit to re-trigger build
2020-01-21 12:14:31 +01:00
Jeff Irion
392cf57750 Fix capability_attributes when supported_features is None (#30993)
* Fix capability_attributes when supported_features is None (water_heater)

* Fix capability_attributes when supported_features is None (media_player)
2020-01-21 12:14:28 +01:00
steve-gombos
6889816704 Ring camera fix (#30975)
* Fix ring camera entities

* Reverted test refresh interval

* Fix black errors
2020-01-21 12:14:24 +01:00
Jan De Luyck
dde6220ca5 Update emulated_roku to 0.2.0 (#30974) 2020-01-21 12:14:16 +01:00
Paulus Schoutsen
dead2fe576 Catch all Ring timeout errors (#30960)
* Catch more Ring errors

* Fix comment & Disable wifi entities by default

Signed-off-by: Franck Nijhof <git@frenck.dev>
2020-01-21 12:13:11 +01:00
David F. Mulcahey
41014d73be Allow ZHA device creation for the Zigbee coordinator (#31032)
* allow zha device creation for coordinator

* don't let coordinator get removed

* fix truthy issue in logical device type
2020-01-21 06:07:47 -05:00
Josef Schlehofer
bc6603d8d7 Upgrade pyyaml to 5.3 (#31026) 2020-01-20 21:12:16 -08:00
Josef Schlehofer
0b72587af2 Upgrade importlib-metadata to version 1.4.0 (#31027) 2020-01-20 21:11:23 -08:00
HomeAssistant Azure
692e4f27c4 [ci skip] Translation update 2020-01-21 00:33:20 +00:00
David Bonnes
8f37c843f5 Handle ghost zones gracefully (#31008) 2020-01-20 20:49:04 +00:00
Aaron Bach
662c12715e Allow OpenUV entities to be unavailable (#31018)
* Allow OpenUV entities to be unavailable

* Empty commit to re-trigger build
2020-01-20 13:33:58 -07:00
Sébastien RAMAGE
1639432463 Bump zigpy-zigate to 0.5.1 (#31004)
* Bump zigpy-zigate to 0.5.1
Improve startup and channel setting
2020-01-20 13:09:20 -05: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
Franck Nijhof
6cf20fc7fa Fix deCONZ update entry from Hassio discovery (#31015)
* Fix deCONZ update entry from Hassio discovery

* Empty commit to re-trigger build
2020-01-20 08:18:10 -08:00
Franck Nijhof
f7a97dae2d Adds missing strings to Withings (#31012) 2020-01-20 16:26:44 +01:00
Franck Nijhof
d2b0031f55 Adds missing strings to Almond (#31013) 2020-01-20 16:26:06 +01:00
David Bonnes
9b02ca96ba Small tweaks for evohome (#31007) 2020-01-20 13:39:02 +00:00
Bas Nijholt
a010577d6e Add kef supports_on option (#30937)
* add supports_on_off option

* modify support_kef inplace

* all speakers support turning off remotely
2020-01-20 14:24:13 +01:00
Josh Bendavid
a634e62dfc Minor fixes for webostv (#30998)
* restore emulation of play pause toggle

* add protection to notify setup

* add state check for power off to avoid switching tv back on
2020-01-20 10:43:20 +01:00
Ronald Dehuysser
053f18d6ce Add attributes departure_minutes and delay_minutes to the nmbs sensor (#30958)
* Improve sensor for automations

I've updated the sensor so that departure time and delay can be used in automatons.

Before, the departure time and delay time were only available wrapped in strings which makes it difficult to use them in automations. Using the extra attributes, one can easily use them in automations.

* Update homeassistant/components/nmbs/sensor.py

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

* Updates based on review

Changed min to minutes as requested

Co-authored-by: springstan <46536646+springstan@users.noreply.github.com>
2020-01-20 09:51:59 +01:00
Aaron Bach
9993333bf9 Add state reproduction to remotes (#30990) 2020-01-19 23:08:32 -08:00
Jeff Irion
bb37f7bb75 Fix capability_attributes when supported_features is None (#30993)
* Fix capability_attributes when supported_features is None (water_heater)

* Fix capability_attributes when supported_features is None (media_player)
2020-01-19 23:06:35 -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
zhumuht
5f31b48f1d print component import error to logfile (#30346) 2020-01-19 22:05:10 -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
HomeAssistant Azure
f20b3515f2 [ci skip] Translation update 2020-01-20 00:31:55 +00:00
David Bonnes
a40a5a754b initial commit (#30968) 2020-01-19 14:29:15 -08:00
Paulus Schoutsen
ecef0f6e93 Catch all Ring timeout errors (#30960)
* Catch more Ring errors

* Fix comment & Disable wifi entities by default
2020-01-19 13:39:16 -08:00
steve-gombos
8fcd0e9a79 Ring camera fix (#30975)
* Fix ring camera entities

* Reverted test refresh interval

* Fix black errors
2020-01-19 13:18:11 -08:00
Paulus Schoutsen
765b45c81b Improve Wemo config entry support, add device info (#30963)
* Improve config entry support, add device info

* async_dispatch_connect

* Fix I/O in event loop

* Do not raise PlatformNotReady inside dispatcher

* Make main discovery process async

* Do discovery as part of set up.

* Greatly simplify set up

* Add parallel updates to fan&switch

* mini cleanup

* Address comments
2020-01-19 13:13:10 -08:00
Paulus Schoutsen
e4a53d3a08 Improve Wemo config entry support, add device info (#30963)
* Improve config entry support, add device info

* async_dispatch_connect

* Fix I/O in event loop

* Do not raise PlatformNotReady inside dispatcher

* Make main discovery process async

* Do discovery as part of set up.

* Greatly simplify set up

* Add parallel updates to fan&switch

* mini cleanup

* Address comments
2020-01-19 12:57:48 -08:00
Paulus Schoutsen
f14d34560e Improve Wemo config entry support, add device info (#30963)
* Improve config entry support, add device info

* async_dispatch_connect

* Fix I/O in event loop

* Do not raise PlatformNotReady inside dispatcher

* Make main discovery process async

* Do discovery as part of set up.

* Greatly simplify set up

* Add parallel updates to fan&switch

* mini cleanup

* Address comments
2020-01-19 12:56:31 -08:00
Jan De Luyck
90e811df20 Update emulated_roku to 0.2.0 (#30974) 2020-01-19 21:01:16 +01: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
HomeAssistant Azure
6c84c126ea [ci skip] Translation update 2020-01-19 00:32:00 +00:00
David F. Mulcahey
078ce24e5a Add logical Zigbee device type to ZHA device info (#30954)
* add device type to device info
* capitalize
* use zigpy logical device type
2020-01-18 19:27:55 -05:00
ajmarks
656ef6566b Minor enhancements to jewish_calendar (#30632)
* Minor enhancement to jewish_calendar:
 - Expose more halachic times from the underlying hdate module
 - Correct and standardize some transliterations

* Undo breking name change

* Add icon for talit time

Co-authored-by: Andrew Marks <52414333+amarks-coatue@users.noreply.github.com>
2020-01-18 21:33:18 +01:00
Barry Williams
afb1b0cd3c Add play media support and Spotify control to Openhome (#28698) 2020-01-18 18:37:39 +01:00
Alexei Chetroi
26fb1ce255 Don't use unit_of_measurement in state attributes. (#30941) 2020-01-18 10:03:59 -05:00
springstan
4b67508330 Revert "Pulseaudio: Changed default port from 4712 to 4713 (#28857)" (#30939)
This reverts commit e915dd0d95.
2020-01-18 14:02:15 +01:00
David Bonnes
a037c1d788 Add services to evohome (#29816) 2020-01-18 12:21:22 +00:00
David Bonnes
bfa8cb760f Add services to geniushub (#30918)
adds:
 - `set_zone_override`, and
 - `set_zone_mode`
2020-01-18 12:14:50 +00: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
springstan
52cee84c2c Update outdated documentation links in json files (#30916) 2020-01-17 21:41:42 -08:00
Alexei Chetroi
3bf657284c Refactor rounding for ZHA electrical measurement sensor (#30923) 2020-01-17 20:53:31 -05:00
Alexei Chetroi
58520aa733 Add battery voltage state attribute for ZHA devices (#30901)
* Add battery voltage state attribute for ZHA devices.

* Pylint.
2020-01-17 19:43:02 -05:00
Paulus Schoutsen
7ef7d1dfd0 Merge pull request #30925 from home-assistant/rc
0.104.2
2020-01-17 16:32:18 -08:00
HomeAssistant Azure
4d7c8e254b [ci skip] Translation update 2020-01-18 00:31:52 +00:00
Paulus Schoutsen
2c915af348 Bumped version to 0.104.2 2020-01-17 15:48:27 -08:00
Paulus Schoutsen
2b733917a4 Fix hue accepting filename (#30924) 2020-01-17 15:48:21 -08:00
Bram Kragten
353010712f pdated frontend to 20200108.2 (#30921) 2020-01-17 15:47:58 -08:00
Robert Svensson
07a0bc4abe Fix service device refresh calling state update (#30920) 2020-01-17 15:46:10 -08:00
Paulus Schoutsen
f9b48844e6 camera endpoint likes to timeout, catch it. (#30919) 2020-01-17 15:46:10 -08:00
ochlocracy
6053d02e44 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:45:41 -08:00
Robert Svensson
6ac33e5c7b Fix issue with group unique id when normalising bridge id (#30904) 2020-01-17 15:44:09 -08:00
SukramJ
586566e6ab Fix missing switch groups of HomematicIP Cloud (#30903) 2020-01-17 15:44:08 -08:00
David F. Mulcahey
5a46adfebf add multistate back (#30889) 2020-01-17 15:44:07 -08:00
Paulus Schoutsen
9f20185cee Fix hue accepting filename (#30924) 2020-01-17 15:38:38 -08:00
Robert Svensson
c9db21ffac Fix service device refresh calling state update (#30920) 2020-01-17 15:33:46 -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
Bram Kragten
e33698b17d Updated frontend to 20200108.2 (#30921) 2020-01-17 14:54:53 -08:00
Paulus Schoutsen
8cacef47f3 camera endpoint likes to timeout, catch it. (#30919) 2020-01-17 14:54:32 -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
Peter Nijssen
196bf2f3a0 remove PostNL component as it is no longer working (#30902) 2020-01-17 12:51:32 -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
David F. Mulcahey
31996120dd add multistate back (#30889) 2020-01-17 13:06:10 -05:00
SukramJ
d913d35fc3 Fix missing switch groups of HomematicIP Cloud (#30903) 2020-01-17 18:37:32 +01: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
cgtobi
da368f0cb8 Update pyatmo to 3.2.2 and add available attribute (#30882)
* Update pyatmo to 3.2.1

* Update pyatmo to 3.2.2

* Remove accidentally added requirements

* Add availability property
2020-01-17 17:08:30 +01:00
Raman Gupta
d63ea198f2 Bump pyvizio version to 0.1.1 (#30867)
* bump pyvizio version to resolve setup issue

* update requirements*.txt
2020-01-17 08:48:59 +01:00
HomeAssistant Azure
24a381456a [ci skip] Translation update 2020-01-17 00:31:45 +00:00
Daniel Shokouhi
6678f8387f Remove unused import (#30858) 2020-01-16 16:26:10 -08:00
Per-Øyvind Bruun
a93088dafb Fix for issue #29822 (#30849) 2020-01-16 11:37:53 -08:00
Aaron Bach
9bfcd04a4f Fix sensor type creation with multiple Ambient weather stations (#30850) 2020-01-16 11:37:28 -08:00
Paulus Schoutsen
7da84dca76 Reinstate and deprecate filename option for hue config (#30846) 2020-01-16 11:28:35 -08:00
Franck Nijhof
2a65da5db2 Deprecate history_graph integration (#30835) 2020-01-16 10:31:18 -08:00
Franck Nijhof
8861c80068 Deprecate hide_if_away from device_tracker (#30833) 2020-01-16 10:31:00 -08:00
Quentame
04b7d9e848 Fix iCloud when no family members (issue #30829) (#30836) 2020-01-16 09:27:43 -08:00
Franck Nijhof
235ab64066 Deprecate weblink integration (#30834) 2020-01-16 09:25:49 -08:00
Franck Nijhof
4544665749 Deprecate states UI options in group integration (#30831) 2020-01-16 09:25:39 -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
Josh Bendavid
d1da653e62 Fix play_media in webostv (#30828) 2020-01-16 12:30:55 +01:00
Pascal Vizeli
bef8600972 Fix mpd time issue (#30825)
* Fix mpd time issue

* Update homeassistant/components/mpd/media_player.py

Co-Authored-By: Franck Nijhof <git@frenck.dev>
2020-01-16 11:20:58 +01:00
springstan
9d5a391916 Fix setup error of Mikrotik (#30810) 2020-01-16 10:48:47 +01:00
Paulus Schoutsen
6f24fe3970 Handle no host info in ignored config entries (#30822) 2020-01-16 10:19:38 +01:00
Rick van Hattem
1566d963a8 Fixed pyyaml requirement from 5.2.0 to 5.2 (#30808) 2020-01-15 20:16:26 -05:00
HomeAssistant Azure
01520a32d3 [ci skip] Translation update 2020-01-16 00:31:45 +00:00
Franck Nijhof
b42134bbce Merge branch 'master' into dev 2020-01-15 22:18:51 +01: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
springstan
3899c6ae27 Bump librouteros to 3.0.0 (#30800) 2020-01-15 11:54:20 -08:00
Franck Nijhof
1e2c3cacf9 Mark hide_entity deprecated in automation integration (#30799) 2020-01-15 11:53:52 -08:00
Josh Bendavid
5393300086 update to aiopylgtv 0.2.7 (#30797) 2020-01-15 10:48:30 -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
Miroslav Ždrale
36796ef649 Update pyubee to 0.8 (#30785) 2020-01-15 16:24:06 +01:00
Jan De Luyck
41469cec6c Update emulated_roku to 0.1.9 (#30791)
* Update emulated_roku to 0.1.9

* Update requirements_all
2020-01-15 16:21:55 +01: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
Bram Kragten
8af946fba5 Search: Add search to default config and don't resolve area (#30762)
* Add search to default config and don't resolve area

* Move to frontend

* Minor update

Co-authored-by: Jason Hu <awarecan@users.noreply.github.com>
2020-01-14 18:36:21 -08:00
HomeAssistant Azure
8093da6a0c [ci skip] Translation update 2020-01-15 00:31:56 +00: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
Josef Schlehofer
6f84723fec Upgrade youtube_dl to version 2020.01.15 (#30767) 2020-01-14 15:31:51 -08:00
Paulus Schoutsen
fbf5e320f7 Whitelist Frenck for release 2020-01-14 15:06:30 -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
Pascal Vizeli
9f62b58929 Revert #29701 (#30766)
* Revert #29701

* fix format

* Fix lint
2020-01-14 23:02:49 +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
Tim Rightnour
ba3c3057da Add support for the voltage sensor on the greeneye GEM (#30484)
* Add support for the voltage sensor on the greeneye GEM

* Changed per suggestion @springstan
2020-01-14 20:46:04 +01:00
springstan
297c360d04 Fix supported_features in MQTT fan (#28680)
* Added custom validator function for speed list

* Replace CONF_SPEED_STATE_TOPIC with CONF_SPEED_COMMAND_TOPIC to determine SUPPORT_SET_SPEED

* Revert "Added custom validator function for speed list"

This reverts commit f000396fa6.

* Replace CONF_OSCILLATION_STATE_TOPIC with CONF_OSCILLATION_COMMAND_TOPIC to determine SUPPORT_OSCILLATE
2020-01-14 09:17:44 -08:00
Akın Ömeroğlu
0b8a269b23 Fix small typo in alarmdotcom component (#30758) 2020-01-14 17:47:59 +01:00
Bas Nijholt
a26fef38a2 bump aiokef to 0.2.5 which uses locks (#30753) 2020-01-14 17:41:52 +01:00
Franck Nijhof
6b49bea6c4 Fix HomeKit behavior with lights supporting color and temperature (#30756) 2020-01-14 07:09:35 -08:00
Alan Tse
aeb789ddcc Bump teslajsonpy to 0.2.3 (#30750) 2020-01-14 11:27:49 +01:00
Pascal Vizeli
ced6df158b Refactor HomeMatic / Fix issue with 0.104/dev (#30752)
* Refactor HomeMatic / Fix issue with 0.104/dev

* Fix lock
2020-01-14 11:26:59 +01:00
Bas Delfos
0d688faa56 Fix 'NewIPAddress' error in component fritz (#30210)
* Fix 'NewIPAddress' error in component fritzbox

* Upgrade to fritzconnection 1.2.0
2020-01-14 09:46:16 +01:00
Paulus Schoutsen
1e3b3ecbe6 Set default locale for cloud Alexa config (#30749) 2020-01-14 08:33:45 +01:00
HomeAssistant Azure
f9fe91ee74 [ci skip] Translation update 2020-01-14 00:31:46 +00:00
Steven Looman
75f0fedd68 Fix translation from HA playlist to UPnP playlistItem (#30743) 2020-01-13 23:52:49 +01:00
Franck Nijhof
658d338058 Removes Cisco Spark integration (#30738) 2020-01-13 10:23:26 -08:00
Josh Bendavid
f639a8fbaa update aiopylgtv to 0.2.6 (#30739) 2020-01-13 13:11:06 -05:00
David F. Mulcahey
1b730b3055 Bump ZHA quirks to 0.0.31 (#30740)
* Bump ZHA quirks version

* update requirements
2020-01-13 13:10:22 -05:00
Paulus Schoutsen
10e89bbc8c Fix Ring wifi sensors (#30735)
* Fix Ring wifi sensors

* Update before adding
2020-01-13 09:13:46 -08:00
Paulus Schoutsen
f50714d7e9 Update config flow test scaffolding (#30694)
* Update config flow test scaffolding

* asyncpatch -> patch

* Update classname
2020-01-13 15:20:25 +01:00
Franck Nijhof
040b283a14 Fix hassfest allowing omitting discovery methods when using OAuth2Flow (#30732) 2020-01-13 05:36:47 -08:00
Paulus Schoutsen
1f9d6ba541 Update Hue SSDP discovery (#30695) 2020-01-13 05:30:07 -08:00
Franck Nijhof
1b739f9555 Removes unneeded abort if unique id in Oauth2 discovery flow (#30733) 2020-01-13 05:29:19 -08:00
michaeldavie
3c2b57afaf Bump env_canada to 0.0.34 (#30713) 2020-01-13 14:27:53 +01:00
Franck Nijhof
7143ed7ceb Remove hidden property from fibaro integration (#30730) 2020-01-13 14:23:08 +01:00
Franck Nijhof
0c14d4e067 Remove hidden property from emby integration (#30729) 2020-01-13 14:22:48 +01:00
Franck Nijhof
c8a52d4566 Remove hidden property from egardia integration (#30728) 2020-01-13 14:22:06 +01:00
Franck Nijhof
3df329b8ec Bump apprise to 0.8.3 (#30731) 2020-01-13 08:20:09 -05:00
Franck Nijhof
56dc5298fc Remove hidden property from xiaomi_miio.remote integration (#30727) 2020-01-13 13:50:01 +01: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
zewelor
ce13fb8d73 Support yeelight color light with nightlight (#30194)
* Support color light with nightlight

* Better nightlight mode support check

* Lint fixes

* Remove brightness control for color light with nightlight mode
2020-01-13 06:03:48 +01:00
Franck Nijhof
96c11bc6d7 Unhide SPC binary sensors by default (#30699) 2020-01-12 20:47:07 -08:00
Aaron Bach
b585feb109 Consolidate SimpliSafe property services (#30567)
* Consolidate SimpliSafe property services

* Code review comments

* Code review comments

* Ensure all services are admin services

* Code review comments
2020-01-12 21:32:08 -07:00
Quentame
123bef4f1e Fix SynologyDSM sensor if network_sensors is None (#30718) 2020-01-13 04:42:37 +01:00
HomeAssistant Azure
0534153ae7 [ci skip] Translation update 2020-01-13 00:31:54 +00:00
Phil Bruckner
89c04c94e0 Revert "Forget auth token when going offline so we can reconnect (#26630)" (#30705)
This reverts commit 2d6d6ba90e.
2020-01-12 14:21:07 -06:00
Yarmo Mackenbach
96bf8bc395 Update NSAPI to version 3.0.0 (#30599)
* Updated NSAPI to version 3.0.0

* Fixed code style error

* Restructured API access

* Improved construction of attributes

* Fixed handling of API output

* Added @YarmoM as code owner

* Updated CODEOWNERS

* Reverted changes for full backwards compatibility

* Fixed bad conditional

* Simplify conditional
2020-01-12 20:30:26 +01:00
Bogdan Vlaicu
5f5e8d81e1 Bumped oru to 0.1.11 (adds a timeout to the api request) (#30704) 2020-01-12 17:55:33 +01:00
Josh Bendavid
c798413971 update aiopylgtv to 0.2.5 (#30702) 2020-01-12 17:55:11 +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
inputd
4dc39492a5 Drop timer component microseconds (#30198)
* Update __init__.py
2020-01-11 22:55:28 -05: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
9266fc0cd7 Ring OTP improvement (#30688)
* Fix otp flow

* Update Ring to 0.5

Co-authored-by: steve-gombos <3118886+steve-gombos@users.noreply.github.com>
2020-01-11 18:22:08 -08: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
HomeAssistant Azure
8b46b5591f [ci skip] Translation update 2020-01-12 00:32:04 +00: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ä
4a66eb0a69 Upgrade huawei-lte-api to 1.4.6 (#30683)
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.6
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.5
2020-01-11 23:36:40 +01:00
Quentame
519c1fa2da Update iCloud sensors when service finish its update (#30680)
* Update iCloud sensors when needed

* Add sensor should_poll
2020-01-11 23:12:55 +01: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
Jörg Thalheim
b128814acf pushover: improve error when image download fails (#30615) 2020-01-11 10:36:50 +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
Dave T
c1c90b8034 Update ON/OFF condition and triggers to match documentation and UI, issue #30462 (#30663) 2020-01-10 19:59:11 -08: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
HomeAssistant Azure
d6512c8a9f [ci skip] Translation update 2020-01-11 00:31:55 +00: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
NobleKangaroo
e2f591e5bc Remove self as Emulated Hue codeowner (#30654) 2020-01-10 22:35:18 +01:00
ochlocracy
d0062fc740 Fix Alexa ChangeReports Filter non-proactively_reported_properties (#30655)
* Fix Change Report Properties.

* Fix Change Report Properties.
2020-01-10 22:34: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
springstan
c13b461737 Bump Adafruit_BBIO to 1.1.1 (#30630) 2020-01-10 19:56:41 +01:00
Ville Skyttä
74cde3de6e Upgrade pydocstyle to 5.0.2 (#30648)
https://github.com/PyCQA/pydocstyle/blob/5.0.2/docs/release_notes.rst
2020-01-10 19:56:07 +01:00
Fabian Affolter
fb2e059346 Upgrade colorlog to 4.1.0 (#30642) 2020-01-10 19:55:49 +01:00
Phil Bruckner
d65f2ac31a Do not save last_seen if older than prev_seen (#30647)
Also add warnings when updates skipped similar to google_maps
2020-01-10 19:55:39 +01:00
Fabian Affolter
53a42ccd5d Upgrade pylast to 3.2.0 (#30644) 2020-01-10 16:59:40 +01:00
Fabian Affolter
5e3747a058 Upgrade shodan to 1.21.2 (#30641) 2020-01-10 16:58:13 +01:00
Fabian Affolter
ec1109329b Upgrade praw to 6.5.0 (#30643) 2020-01-10 16:57:52 +01:00
Raman Gupta
d25aa1f183 Convert vizio component from sync to async component (#30605)
* add device_info property and move component to async

* use new VizioAsync class to have proper async support

* remove hass from VizioDevice init since it is not needed

* update requirements_all

* missed type hint

* updates based on review

* pyvizio version bump

* additional fixes based on review

* mistake in last commit

* remove device_info property because it can't be used unless this integration has config flow support
2020-01-10 03:53:47 +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
HomeAssistant Azure
4fb36451c2 [ci skip] Translation update 2020-01-10 00:31:50 +00:00
Nathan
955aa1de39 Add INFO logging to generic_thermostat component for keep-alive turn … (#28740)
* Add INFO logging to generic_thermostat component for keep-alive turn on/off

* run black
2020-01-10 00:20:16 +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
Daniel Lashua
669844e4dd Check netgear device_tracker link_rate to ensure device is connected (#30581)
* check link_rate to ensure device is connected

* black
2020-01-09 20:45:42 +01:00
Davide Varricchio
208a123c47 Update PYAEHW4A1 to version 0.3.4 (#30616)
* Update manifest.json

* Update requirements_all.txt

* Update requirements_test_all.txt
2020-01-09 13:07:23 -05:00
Nikolay Vasilchuk
f878fabd09 Fix TOD component incorrectly determining the state between sunrise and sunset (#30199)
* TOD fix

* Comment added

* Review

* Review

* Review
2020-01-09 17:17:16 +01:00
William Sutton
3a3d448f17 Add preset scheduling to radiothermostat (#29847)
* Added preset scheduling to radiothermostat. Added alternate scheduling & religious scheduling to climate/const.py

* Fix Flake8 Errors in climate.py

* Fixing more flake8 errors in climate.py

Removed duplicate set_preset_mode def

* Fixed more flake8 errors. 

Please be the end of these errors.

* Fixed black formatting

* Fixed black, broke flake8, fixed flake8

* Fixed CODE_TO_FAN_STATE black error

* Fixed isort issues

* Local isort broke black formatting

Docs should run isort before black. Default isort will undo certain black formatting.

* Removed last commas from imports

* Added removed line

* Fixed formatting

Hopefully this is what the CI pipeline is looking for.

* Ran isort from git repo root, utilizing setup.cfg.

* One more try

* fixed added definition and fixed logger string

* fixed formatting

* lost a close-paren

* Update const.py

Removed radiotherm specific presets

* Update climate.py

Moved preset definitions into radiotherm climate.py
2020-01-09 15:25:19 +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
David Bonnes
a99135a09e tweak honeywell manifest (#30612) 2020-01-09 12:36:32 +00:00
Pascal Vizeli
a4c1114c8e Set body size for Proxy / streams to 16mb (#30608) 2020-01-09 11:09:34 +01:00
Martin Hjelmare
9ebf5ea413 Fix aurora import order (#30606) 2020-01-09 10:25:03 +01:00
Olen
290043aed6 Add neato boundary name to state if it exists (#29915)
* Add boundary name to state if it exists

If the robot is cleaning a pre defined area with a name, add the name to the state-attribute.

* Reformat patch

* Removing whitespace

* Even more formatting 

That black did not catch on first run...
2020-01-09 09:42:18 +01:00
Watchfox
6b7be35f4a Fix aurora sensor not converting latitude and longitude correctly (#28643) 2020-01-09 08:40:10 +01:00
Phil Bruckner
260596d11b Fix upnp raw sensor state formatting when None (#30444) 2020-01-09 06:51:30 +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
HomeAssistant Azure
8062bed53e [ci skip] Translation update 2020-01-09 00:31:49 +00:00
Daniel Perna
9ce5c65b14 Update pyhomematic to 0.1.63 (#30594) 2020-01-09 00:32:57 +01:00
Robert Svensson
ff5f890e79 Fix problem with restoring POE control (#30597) 2020-01-08 22:33:51 +01:00
Matt Snyder
103d352b1f Add Doorbird events to logbook (#30588)
* Add Doorbird events to logbook

* Add logbook to dependencies
2020-01-08 21:27:48 +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
Paulus Schoutsen
4cd83e71dd Version bump to 0.105.0dev0 2020-01-08 21:07:04 +01:00
1021 changed files with 28431 additions and 13547 deletions

View File

@@ -6,7 +6,6 @@ omit =
homeassistant/helpers/signal.py
homeassistant/helpers/typing.py
homeassistant/scripts/*.py
homeassistant/util/async.py
# omit pieces of code that rely on external devices being present
homeassistant/components/abode/__init__.py
@@ -32,7 +31,6 @@ omit =
homeassistant/components/airly/const.py
homeassistant/components/airvisual/sensor.py
homeassistant/components/aladdin_connect/cover.py
homeassistant/components/alarm_control_panel/manual_mqtt.py
homeassistant/components/alarmdecoder/*
homeassistant/components/alarmdotcom/alarm_control_panel.py
homeassistant/components/alpha_vantage/sensor.py
@@ -116,7 +114,6 @@ omit =
homeassistant/components/cisco_ios/device_tracker.py
homeassistant/components/cisco_mobility_express/device_tracker.py
homeassistant/components/cisco_webex_teams/notify.py
homeassistant/components/ciscospark/notify.py
homeassistant/components/citybikes/sensor.py
homeassistant/components/clementine/media_player.py
homeassistant/components/clickatell/notify.py
@@ -256,13 +253,15 @@ omit =
homeassistant/components/frontier_silicon/media_player.py
homeassistant/components/futurenow/light.py
homeassistant/components/garadget/cover.py
homeassistant/components/garmin_connect/__init__.py
homeassistant/components/garmin_connect/const.py
homeassistant/components/garmin_connect/sensor.py
homeassistant/components/gc100/*
homeassistant/components/geniushub/*
homeassistant/components/gearbest/sensor.py
homeassistant/components/geizhals/sensor.py
homeassistant/components/gios/__init__.py
homeassistant/components/gios/air_quality.py
homeassistant/components/gios/consts.py
homeassistant/components/github/sensor.py
homeassistant/components/gitlab_ci/sensor.py
homeassistant/components/gitter/sensor.py
@@ -307,7 +306,6 @@ omit =
homeassistant/components/homematic/notify.py
homeassistant/components/homeworks/*
homeassistant/components/honeywell/climate.py
homeassistant/components/hook/switch.py
homeassistant/components/horizon/media_player.py
homeassistant/components/hp_ilo/sensor.py
homeassistant/components/htu21d/sensor.py
@@ -324,6 +322,7 @@ omit =
homeassistant/components/iaqualink/sensor.py
homeassistant/components/iaqualink/switch.py
homeassistant/components/icloud/__init__.py
homeassistant/components/icloud/account.py
homeassistant/components/icloud/device_tracker.py
homeassistant/components/icloud/sensor.py
homeassistant/components/izone/climate.py
@@ -421,7 +420,8 @@ omit =
homeassistant/components/metoffice/weather.py
homeassistant/components/microsoft/tts.py
homeassistant/components/miflora/sensor.py
homeassistant/components/mikrotik/*
homeassistant/components/mikrotik/hub.py
homeassistant/components/mikrotik/device_tracker.py
homeassistant/components/mill/climate.py
homeassistant/components/mill/const.py
homeassistant/components/minio/*
@@ -455,8 +455,13 @@ omit =
homeassistant/components/nederlandse_spoorwegen/sensor.py
homeassistant/components/nello/lock.py
homeassistant/components/nest/*
homeassistant/components/netatmo/*
homeassistant/components/netatmo_public/sensor.py
homeassistant/components/netatmo/__init__.py
homeassistant/components/netatmo/binary_sensor.py
homeassistant/components/netatmo/api.py
homeassistant/components/netatmo/camera.py
homeassistant/components/netatmo/climate.py
homeassistant/components/netatmo/const.py
homeassistant/components/netatmo/sensor.py
homeassistant/components/netdata/sensor.py
homeassistant/components/netgear/device_tracker.py
homeassistant/components/netgear_lte/*
@@ -504,13 +509,13 @@ omit =
homeassistant/components/openuv/sensor.py
homeassistant/components/openweathermap/sensor.py
homeassistant/components/openweathermap/weather.py
homeassistant/components/opnsense/*
homeassistant/components/opple/light.py
homeassistant/components/orangepi_gpio/*
homeassistant/components/oru/*
homeassistant/components/orvibo/switch.py
homeassistant/components/osramlightify/light.py
homeassistant/components/otp/sensor.py
homeassistant/components/owlet/*
homeassistant/components/panasonic_bluray/media_player.py
homeassistant/components/panasonic_viera/media_player.py
homeassistant/components/pandora/media_player.py
@@ -530,12 +535,10 @@ omit =
homeassistant/components/plex/media_player.py
homeassistant/components/plex/sensor.py
homeassistant/components/plex/server.py
homeassistant/components/plex/websockets.py
homeassistant/components/plugwise/*
homeassistant/components/plum_lightpad/*
homeassistant/components/pocketcasts/sensor.py
homeassistant/components/point/*
homeassistant/components/postnl/sensor.py
homeassistant/components/prezzibenzina/sensor.py
homeassistant/components/proliphix/climate.py
homeassistant/components/prometheus/*
@@ -637,6 +640,7 @@ omit =
homeassistant/components/smappee/*
homeassistant/components/smarty/*
homeassistant/components/smarthab/*
homeassistant/components/sms/*
homeassistant/components/smtp/notify.py
homeassistant/components/snapcast/media_player.py
homeassistant/components/snmp/*
@@ -659,6 +663,7 @@ omit =
homeassistant/components/speedtestdotnet/*
homeassistant/components/spider/*
homeassistant/components/spotcrime/sensor.py
homeassistant/components/spotify/__init__.py
homeassistant/components/spotify/media_player.py
homeassistant/components/squeezebox/*
homeassistant/components/starline/*
@@ -724,7 +729,6 @@ omit =
homeassistant/components/torque/sensor.py
homeassistant/components/totalconnect/*
homeassistant/components/touchline/climate.py
homeassistant/components/tplink/device_tracker.py
homeassistant/components/tplink/switch.py
homeassistant/components/tplink_lte/*
homeassistant/components/traccar/device_tracker.py
@@ -749,7 +753,6 @@ omit =
homeassistant/components/twitch/sensor.py
homeassistant/components/twitter/notify.py
homeassistant/components/ubee/device_tracker.py
homeassistant/components/uber/sensor.py
homeassistant/components/ubus/device_tracker.py
homeassistant/components/ue_smart_radio/media_player.py
homeassistant/components/unifiled/*
@@ -779,7 +782,9 @@ omit =
homeassistant/components/viaggiatreno/sensor.py
homeassistant/components/vicare/*
homeassistant/components/vivotek/camera.py
homeassistant/components/vizio/*
homeassistant/components/vizio/__init__.py
homeassistant/components/vizio/const.py
homeassistant/components/vizio/media_player.py
homeassistant/components/vlc/media_player.py
homeassistant/components/vlc_telnet/media_player.py
homeassistant/components/volkszaehler/sensor.py
@@ -825,7 +830,6 @@ omit =
homeassistant/components/zestimate/sensor.py
homeassistant/components/zha/__init__.py
homeassistant/components/zha/api.py
homeassistant/components/zha/const.py
homeassistant/components/zha/core/channels/*
homeassistant/components/zha/core/const.py
homeassistant/components/zha/core/device.py
@@ -833,7 +837,6 @@ omit =
homeassistant/components/zha/core/helpers.py
homeassistant/components/zha/core/patches.py
homeassistant/components/zha/core/registries.py
homeassistant/components/zha/device_entity.py
homeassistant/components/zha/entity.py
homeassistant/components/zha/light.py
homeassistant/components/zha/sensor.py

View File

@@ -1,48 +0,0 @@
<!-- READ THIS FIRST:
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Android issues should be submitted to the home-assistant-android repository: https://github.com/home-assistant/home-assistant-android/issues
- Do not report issues for integrations if you are using custom integration: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!
-->
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Last working Home Assistant release (if known):**
**Operating environment (Hass.io/Docker/Windows/etc.):**
<!--
Please provide details about your environment.
-->
**Integration:**
<!--
Please add the link to the documentation at https://www.home-assistant.io/integrations/ of the integration in question.
-->
**Description of problem:**
**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**
```yaml
```
**Traceback (if applicable):**
```
```
**Additional information:**

53
.github/ISSUE_TEMPLATE/BUG_REPORT.md vendored Normal file
View File

@@ -0,0 +1,53 @@
---
name: Report a bug with Home Assistant
about: Report an issue with Home Assistant
---
<!-- READ THIS FIRST:
- If you need additional help with this template, please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Do not report issues for integrations if you are using custom components or integrations.
- Provide as many details as possible. Paste logs, configuration samples and code into the backticks.
DO NOT DELETE ANY TEXT from this template! Otherwise, your issue may be closed without comment.
-->
## The problem
<!--
Describe the issue you are experiencing here to communicate to the
maintainers. Tell us what you were trying to do and what happened instead.
-->
## Environment
<!--
Provide details about the versions you are using, which helps us to reproduce
and find the issue quicker. Version information is found in the
Home Assistant frontend: Developer tools -> Info.
-->
- Home Assistant release with the issue:
- Last working Home Assistant release (if known):
- Operating environment (Hass.io/Docker/Windows/etc.):
- Integration causing this issue:
- Link to integration documentation on our website:
## Problem-relevant `configuration.yaml`
<!--
An example configuration that caused the problem for you. Fill this out even
if it seems unimportant to you. Please be sure to remove personal information
like passwords, private URLs and other credentials.
-->
```yaml
```
## Traceback/Error logs
<!--
If you come across any trace or error logs, please provide them.
-->
```txt
```
## Additional information

View File

@@ -1,52 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
---
<!-- READ THIS FIRST:
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for integrations if you are using a custom integration: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!
-->
**Home Assistant release with the issue:**
<!--
- Frontend -> Developer tools -> Info
- Or use this command: hass --version
-->
**Last working Home Assistant release (if known):**
**Operating environment (Hass.io/Docker/Windows/etc.):**
<!--
Please provide details about your environment.
-->
**Integration:**
<!--
Please add the link to the documentation at https://www.home-assistant.io/integrations/ of the integration in question.
-->
**Description of problem:**
**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**
```yaml
```
**Traceback (if applicable):**
```
```
**Additional information:**

17
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
blank_issues_enabled: false
contact_links:
- name: Report a bug with the UI, Frontend or Lovelace
url: https://github.com/home-assistant/home-assistant-polymer/issues
about: This is the issue tracker for our backend. Please report issues with the UI in the frontend repository.
- name: Report incorrect or missing information on our website
url: https://github.com/home-assistant/home-assistant.io/issues
about: Our documentation has its own issue tracker. Please report issues with the website there.
- name: I have a question or need support
url: https://www.home-assistant.io/help
about: We use GitHub for tracking bugs, check our website for resources on getting help.
- name: Feature Request
url: https://community.home-assistant.io/c/feature-requests
about: Please use our Community Forum for making feature requests.
- name: I'm unsure where to go
url: https://www.home-assistant.io/join-chat
about: If you are unsure where to go, then joining our chat is recommended; Just ask!

View File

@@ -1,35 +1,109 @@
## Breaking Change:
<!-- What is breaking and why we have to break it. Remove this section only if it was NOT a breaking change. -->
## Description:
<!--
You are amazing! Thanks for contributing to our project!
Please, DO NOT DELETE ANY TEXT from this template! (unless instructed).
-->
## Breaking change
<!--
If your PR contains a breaking change for existing users, it is important
to tell them what breaks, how to make it work again and why we did this.
This piece of text is published with the release notes, so it helps if you
write it towards our users, not us.
Note: Remove this section if this PR is NOT a breaking change.
-->
**Related issue (if applicable):** fixes #<home-assistant issue number goes here>
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
**Pull request with documentation for [home-assistant.io](https://github.com/home-assistant/home-assistant.io) (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>
## Example entry for `configuration.yaml` (if applicable):
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Example entry for `configuration.yaml`:
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR. Furthermore, for new integrations, it gives an impression of how
the configuration would look like.
Note: Remove this section if this PR does not have an example entry.
-->
```yaml
# Example configuration.yaml
```
## Checklist:
- [ ] The code change is tested and works locally.
- [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [ ] The code change is tested and works locally.
- [ ] Local tests pass. **Your PR cannot be merged unless tests pass**
- [ ] There is no commented out code in this PR.
- [ ] I have followed the [development checklist][dev-checklist]
- [ ] The code has been formatted using Black (`black --fast homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)
- [ ] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [ ] [_The manifest file_][manifest-docs] has all fields filled out correctly. Update and include derived files by running `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt` by running `python3 -m script.gen_requirements_all`.
- [ ] Untested files have been added to `.coveragerc`.
If the code does not interact with devices:
- [ ] Tests have been added to verify that the new code works.
- [ ] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] Untested files have been added to `.coveragerc`.
The integration reached or maintains the following [Integration Quality Scale][quality-scale]:
<!--
The Integration Quality Scale scores an integration on the code quality
and user experience. Each level of the quality scale consists of a list
of requirements. We highly recommend getting your integration scored!
-->
- [ ] No score or internal
- [ ] 🥈 Silver
- [ ] 🥇 Gold
- [ ] 🏆 Platinum
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[docs-repository]: https://github.com/home-assistant/home-assistant.io

View File

@@ -1,2 +0,0 @@
python:
enabled: true

View File

@@ -24,7 +24,7 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.0.1
- pydocstyle==5.0.2
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2

View File

@@ -20,7 +20,7 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.0.1
- pydocstyle==5.0.2
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2

View File

@@ -23,6 +23,7 @@ homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/ambiclimate/* @danielhiversen
homeassistant/components/ambient_station/* @bachya
homeassistant/components/amcrest/* @pnbruckner
homeassistant/components/androidtv/* @JeffLIrion
homeassistant/components/apache_kafka/* @bachya
homeassistant/components/api/* @home-assistant/core
@@ -59,7 +60,6 @@ homeassistant/components/cert_expiry/* @Cereal2nd @jjlawren
homeassistant/components/cisco_ios/* @fbradyirl
homeassistant/components/cisco_mobility_express/* @fbradyirl
homeassistant/components/cisco_webex_teams/* @fbradyirl
homeassistant/components/ciscospark/* @fbradyirl
homeassistant/components/cloud/* @home-assistant/cloud
homeassistant/components/cloudflare/* @ludeeus
homeassistant/components/comfoconnect/* @michaelarnauts
@@ -76,12 +76,14 @@ homeassistant/components/darksky/* @fabaff
homeassistant/components/deconz/* @kane610
homeassistant/components/delijn/* @bollewolle
homeassistant/components/demo/* @home-assistant/core
homeassistant/components/derivative/* @afaucogney
homeassistant/components/device_automation/* @home-assistant/core
homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dsmr_reader/* @depl0y
homeassistant/components/dweet/* @fabaff
homeassistant/components/dyson/* @etheralm
homeassistant/components/ecobee/* @marthoc
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/egardia/* @jeroenterheerdt
@@ -89,7 +91,6 @@ homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/elgato/* @frenck
homeassistant/components/elv/* @majuss
homeassistant/components/emby/* @mezz64
homeassistant/components/emulated_hue/* @NobleKangaroo
homeassistant/components/enigma2/* @fbradyirl
homeassistant/components/enocean/* @bdurrer
homeassistant/components/entur_public_transport/* @hfurubotten
@@ -115,6 +116,7 @@ homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85
homeassistant/components/fronius/* @nielstron
homeassistant/components/frontend/* @home-assistant/frontend
homeassistant/components/garmin_connect/* @cyberjunky
homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/geniushub/* @zxdavb
homeassistant/components/geo_rss_events/* @exxamalte
@@ -129,6 +131,7 @@ homeassistant/components/google_cloud/* @lufton
homeassistant/components/google_translate/* @awarecan
homeassistant/components/google_travel_time/* @robbiet480
homeassistant/components/gpsd/* @fabaff
homeassistant/components/greeneye_monitor/* @jkeljo
homeassistant/components/group/* @home-assistant/core
homeassistant/components/growatt_server/* @indykoning
homeassistant/components/gtfs/* @robbiet480
@@ -168,7 +171,7 @@ homeassistant/components/intent/* @home-assistant/core
homeassistant/components/intesishome/* @jnimmo
homeassistant/components/ios/* @robbiet480
homeassistant/components/iperf3/* @rohankapoorcom
homeassistant/components/ipma/* @dgomes
homeassistant/components/ipma/* @dgomes @abmantis
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/izone/* @Swamp-Ig
@@ -206,6 +209,7 @@ homeassistant/components/met/* @danielhiversen
homeassistant/components/meteo_france/* @victorcerutti @oncleben31
homeassistant/components/meteoalarm/* @rolfberkenbosch
homeassistant/components/miflora/* @danielhiversen @ChristianKuehnel
homeassistant/components/mikrotik/* @engrbm87
homeassistant/components/mill/* @danielhiversen
homeassistant/components/min_max/* @fabaff
homeassistant/components/minio/* @tkislan
@@ -219,9 +223,11 @@ homeassistant/components/msteams/* @peroyvind
homeassistant/components/mysensors/* @MartinHjelmare
homeassistant/components/mystrom/* @fabaff
homeassistant/components/neato/* @dshokouhi @Santobert
homeassistant/components/nederlandse_spoorwegen/* @YarmoM
homeassistant/components/nello/* @pschmitt
homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
homeassistant/components/netatmo/* @cgtobi
homeassistant/components/netdata/* @fabaff
homeassistant/components/nextbus/* @vividboarder
homeassistant/components/nilu/* @hfurubotten
@@ -243,9 +249,9 @@ homeassistant/components/onewire/* @garbled1
homeassistant/components/opentherm_gw/* @mvn23
homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/* @fabaff
homeassistant/components/opnsense/* @mtreinish
homeassistant/components/orangepi_gpio/* @pascallj
homeassistant/components/oru/* @bvlaicu
homeassistant/components/owlet/* @oblogic7
homeassistant/components/panel_custom/* @home-assistant/frontend
homeassistant/components/panel_iframe/* @home-assistant/frontend
homeassistant/components/pcal9535a/* @Shulyaka
@@ -277,11 +283,13 @@ homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/ring/* @balloob
homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/* @pschmitt
homeassistant/components/safe_mode/* @home-assistant/core
homeassistant/components/saj/* @fredericvl
homeassistant/components/samsungtv/* @escoand
homeassistant/components/scene/* @home-assistant/core
homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
homeassistant/components/search/* @home-assistant/core
homeassistant/components/sense/* @kbickar
homeassistant/components/sensibo/* @andrey-git
homeassistant/components/sentry/* @dcramer
@@ -290,14 +298,17 @@ homeassistant/components/seventeentrack/* @bachya
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/* @fabaff
homeassistant/components/sighthound/* @robmarkcole
homeassistant/components/signal_messenger/* @bbernhard
homeassistant/components/simplisafe/* @bachya
homeassistant/components/sinch/* @bendikrb
homeassistant/components/sisyphus/* @jkeljo
homeassistant/components/slide/* @ualex73
homeassistant/components/sma/* @kellerza
homeassistant/components/smarthab/* @outadoc
homeassistant/components/smartthings/* @andrewsayre
homeassistant/components/smarty/* @z0mbieprocess
homeassistant/components/sms/* @ocalvo
homeassistant/components/smtp/* @fabaff
homeassistant/components/solaredge_local/* @drobtravels @scheric
homeassistant/components/solarlog/* @Ernst79
@@ -308,6 +319,7 @@ homeassistant/components/songpal/* @rytilahti
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/speedtestdotnet/* @rohankapoorcom
homeassistant/components/spider/* @peternijssen
homeassistant/components/spotify/* @frenck
homeassistant/components/sql/* @dgomes
homeassistant/components/starline/* @anonym-tsk
homeassistant/components/statistics/* @fabaff
@@ -351,6 +363,7 @@ homeassistant/components/tts/* @robbiet480
homeassistant/components/twentemilieu/* @frenck
homeassistant/components/twilio_call/* @robbiet480
homeassistant/components/twilio_sms/* @robbiet480
homeassistant/components/ubee/* @mzdrale
homeassistant/components/unifi/* @kane610
homeassistant/components/unifiled/* @florisvdk
homeassistant/components/upc_connect/* @pvizeli
@@ -360,7 +373,7 @@ homeassistant/components/upnp/* @robbiet480
homeassistant/components/uptimerobot/* @ludeeus
homeassistant/components/usgs_earthquakes_feed/* @exxamalte
homeassistant/components/utility_meter/* @dgomes
homeassistant/components/velbus/* @cereal2nd
homeassistant/components/velbus/* @Cereal2nd @brefra
homeassistant/components/velux/* @Julius2342
homeassistant/components/versasense/* @flamm3blemuff1n
homeassistant/components/version/* @fabaff

View File

@@ -30,7 +30,7 @@ jobs:
- template: templates/azp-job-wheels.yaml@azure
parameters:
builderVersion: '$(versionWheels)'
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev'
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev'
builderPip: 'Cython;numpy'
wheelsRequirement: 'requirements_wheels.txt'
wheelsRequirementDiff: 'requirements_diff.txt'
@@ -68,6 +68,7 @@ jobs:
sed -i "s|# face_recognition|face_recognition|g" ${requirement_file}
sed -i "s|# py_noaa|py_noaa|g" ${requirement_file}
sed -i "s|# bme680|bme680|g" ${requirement_file}
sed -i "s|# python-gammu|python-gammu|g" ${requirement_file}
if [[ "$(buildArch)" =~ arm ]]; then
sed -i "s|# VL53L1X|VL53L1X|g" ${requirement_file}

View File

@@ -6,13 +6,10 @@ import platform
import subprocess
import sys
import threading
from typing import TYPE_CHECKING, Any, Dict, List
from typing import List
from homeassistant.const import REQUIRED_PYTHON_VER, RESTART_EXIT_CODE, __version__
if TYPE_CHECKING:
from homeassistant import core
def set_loop() -> None:
"""Attempt to use different loop."""
@@ -78,19 +75,6 @@ def ensure_config_path(config_dir: str) -> None:
sys.exit(1)
async def ensure_config_file(hass: "core.HomeAssistant", config_dir: str) -> str:
"""Ensure configuration file exists."""
import homeassistant.config as config_util
config_path = await config_util.async_ensure_config_exists(hass, config_dir)
if config_path is None:
print("Error getting configuration path")
sys.exit(1)
return config_path
def get_arguments() -> argparse.Namespace:
"""Get parsed passed in arguments."""
import homeassistant.config as config_util
@@ -107,7 +91,7 @@ def get_arguments() -> argparse.Namespace:
help="Directory that contains the Home Assistant configuration",
)
parser.add_argument(
"--demo-mode", action="store_true", help="Start Home Assistant in demo mode"
"--safe-mode", action="store_true", help="Start Home Assistant in safe mode"
)
parser.add_argument(
"--debug", action="store_true", help="Start Home Assistant in debug mode"
@@ -253,34 +237,20 @@ def cmdline() -> List[str]:
async def setup_and_run_hass(config_dir: str, args: argparse.Namespace) -> int:
"""Set up Home Assistant and run."""
from homeassistant import bootstrap, core
from homeassistant import bootstrap
hass = core.HomeAssistant()
hass = await bootstrap.async_setup_hass(
config_dir=config_dir,
verbose=args.verbose,
log_rotate_days=args.log_rotate_days,
log_file=args.log_file,
log_no_color=args.log_no_color,
skip_pip=args.skip_pip,
safe_mode=args.safe_mode,
)
if args.demo_mode:
config: Dict[str, Any] = {"frontend": {}, "demo": {}}
bootstrap.async_from_config_dict(
config,
hass,
config_dir=config_dir,
verbose=args.verbose,
skip_pip=args.skip_pip,
log_rotate_days=args.log_rotate_days,
log_file=args.log_file,
log_no_color=args.log_no_color,
)
else:
config_file = await ensure_config_file(hass, config_dir)
print("Config directory:", config_dir)
await bootstrap.async_from_config_file(
config_file,
hass,
verbose=args.verbose,
skip_pip=args.skip_pip,
log_rotate_days=args.log_rotate_days,
log_file=args.log_file,
log_no_color=args.log_no_color,
)
if hass is None:
return 1
if args.open_ui and hass.config.api is not None:
import webbrowser
@@ -358,7 +328,7 @@ def main() -> int:
return scripts.run(args.script)
config_dir = os.path.join(os.getcwd(), args.config)
config_dir = os.path.abspath(os.path.join(os.getcwd(), args.config))
ensure_config_path(config_dir)
# Daemon functions

View File

@@ -1,6 +1,5 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
from collections import OrderedDict
import logging
import logging.handlers
import os
@@ -11,6 +10,7 @@ from typing import Any, Dict, Optional, Set
import voluptuous as vol
from homeassistant import config as conf_util, config_entries, core, loader
from homeassistant.components import http
from homeassistant.const import (
EVENT_HOMEASSISTANT_CLOSE,
REQUIRED_NEXT_PYTHON_DATE,
@@ -42,16 +42,68 @@ STAGE_1_INTEGRATIONS = {
}
async def async_setup_hass(
*,
config_dir: str,
verbose: bool,
log_rotate_days: int,
log_file: str,
log_no_color: bool,
skip_pip: bool,
safe_mode: bool,
) -> Optional[core.HomeAssistant]:
"""Set up Home Assistant."""
hass = core.HomeAssistant()
hass.config.config_dir = config_dir
async_enable_logging(hass, verbose, log_rotate_days, log_file, log_no_color)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning(
"Skipping pip installation of required modules. This may cause issues"
)
if not await conf_util.async_ensure_config_exists(hass):
_LOGGER.error("Error getting configuration path")
return None
_LOGGER.info("Config directory: %s", config_dir)
config_dict = None
if not safe_mode:
await hass.async_add_executor_job(conf_util.process_ha_config_upgrade, hass)
try:
config_dict = await conf_util.async_hass_config_yaml(hass)
except HomeAssistantError as err:
_LOGGER.error(
"Failed to parse configuration.yaml: %s. Falling back to safe mode",
err,
)
else:
if not is_virtual_env():
await async_mount_local_lib_path(config_dir)
await async_from_config_dict(config_dict, hass)
finally:
clear_secret_cache()
if safe_mode or config_dict is None:
_LOGGER.info("Starting in safe mode")
http_conf = (await http.async_get_last_config(hass)) or {}
await async_from_config_dict(
{"safe_mode": {}, "http": http_conf}, hass,
)
return hass
async def async_from_config_dict(
config: Dict[str, Any],
hass: core.HomeAssistant,
config_dir: Optional[str] = None,
enable_log: bool = True,
verbose: bool = False,
skip_pip: bool = False,
log_rotate_days: Any = None,
log_file: Any = None,
log_no_color: bool = False,
config: Dict[str, Any], hass: core.HomeAssistant
) -> Optional[core.HomeAssistant]:
"""Try to configure Home Assistant from a configuration dictionary.
@@ -60,15 +112,6 @@ async def async_from_config_dict(
"""
start = time()
if enable_log:
async_enable_logging(hass, verbose, log_rotate_days, log_file, log_no_color)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning(
"Skipping pip installation of required modules. This may cause issues"
)
core_config = config.get(core.DOMAIN, {})
try:
@@ -83,14 +126,6 @@ async def async_from_config_dict(
)
return None
# Make a copy because we are mutating it.
config = OrderedDict(config)
# Merge packages
await conf_util.merge_packages_config(
hass, config, core_config.get(conf_util.CONF_PACKAGES, {})
)
hass.config_entries = config_entries.ConfigEntries(hass, config)
await hass.config_entries.async_initialize()
@@ -116,46 +151,6 @@ async def async_from_config_dict(
return hass
async def async_from_config_file(
config_path: str,
hass: core.HomeAssistant,
verbose: bool = False,
skip_pip: bool = True,
log_rotate_days: Any = None,
log_file: Any = None,
log_no_color: bool = False,
) -> Optional[core.HomeAssistant]:
"""Read the configuration file and try to start all the functionality.
Will add functionality to 'hass' parameter.
This method is a coroutine.
"""
# Set config dir to directory holding config file
config_dir = os.path.abspath(os.path.dirname(config_path))
hass.config.config_dir = config_dir
if not is_virtual_env():
await async_mount_local_lib_path(config_dir)
async_enable_logging(hass, verbose, log_rotate_days, log_file, log_no_color)
await hass.async_add_executor_job(conf_util.process_ha_config_upgrade, hass)
try:
config_dict = await hass.async_add_executor_job(
conf_util.load_yaml_config_file, config_path
)
except HomeAssistantError as err:
_LOGGER.error("Error loading %s: %s", config_path, err)
return None
finally:
clear_secret_cache()
return await async_from_config_dict(
config_dict, hass, enable_log=False, skip_pip=skip_pip
)
@core.callback
def async_enable_logging(
hass: core.HomeAssistant,
@@ -269,7 +264,8 @@ def _get_domains(hass: core.HomeAssistant, config: Dict[str, Any]) -> Set[str]:
domains = set(key.split(" ")[0] for key in config.keys() if key != core.DOMAIN)
# Add config entry domains
domains.update(hass.config_entries.async_domains())
if "safe_mode" not in config:
domains.update(hass.config_entries.async_domains())
# Make sure the Hass.io component is loaded
if "HASSIO" in os.environ:

View File

@@ -21,11 +21,6 @@ _LOGGER = logging.getLogger(__name__)
ICON = "mdi:security"
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode alarm control panel device."""
data = hass.data[DOMAIN]

View File

@@ -13,11 +13,6 @@ from .const import DOMAIN, SIGNAL_TRIGGER_QUICK_ACTION
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode binary sensor devices."""
data = hass.data[DOMAIN]

View File

@@ -18,11 +18,6 @@ MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode camera devices."""
data = hass.data[DOMAIN]

View File

@@ -11,11 +11,6 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode cover devices."""
data = hass.data[DOMAIN]

View File

@@ -24,11 +24,6 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode light devices."""
data = hass.data[DOMAIN]

View File

@@ -11,11 +11,6 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode lock devices."""
data = hass.data[DOMAIN]

View File

@@ -3,7 +3,7 @@
"name": "Abode",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/abode",
"requirements": ["abodepy==0.16.7"],
"requirements": ["abodepy==0.17.0"],
"dependencies": [],
"codeowners": ["@shred86"]
}

View File

@@ -22,11 +22,6 @@ SENSOR_TYPES = {
}
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode sensor devices."""
data = hass.data[DOMAIN]

View File

@@ -12,11 +12,6 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode switch devices."""
data = hass.data[DOMAIN]

View File

@@ -0,0 +1,10 @@
{
"config": {
"step": {
"hassio_confirm": {
"description": "Chcete nakonfigurovat slu\u017ebu Home Assistant pro p\u0159ipojen\u00ed k AddGuard pomoc\u00ed hass.io {addon}?",
"title": "AdGuard prost\u0159ednictv\u00edm dopl\u0148ku Hass.io"
}
}
}
}

View File

@@ -1,8 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Diese Integration erfordert AdGuard Home {minimal_version} oder h\u00f6her, Sie haben {current_version}. Bitte aktualisieren Sie Ihr Hass.io AdGuard Home Add-on.",
"adguard_home_outdated": "Diese Integration erfordert AdGuard Home {minimal_version} oder h\u00f6her, Sie haben {current_version}.",
"adguard_home_addon_outdated": "Diese Integration erfordert AdGuard Home {minimal_version} oder h\u00f6her, du hast {current_version}. Bitte aktualisiere dein Hass.io AdGuard Home Add-on.",
"adguard_home_outdated": "Diese Integration erfordert AdGuard Home {minimal_version} oder h\u00f6her, du hast {current_version}.",
"existing_instance_updated": "Bestehende Konfiguration wurde aktualisiert.",
"single_instance_allowed": "Es ist nur eine einzige Konfiguration von AdGuard Home zul\u00e4ssig."
},

View File

@@ -142,11 +142,14 @@ async def async_unload_entry(hass: HomeAssistantType, entry: ConfigType) -> bool
class AdGuardHomeEntity(Entity):
"""Defines a base AdGuard Home entity."""
def __init__(self, adguard, name: str, icon: str) -> None:
def __init__(
self, adguard, name: str, icon: str, enabled_default: bool = True
) -> None:
"""Initialize the AdGuard Home entity."""
self._name = name
self._icon = icon
self._available = True
self._enabled_default = enabled_default
self._icon = icon
self._name = name
self.adguard = adguard
@property
@@ -159,6 +162,11 @@ class AdGuardHomeEntity(Entity):
"""Return the mdi icon of the entity."""
return self._icon
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added to the entity registry."""
return self._enabled_default
@property
def available(self) -> bool:
"""Return True if entity is available."""
@@ -166,6 +174,9 @@ class AdGuardHomeEntity(Entity):
async def async_update(self) -> None:
"""Update AdGuard Home entity."""
if not self.enabled:
return
try:
await self._adguard_update()
self._available = True

View File

@@ -51,14 +51,20 @@ class AdGuardHomeSensor(AdGuardHomeDeviceEntity):
"""Defines a AdGuard Home sensor."""
def __init__(
self, adguard, name: str, icon: str, measurement: str, unit_of_measurement: str
self,
adguard,
name: str,
icon: str,
measurement: str,
unit_of_measurement: str,
enabled_default: bool = True,
) -> None:
"""Initialize AdGuard Home sensor."""
self._state = None
self._unit_of_measurement = unit_of_measurement
self.measurement = measurement
super().__init__(adguard, name, icon)
super().__init__(adguard, name, icon, enabled_default)
@property
def unique_id(self) -> str:
@@ -109,6 +115,7 @@ class AdGuardHomeBlockedFilteringSensor(AdGuardHomeSensor):
"mdi:magnify-close",
"blocked_filtering",
"queries",
enabled_default=False,
)
async def _adguard_update(self) -> None:
@@ -214,7 +221,12 @@ class AdGuardHomeRulesCountSensor(AdGuardHomeSensor):
def __init__(self, adguard):
"""Initialize AdGuard Home sensor."""
super().__init__(
adguard, "AdGuard Rules Count", "mdi:counter", "rules_count", "rules"
adguard,
"AdGuard Rules Count",
"mdi:counter",
"rules_count",
"rules",
enabled_default=False,
)
async def _adguard_update(self) -> None:

View File

@@ -10,9 +10,9 @@ from homeassistant.components.adguard.const import (
DATA_ADGUARD_VERION,
DOMAIN,
)
from homeassistant.components.switch import SwitchDevice
from homeassistant.config_entries import ConfigEntry
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.typing import HomeAssistantType
_LOGGER = logging.getLogger(__name__)
@@ -45,14 +45,16 @@ async def async_setup_entry(
async_add_entities(switches, True)
class AdGuardHomeSwitch(ToggleEntity, AdGuardHomeDeviceEntity):
class AdGuardHomeSwitch(AdGuardHomeDeviceEntity, SwitchDevice):
"""Defines a AdGuard Home switch."""
def __init__(self, adguard, name: str, icon: str, key: str):
def __init__(
self, adguard, name: str, icon: str, key: str, enabled_default: bool = True
):
"""Initialize AdGuard Home switch."""
self._state = False
self._key = key
super().__init__(adguard, name, icon)
super().__init__(adguard, name, icon, enabled_default)
@property
def unique_id(self) -> str:
@@ -204,7 +206,13 @@ class AdGuardHomeQueryLogSwitch(AdGuardHomeSwitch):
def __init__(self, adguard) -> None:
"""Initialize AdGuard Home switch."""
super().__init__(adguard, "AdGuard Query Log", "mdi:shield-check", "querylog")
super().__init__(
adguard,
"AdGuard Query Log",
"mdi:shield-check",
"querylog",
enabled_default=False,
)
async def _adguard_turn_off(self) -> None:
"""Turn off the switch."""

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Airly-integration for disse koordinater er allerede konfigureret."
},
"error": {
"auth": "API-n\u00f8glen er ikke korrekt.",
"name_exists": "Navnet findes allerede.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Die Airly-Integration ist f\u00fcr diese Koordinaten bereits konfiguriert."
},
"error": {
"auth": "Der API-Schl\u00fcssel ist nicht korrekt.",
"name_exists": "Name existiert bereits",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Airly integration for these coordinates is already configured."
},
"error": {
"auth": "API key is not correct.",
"name_exists": "Name already exists.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "La integraci\u00f3n a\u00e9rea para estas coordenadas ya est\u00e1 configurada."
},
"error": {
"auth": "La clave de la API no es correcta.",
"name_exists": "El nombre ya existe.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "L'int\u00e9gration des coordonn\u00e9es d'Airly est d\u00e9j\u00e0 configur\u00e9."
},
"error": {
"auth": "La cl\u00e9 API n'est pas correcte.",
"name_exists": "Le nom existe d\u00e9j\u00e0.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "L'integrazione Airly per queste coordinate \u00e8 gi\u00e0 configurata."
},
"error": {
"auth": "La chiave API non \u00e8 corretta.",
"name_exists": "Il nome \u00e8 gi\u00e0 esistente",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "\uc774 \uc88c\ud45c\uc5d0 \ub300\ud55c Airly \ud1b5\ud569 \uad6c\uc131\uc694\uc18c\ub294 \uc774\ubbf8 \uad6c\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4."
},
"error": {
"auth": "API \ud0a4\uac00 \uc62c\ubc14\ub974\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.",
"name_exists": "\uc774\ub984\uc774 \uc774\ubbf8 \uc874\uc7ac\ud569\ub2c8\ub2e4.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Airly Integratioun fir d\u00ebs Koordinaten ass scho konfigur\u00e9iert."
},
"error": {
"auth": "Api Schl\u00ebssel ass net korrekt.",
"name_exists": "Numm g\u00ebtt et schonn",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Airly integrering for disse koordinatene er allerede konfigurert."
},
"error": {
"auth": "API-n\u00f8kkelen er ikke korrekt.",
"name_exists": "Navnet finnes allerede.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Integracja Airly dla tych wsp\u00f3\u0142rz\u0119dnych jest ju\u017c skonfigurowana."
},
"error": {
"auth": "Klucz API jest nieprawid\u0142owy.",
"name_exists": "Nazwa ju\u017c istnieje.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Airly \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430\u043c\u0438 \u0443\u0436\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430."
},
"error": {
"auth": "\u041d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 API.",
"name_exists": "\u042d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f.",

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "\u6b64 Airly \u6574\u5408\u5df2\u7d93\u8a2d\u5b9a\u5b8c\u6210\u3002"
},
"error": {
"auth": "API \u5bc6\u9470\u4e0d\u6b63\u78ba\u3002",
"name_exists": "\u8a72\u540d\u7a31\u5df2\u5b58\u5728",

View File

@@ -41,6 +41,12 @@ async def async_setup_entry(hass, config_entry):
latitude = config_entry.data[CONF_LATITUDE]
longitude = config_entry.data[CONF_LONGITUDE]
# For backwards compat, set unique ID
if config_entry.unique_id is None:
hass.config_entries.async_update_entry(
config_entry, unique_id=f"{latitude}-{longitude}"
)
websession = async_get_clientsession(hass)
airly = AirlyData(websession, api_key, latitude, longitude)

View File

@@ -5,7 +5,7 @@ from homeassistant.components.air_quality import (
ATTR_PM_10,
AirQualityEntity,
)
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
from homeassistant.const import CONF_NAME
from .const import (
ATTR_API_ADVICE,
@@ -35,13 +35,10 @@ LABEL_PM_10_PERCENT = f"{ATTR_PM_10}_percent_of_limit"
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Airly air_quality entity based on a config entry."""
name = config_entry.data[CONF_NAME]
latitude = config_entry.data[CONF_LATITUDE]
longitude = config_entry.data[CONF_LONGITUDE]
unique_id = f"{latitude}-{longitude}"
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
async_add_entities([AirlyAirQuality(data, name, unique_id)], True)
async_add_entities([AirlyAirQuality(data, name, config_entry.unique_id)], True)
def round_state(func):

View File

@@ -6,19 +6,14 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
from homeassistant.core import callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
from .const import DEFAULT_NAME, DOMAIN, NO_AIRLY_SENSORS
@callback
def configured_instances(hass):
"""Return a set of configured Airly instances."""
return set(
entry.data[CONF_NAME] for entry in hass.config_entries.async_entries(DOMAIN)
)
from .const import ( # pylint:disable=unused-import
DEFAULT_NAME,
DOMAIN,
NO_AIRLY_SENSORS,
)
class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@@ -38,8 +33,10 @@ class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
websession = async_get_clientsession(self.hass)
if user_input is not None:
if user_input[CONF_NAME] in configured_instances(self.hass):
self._errors[CONF_NAME] = "name_exists"
await self.async_set_unique_id(
f"{user_input[CONF_LATITUDE]}-{user_input[CONF_LONGITUDE]}"
)
self._abort_if_unique_id_configured()
api_key_valid = await self._test_api_key(websession, user_input["api_key"])
if not api_key_valid:
self._errors["base"] = "auth"

View File

@@ -2,8 +2,6 @@
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_PRESSURE,
@@ -62,14 +60,12 @@ SENSOR_TYPES = {
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Airly sensor entities based on a config entry."""
name = config_entry.data[CONF_NAME]
latitude = config_entry.data[CONF_LATITUDE]
longitude = config_entry.data[CONF_LONGITUDE]
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
sensors = []
for sensor in SENSOR_TYPES:
unique_id = f"{latitude}-{longitude}-{sensor.lower()}"
unique_id = f"{config_entry.unique_id}-{sensor.lower()}"
sensors.append(AirlySensor(data, name, sensor, unique_id))
async_add_entities(sensors, True)

View File

@@ -14,9 +14,11 @@
}
},
"error": {
"name_exists": "Name already exists.",
"wrong_location": "No Airly measuring stations in this area.",
"auth": "API key is not correct."
},
"abort": {
"already_configured": "Airly integration for these coordinates is already configured."
}
}
}

View File

@@ -1,5 +1,12 @@
{
"device_automation": {
"action_type": {
"arm_away": "Aktiviere {entity_name} Unterwegs",
"arm_home": "Aktiviere {entity_name} Zuhause",
"arm_night": "Aktiviere {entity_name} Nacht-Modus",
"disarm": "Deaktivere {entity_name}",
"trigger": "Ausl\u00f6ser {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} Unterwegs",
"armed_home": "{entity_name} Zuhause",

View File

@@ -121,67 +121,49 @@ class AlarmControlPanel(Entity):
"""Send disarm command."""
raise NotImplementedError()
def async_alarm_disarm(self, code=None):
"""Send disarm command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_disarm, code)
async def async_alarm_disarm(self, code=None):
"""Send disarm command."""
await self.hass.async_add_executor_job(self.alarm_disarm, code)
def alarm_arm_home(self, code=None):
"""Send arm home command."""
raise NotImplementedError()
def async_alarm_arm_home(self, code=None):
"""Send arm home command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_arm_home, code)
async def async_alarm_arm_home(self, code=None):
"""Send arm home command."""
await self.hass.async_add_executor_job(self.alarm_arm_home, code)
def alarm_arm_away(self, code=None):
"""Send arm away command."""
raise NotImplementedError()
def async_alarm_arm_away(self, code=None):
"""Send arm away command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_arm_away, code)
async def async_alarm_arm_away(self, code=None):
"""Send arm away command."""
await self.hass.async_add_executor_job(self.alarm_arm_away, code)
def alarm_arm_night(self, code=None):
"""Send arm night command."""
raise NotImplementedError()
def async_alarm_arm_night(self, code=None):
"""Send arm night command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_arm_night, code)
async def async_alarm_arm_night(self, code=None):
"""Send arm night command."""
await self.hass.async_add_executor_job(self.alarm_arm_night, code)
def alarm_trigger(self, code=None):
"""Send alarm trigger command."""
raise NotImplementedError()
def async_alarm_trigger(self, code=None):
"""Send alarm trigger command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_trigger, code)
async def async_alarm_trigger(self, code=None):
"""Send alarm trigger command."""
await self.hass.async_add_executor_job(self.alarm_trigger, code)
def alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command."""
raise NotImplementedError()
def async_alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command.
This method must be run in the event loop and returns a coroutine.
"""
return self.hass.async_add_executor_job(self.alarm_arm_custom_bypass, code)
async def async_alarm_arm_custom_bypass(self, code=None):
"""Send arm custom bypass command."""
await self.hass.async_add_executor_job(self.alarm_arm_custom_bypass, code)
@property
@abstractmethod

View File

@@ -118,11 +118,12 @@ def setup(hass, config):
conf = config.get(DOMAIN)
restart = False
device = conf.get(CONF_DEVICE)
display = conf.get(CONF_PANEL_DISPLAY)
device = conf[CONF_DEVICE]
display = conf[CONF_PANEL_DISPLAY]
auto_bypass = conf[CONF_AUTO_BYPASS]
zones = conf.get(CONF_ZONES)
device_type = device.get(CONF_DEVICE_TYPE)
device_type = device[CONF_DEVICE_TYPE]
host = DEFAULT_DEVICE_HOST
port = DEFAULT_DEVICE_PORT
path = DEFAULT_DEVICE_PATH
@@ -204,7 +205,9 @@ def setup(hass, config):
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_alarmdecoder)
load_platform(hass, "alarm_control_panel", DOMAIN, conf, config)
load_platform(
hass, "alarm_control_panel", DOMAIN, {CONF_AUTO_BYPASS: auto_bypass}, config
)
if zones:
load_platform(hass, "binary_sensor", DOMAIN, {CONF_ZONES: zones}, config)

View File

@@ -21,7 +21,7 @@ from homeassistant.const import (
)
import homeassistant.helpers.config_validation as cv
from . import DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
from . import CONF_AUTO_BYPASS, DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
_LOGGER = logging.getLogger(__name__)
@@ -35,13 +35,17 @@ ALARM_KEYPRESS_SCHEMA = vol.Schema({vol.Required(ATTR_KEYPRESS): cv.string})
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up for AlarmDecoder alarm panels."""
device = AlarmDecoderAlarmPanel(discovery_info["autobypass"])
add_entities([device])
if discovery_info is None:
return
auto_bypass = discovery_info[CONF_AUTO_BYPASS]
entity = AlarmDecoderAlarmPanel(auto_bypass)
add_entities([entity])
def alarm_toggle_chime_handler(service):
"""Register toggle chime handler."""
code = service.data.get(ATTR_CODE)
device.alarm_toggle_chime(code)
entity.alarm_toggle_chime(code)
hass.services.register(
DOMAIN,
@@ -53,7 +57,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
def alarm_keypress_handler(service):
"""Register keypress handler."""
keypress = service.data[ATTR_KEYPRESS]
device.alarm_keypress(keypress)
entity.alarm_keypress(keypress)
hass.services.register(
DOMAIN,

View File

@@ -2,7 +2,9 @@
"domain": "alarmdecoder",
"name": "AlarmDecoder",
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
"requirements": ["alarmdecoder==1.13.9"],
"requirements": [
"alarmdecoder==1.13.2"
],
"dependencies": [],
"codeowners": []
}

View File

@@ -115,7 +115,7 @@ class AlarmDotCom(alarm.AlarmControlPanel):
await self._alarm.async_alarm_disarm()
async def async_alarm_arm_home(self, code=None):
"""Send arm hom command."""
"""Send arm home command."""
if self._validate_code(code):
await self._alarm.async_alarm_arm_home()

View File

@@ -1,8 +1,20 @@
"""Alexa capabilities."""
import logging
from homeassistant.components import cover, fan, image_processing, input_number, light
from homeassistant.components import (
cover,
fan,
image_processing,
input_number,
light,
vacuum,
)
from homeassistant.components.alarm_control_panel import ATTR_CODE_FORMAT, FORMAT_NUMBER
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
import homeassistant.components.climate.const as climate
import homeassistant.components.media_player.const as media_player
from homeassistant.const import (
@@ -31,7 +43,6 @@ from .const import (
API_THERMOSTAT_PRESETS,
DATE_FORMAT,
PERCENTAGE_FAN_MAP,
RANGE_FAN_MAP,
Inputs,
)
from .errors import UnsupportedProperty
@@ -503,6 +514,10 @@ class AlexaColorController(AlexaCapability):
"""Return what properties this entity supports."""
return [{"name": "color"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self):
"""Return True if properties can be retrieved."""
return True
@@ -548,6 +563,10 @@ class AlexaColorTemperatureController(AlexaCapability):
"""Return what properties this entity supports."""
return [{"name": "colorTemperatureInKelvin"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self):
"""Return True if properties can be retrieved."""
return True
@@ -590,6 +609,10 @@ class AlexaPercentageController(AlexaCapability):
"""Return what properties this entity supports."""
return [{"name": "percentage"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self):
"""Return True if properties can be retrieved."""
return True
@@ -1064,15 +1087,37 @@ class AlexaSecurityPanelController(AlexaCapability):
def configuration(self):
"""Return configuration object with supported authorization types."""
code_format = self.entity.attributes.get(ATTR_CODE_FORMAT)
supported = self.entity.attributes[ATTR_SUPPORTED_FEATURES]
configuration = {}
supported_arm_states = [{"value": "DISARMED"}]
if supported & SUPPORT_ALARM_ARM_AWAY:
supported_arm_states.append({"value": "ARMED_AWAY"})
if supported & SUPPORT_ALARM_ARM_HOME:
supported_arm_states.append({"value": "ARMED_STAY"})
if supported & SUPPORT_ALARM_ARM_NIGHT:
supported_arm_states.append({"value": "ARMED_NIGHT"})
configuration["supportedArmStates"] = supported_arm_states
if code_format == FORMAT_NUMBER:
return {"supportedAuthorizationTypes": [{"type": "FOUR_DIGIT_PIN"}]}
return None
configuration["supportedAuthorizationTypes"] = [{"type": "FOUR_DIGIT_PIN"}]
return configuration
class AlexaModeController(AlexaCapability):
"""Implements Alexa.ModeController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
https://developer.amazon.com/docs/device-apis/alexa-modecontroller.html
"""
@@ -1176,35 +1221,48 @@ class AlexaModeController(AlexaCapability):
f"{cover.ATTR_POSITION}.{cover.STATE_CLOSED}",
[AlexaGlobalCatalog.VALUE_CLOSE],
)
self._resource.add_mode(f"{cover.ATTR_POSITION}.custom", ["Custom"])
self._resource.add_mode(
f"{cover.ATTR_POSITION}.custom",
["Custom", AlexaGlobalCatalog.SETTING_PRESET],
)
return self._resource.serialize_capability_resources()
return None
def semantics(self):
"""Build and return semantics object."""
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
# Cover Position
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
lower_labels = [AlexaSemantics.ACTION_LOWER]
raise_labels = [AlexaSemantics.ACTION_RAISE]
self._semantics = AlexaSemantics()
# Add open/close semantics if tilt is not supported.
if not supported & cover.SUPPORT_SET_TILT_POSITION:
lower_labels.append(AlexaSemantics.ACTION_CLOSE)
raise_labels.append(AlexaSemantics.ACTION_OPEN)
self._semantics.add_states_to_value(
[AlexaSemantics.STATES_CLOSED],
f"{cover.ATTR_POSITION}.{cover.STATE_CLOSED}",
)
self._semantics.add_states_to_value(
[AlexaSemantics.STATES_OPEN],
f"{cover.ATTR_POSITION}.{cover.STATE_OPEN}",
)
self._semantics.add_action_to_directive(
[AlexaSemantics.ACTION_CLOSE, AlexaSemantics.ACTION_LOWER],
lower_labels,
"SetMode",
{"mode": f"{cover.ATTR_POSITION}.{cover.STATE_CLOSED}"},
)
self._semantics.add_action_to_directive(
[AlexaSemantics.ACTION_OPEN, AlexaSemantics.ACTION_RAISE],
raise_labels,
"SetMode",
{"mode": f"{cover.ATTR_POSITION}.{cover.STATE_OPEN}"},
)
self._semantics.add_states_to_value(
[AlexaSemantics.STATES_CLOSED],
f"{cover.ATTR_POSITION}.{cover.STATE_CLOSED}",
)
self._semantics.add_states_to_value(
[AlexaSemantics.STATES_OPEN],
f"{cover.ATTR_POSITION}.{cover.STATE_OPEN}",
)
return self._semantics.serialize_semantics()
return None
@@ -1213,6 +1271,15 @@ class AlexaModeController(AlexaCapability):
class AlexaRangeController(AlexaCapability):
"""Implements Alexa.RangeController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
https://developer.amazon.com/docs/device-apis/alexa-rangecontroller.html
"""
@@ -1259,23 +1326,43 @@ class AlexaRangeController(AlexaCapability):
if name != "rangeValue":
raise UnsupportedProperty(name)
# Return None for unavailable and unknown states.
# Allows the Alexa.EndpointHealth Interface to handle the unavailable state in a stateReport.
if self.entity.state in (STATE_UNAVAILABLE, STATE_UNKNOWN, None):
return None
# Fan Speed
if self.instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
speed_list = self.entity.attributes.get(fan.ATTR_SPEED_LIST)
speed = self.entity.attributes.get(fan.ATTR_SPEED)
return RANGE_FAN_MAP.get(speed, 0)
if speed_list is not None and speed is not None:
speed_index = next(
(i for i, v in enumerate(speed_list) if v == speed), None
)
return speed_index
# Cover Position
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
return self.entity.attributes.get(cover.ATTR_CURRENT_POSITION)
# Cover Tilt Position
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
# Cover Tilt
if self.instance == f"{cover.DOMAIN}.tilt":
return self.entity.attributes.get(cover.ATTR_CURRENT_TILT_POSITION)
# Input Number Value
if self.instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
return float(self.entity.state)
# Vacuum Fan Speed
if self.instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
speed_list = self.entity.attributes.get(vacuum.ATTR_FAN_SPEED_LIST)
speed = self.entity.attributes.get(vacuum.ATTR_FAN_SPEED)
if speed_list is not None and speed is not None:
speed_index = next(
(i for i, v in enumerate(speed_list) if v == speed), None
)
return speed_index
return None
def configuration(self):
@@ -1290,24 +1377,26 @@ class AlexaRangeController(AlexaCapability):
# Fan Speed Resources
if self.instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
speed_list = self.entity.attributes[fan.ATTR_SPEED_LIST]
max_value = len(speed_list) - 1
self._resource = AlexaPresetResource(
labels=[AlexaGlobalCatalog.SETTING_FAN_SPEED],
min_value=1,
max_value=3,
min_value=0,
max_value=max_value,
precision=1,
)
self._resource.add_preset(
value=1,
labels=[AlexaGlobalCatalog.VALUE_LOW, AlexaGlobalCatalog.VALUE_MINIMUM],
)
self._resource.add_preset(value=2, labels=[AlexaGlobalCatalog.VALUE_MEDIUM])
self._resource.add_preset(
value=3,
labels=[
AlexaGlobalCatalog.VALUE_HIGH,
AlexaGlobalCatalog.VALUE_MAXIMUM,
],
)
for index, speed in enumerate(speed_list):
labels = []
if isinstance(speed, str):
labels.append(speed.replace("_", " "))
if index == 1:
labels.append(AlexaGlobalCatalog.VALUE_MINIMUM)
if index == max_value:
labels.append(AlexaGlobalCatalog.VALUE_MAXIMUM)
if len(labels) > 0:
self._resource.add_preset(value=index, labels=labels)
return self._resource.serialize_capability_resources()
# Cover Position Resources
@@ -1321,10 +1410,10 @@ class AlexaRangeController(AlexaCapability):
)
return self._resource.serialize_capability_resources()
# Cover Tilt Position Resources
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
# Cover Tilt Resources
if self.instance == f"{cover.DOMAIN}.tilt":
self._resource = AlexaPresetResource(
["Tilt Position", AlexaGlobalCatalog.SETTING_OPENING],
["Tilt", "Angle", AlexaGlobalCatalog.SETTING_DIRECTION],
min_value=0,
max_value=100,
precision=1,
@@ -1340,7 +1429,7 @@ class AlexaRangeController(AlexaCapability):
unit = self.entity.attributes.get(input_number.ATTR_UNIT_OF_MEASUREMENT)
self._resource = AlexaPresetResource(
["Value"],
["Value", AlexaGlobalCatalog.SETTING_PRESET],
min_value=min_value,
max_value=max_value,
precision=precision,
@@ -1354,28 +1443,59 @@ class AlexaRangeController(AlexaCapability):
)
return self._resource.serialize_capability_resources()
# Vacuum Fan Speed Resources
if self.instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
speed_list = self.entity.attributes[vacuum.ATTR_FAN_SPEED_LIST]
max_value = len(speed_list) - 1
self._resource = AlexaPresetResource(
labels=[AlexaGlobalCatalog.SETTING_FAN_SPEED],
min_value=0,
max_value=max_value,
precision=1,
)
for index, speed in enumerate(speed_list):
labels = [speed.replace("_", " ")]
if index == 1:
labels.append(AlexaGlobalCatalog.VALUE_MINIMUM)
if index == max_value:
labels.append(AlexaGlobalCatalog.VALUE_MAXIMUM)
self._resource.add_preset(value=index, labels=labels)
return self._resource.serialize_capability_resources()
return None
def semantics(self):
"""Build and return semantics object."""
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
# Cover Position
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
lower_labels = [AlexaSemantics.ACTION_LOWER]
raise_labels = [AlexaSemantics.ACTION_RAISE]
self._semantics = AlexaSemantics()
# Add open/close semantics if tilt is not supported.
if not supported & cover.SUPPORT_SET_TILT_POSITION:
lower_labels.append(AlexaSemantics.ACTION_CLOSE)
raise_labels.append(AlexaSemantics.ACTION_OPEN)
self._semantics.add_states_to_value(
[AlexaSemantics.STATES_CLOSED], value=0
)
self._semantics.add_states_to_range(
[AlexaSemantics.STATES_OPEN], min_value=1, max_value=100
)
self._semantics.add_action_to_directive(
[AlexaSemantics.ACTION_LOWER], "SetRangeValue", {"rangeValue": 0}
lower_labels, "SetRangeValue", {"rangeValue": 0}
)
self._semantics.add_action_to_directive(
[AlexaSemantics.ACTION_RAISE], "SetRangeValue", {"rangeValue": 100}
)
self._semantics.add_states_to_value([AlexaSemantics.STATES_CLOSED], value=0)
self._semantics.add_states_to_range(
[AlexaSemantics.STATES_OPEN], min_value=1, max_value=100
raise_labels, "SetRangeValue", {"rangeValue": 100}
)
return self._semantics.serialize_semantics()
# Cover Tilt Position
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
# Cover Tilt
if self.instance == f"{cover.DOMAIN}.tilt":
self._semantics = AlexaSemantics()
self._semantics.add_action_to_directive(
[AlexaSemantics.ACTION_CLOSE], "SetRangeValue", {"rangeValue": 0}
@@ -1395,6 +1515,15 @@ class AlexaRangeController(AlexaCapability):
class AlexaToggleController(AlexaCapability):
"""Implements Alexa.ToggleController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
https://developer.amazon.com/docs/device-apis/alexa-togglecontroller.html
"""
@@ -1653,3 +1782,29 @@ class AlexaEqualizerController(AlexaCapability):
configurations = {"modes": {"supported": supported_sound_modes}}
return configurations
class AlexaTimeHoldController(AlexaCapability):
"""Implements Alexa.TimeHoldController.
https://developer.amazon.com/docs/device-apis/alexa-timeholdcontroller.html
"""
supported_locales = {"en-US"}
def __init__(self, entity, allow_remote_resume=False):
"""Initialize the entity."""
super().__init__(entity)
self._allow_remote_resume = allow_remote_resume
def name(self):
"""Return the Alexa API name of this interface."""
return "Alexa.TimeHoldController"
def configuration(self):
"""Return configuration object.
Set allowRemoteResume to True if Alexa can restart the operation on the device.
When false, Alexa does not send the Resume directive.
"""
return {"allowRemoteResume": self._allow_remote_resume}

View File

@@ -84,20 +84,6 @@ PERCENTAGE_FAN_MAP = {
fan.SPEED_HIGH: 100,
}
RANGE_FAN_MAP = {
fan.SPEED_OFF: 0,
fan.SPEED_LOW: 1,
fan.SPEED_MEDIUM: 2,
fan.SPEED_HIGH: 3,
}
SPEED_FAN_MAP = {
0: fan.SPEED_OFF,
1: fan.SPEED_LOW,
2: fan.SPEED_MEDIUM,
3: fan.SPEED_HIGH,
}
class Cause:
"""Possible causes for property changes.

View File

@@ -19,6 +19,8 @@ from homeassistant.components import (
script,
sensor,
switch,
timer,
vacuum,
)
from homeassistant.components.climate import const as climate
from homeassistant.const import (
@@ -61,6 +63,7 @@ from .capabilities import (
AlexaStepSpeaker,
AlexaTemperatureSensor,
AlexaThermostatController,
AlexaTimeHoldController,
AlexaToggleController,
)
from .const import CONF_DESCRIPTION, CONF_DISPLAY_CATEGORIES
@@ -255,6 +258,9 @@ class AlexaEntity:
def serialize_properties(self):
"""Yield each supported property in API format."""
for interface in self.interfaces():
if not interface.properties_proactively_reported():
continue
for prop in interface.serialize_properties():
yield prop
@@ -394,6 +400,7 @@ class CoverCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaPowerController(self.entity)
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & cover.SUPPORT_SET_POSITION:
yield AlexaRangeController(
@@ -404,9 +411,7 @@ class CoverCapabilities(AlexaEntity):
self.entity, instance=f"{cover.DOMAIN}.{cover.ATTR_POSITION}"
)
if supported & cover.SUPPORT_SET_TILT_POSITION:
yield AlexaRangeController(
self.entity, instance=f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}"
)
yield AlexaRangeController(self.entity, instance=f"{cover.DOMAIN}.tilt")
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@@ -705,3 +710,48 @@ class InputNumberCapabilities(AlexaEntity):
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(timer.DOMAIN)
class TimerCapabilities(AlexaEntity):
"""Class to represent Timer capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.OTHER]
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaTimeHoldController(self.entity, allow_remote_resume=True)
yield Alexa(self.entity)
@ENTITY_ADAPTERS.register(vacuum.DOMAIN)
class VacuumCapabilities(AlexaEntity):
"""Class to represent vacuum capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.OTHER]
def interfaces(self):
"""Yield the supported interfaces."""
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if (supported & vacuum.SUPPORT_TURN_ON) and (
supported & vacuum.SUPPORT_TURN_OFF
):
yield AlexaPowerController(self.entity)
if supported & vacuum.SUPPORT_FAN_SPEED:
yield AlexaRangeController(
self.entity, instance=f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}"
)
if supported & vacuum.SUPPORT_PAUSE:
support_resume = bool(supported & vacuum.SUPPORT_START)
yield AlexaTimeHoldController(
self.entity, allow_remote_resume=support_resume
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)

View File

@@ -10,6 +10,8 @@ from homeassistant.components import (
input_number,
light,
media_player,
timer,
vacuum,
)
from homeassistant.components.climate import const as climate
from homeassistant.const import (
@@ -50,8 +52,6 @@ from .const import (
API_THERMOSTAT_MODES_CUSTOM,
API_THERMOSTAT_PRESETS,
PERCENTAGE_FAN_MAP,
RANGE_FAN_MAP,
SPEED_FAN_MAP,
Cause,
Inputs,
)
@@ -119,7 +119,9 @@ async def async_api_turn_on(hass, config, directive, context):
domain = ha.DOMAIN
service = SERVICE_TURN_ON
if domain == media_player.DOMAIN:
if domain == cover.DOMAIN:
service = cover.SERVICE_OPEN_COVER
elif domain == media_player.DOMAIN:
supported = entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
power_features = media_player.SUPPORT_TURN_ON | media_player.SUPPORT_TURN_OFF
if not supported & power_features:
@@ -145,7 +147,9 @@ async def async_api_turn_off(hass, config, directive, context):
domain = ha.DOMAIN
service = SERVICE_TURN_OFF
if domain == media_player.DOMAIN:
if entity.domain == cover.DOMAIN:
service = cover.SERVICE_CLOSE_COVER
elif domain == media_player.DOMAIN:
supported = entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
power_features = media_player.SUPPORT_TURN_ON | media_player.SUPPORT_TURN_OFF
if not supported & power_features:
@@ -908,8 +912,11 @@ async def async_api_arm(hass, config, directive, context):
entity.domain, service, data, blocking=False, context=context
)
# return 0 until alarm integration supports an exit delay
payload = {"exitDelayInSeconds": 0}
response = directive.response(
name="Arm.Response", namespace="Alexa.SecurityPanelController"
name="Arm.Response", namespace="Alexa.SecurityPanelController", payload=payload
)
response.add_context_property(
@@ -928,6 +935,12 @@ async def async_api_disarm(hass, config, directive, context):
"""Process a Security Panel Disarm request."""
entity = directive.entity
data = {ATTR_ENTITY_ID: entity.entity_id}
response = directive.response()
# Per Alexa Documentation: If you receive a Disarm directive, and the system is already disarmed,
# respond with a success response, not an error response.
if entity.state == STATE_ALARM_DISARMED:
return response
payload = directive.payload
if "authorization" in payload:
@@ -941,7 +954,6 @@ async def async_api_disarm(hass, config, directive, context):
msg = "Invalid Code"
raise AlexaSecurityPanelUnauthorizedError(msg)
response = directive.response()
response.add_context_property(
{
"name": "armState",
@@ -1095,8 +1107,10 @@ async def async_api_set_range(hass, config, directive, context):
# Fan Speed
if instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
range_value = int(range_value)
service = fan.SERVICE_SET_SPEED
speed = SPEED_FAN_MAP.get(int(range_value))
speed_list = entity.attributes[fan.ATTR_SPEED_LIST]
speed = next((v for i, v in enumerate(speed_list) if i == range_value), None)
if not speed:
msg = "Entity does not support value"
@@ -1118,8 +1132,8 @@ async def async_api_set_range(hass, config, directive, context):
service = cover.SERVICE_SET_COVER_POSITION
data[cover.ATTR_POSITION] = range_value
# Cover Tilt Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
# Cover Tilt
elif instance == f"{cover.DOMAIN}.tilt":
range_value = int(range_value)
if range_value == 0:
service = cover.SERVICE_CLOSE_COVER_TILT
@@ -1127,7 +1141,7 @@ async def async_api_set_range(hass, config, directive, context):
service = cover.SERVICE_OPEN_COVER_TILT
else:
service = cover.SERVICE_SET_COVER_TILT_POSITION
data[cover.ATTR_POSITION] = range_value
data[cover.ATTR_TILT_POSITION] = range_value
# Input Number Value
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
@@ -1137,6 +1151,20 @@ async def async_api_set_range(hass, config, directive, context):
max_value = float(entity.attributes[input_number.ATTR_MAX])
data[input_number.ATTR_VALUE] = min(max_value, max(min_value, range_value))
# Vacuum Fan Speed
elif instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
service = vacuum.SERVICE_SET_FAN_SPEED
speed_list = entity.attributes[vacuum.ATTR_FAN_SPEED_LIST]
speed = next(
(v for i, v in enumerate(speed_list) if i == int(range_value)), None
)
if not speed:
msg = "Entity does not support value"
raise AlexaInvalidValueError(msg)
data[vacuum.ATTR_FAN_SPEED] = speed
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
@@ -1167,15 +1195,23 @@ async def async_api_adjust_range(hass, config, directive, context):
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
range_delta = directive.payload["rangeValueDelta"]
range_delta_default = bool(directive.payload["rangeValueDeltaDefault"])
response_value = 0
# Fan Speed
if instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
range_delta = int(range_delta)
service = fan.SERVICE_SET_SPEED
current_range = RANGE_FAN_MAP.get(entity.attributes.get(fan.ATTR_SPEED), 0)
speed = SPEED_FAN_MAP.get(
min(3, max(0, range_delta + current_range)), fan.SPEED_OFF
speed_list = entity.attributes[fan.ATTR_SPEED_LIST]
current_speed = entity.attributes[fan.ATTR_SPEED]
current_speed_index = next(
(i for i, v in enumerate(speed_list) if v == current_speed), 0
)
new_speed_index = min(
len(speed_list) - 1, max(0, current_speed_index + range_delta)
)
speed = next(
(v for i, v in enumerate(speed_list) if i == new_speed_index), None
)
if speed == fan.SPEED_OFF:
@@ -1185,21 +1221,37 @@ async def async_api_adjust_range(hass, config, directive, context):
# Cover Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
range_delta = int(range_delta)
range_delta = int(range_delta * 20) if range_delta_default else int(range_delta)
service = SERVICE_SET_COVER_POSITION
current = entity.attributes.get(cover.ATTR_POSITION)
data[cover.ATTR_POSITION] = response_value = min(
100, max(0, range_delta + current)
)
if not current:
msg = "Unable to determine {} current position".format(entity.entity_id)
raise AlexaInvalidValueError(msg)
position = response_value = min(100, max(0, range_delta + current))
if position == 100:
service = cover.SERVICE_OPEN_COVER
elif position == 0:
service = cover.SERVICE_CLOSE_COVER
else:
data[cover.ATTR_POSITION] = position
# Cover Tilt Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
range_delta = int(range_delta)
# Cover Tilt
elif instance == f"{cover.DOMAIN}.tilt":
range_delta = int(range_delta * 20) if range_delta_default else int(range_delta)
service = SERVICE_SET_COVER_TILT_POSITION
current = entity.attributes.get(cover.ATTR_TILT_POSITION)
data[cover.ATTR_TILT_POSITION] = response_value = min(
100, max(0, range_delta + current)
)
if not current:
msg = "Unable to determine {} current tilt position".format(
entity.entity_id
)
raise AlexaInvalidValueError(msg)
tilt_position = response_value = min(100, max(0, range_delta + current))
if tilt_position == 100:
service = cover.SERVICE_OPEN_COVER_TILT
elif tilt_position == 0:
service = cover.SERVICE_CLOSE_COVER_TILT
else:
data[cover.ATTR_TILT_POSITION] = tilt_position
# Input Number Value
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
@@ -1212,6 +1264,24 @@ async def async_api_adjust_range(hass, config, directive, context):
max_value, max(min_value, range_delta + current)
)
# Vacuum Fan Speed
elif instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
range_delta = int(range_delta)
service = vacuum.SERVICE_SET_FAN_SPEED
speed_list = entity.attributes[vacuum.ATTR_FAN_SPEED_LIST]
current_speed = entity.attributes[vacuum.ATTR_FAN_SPEED]
current_speed_index = next(
(i for i, v in enumerate(speed_list) if v == current_speed), 0
)
new_speed_index = min(
len(speed_list) - 1, max(0, current_speed_index + range_delta)
)
speed = next(
(v for i, v in enumerate(speed_list) if i == new_speed_index), None
)
data[vacuum.ATTR_FAN_SPEED] = response_value = speed
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
@@ -1396,3 +1466,49 @@ async def async_api_bands_directive(hass, config, directive, context):
# Currently bands directives are not supported.
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
@HANDLERS.register(("Alexa.TimeHoldController", "Hold"))
async def async_api_hold(hass, config, directive, context):
"""Process a TimeHoldController Hold request."""
entity = directive.entity
data = {ATTR_ENTITY_ID: entity.entity_id}
if entity.domain == timer.DOMAIN:
service = timer.SERVICE_PAUSE
elif entity.domain == vacuum.DOMAIN:
service = vacuum.SERVICE_START_PAUSE
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
entity.domain, service, data, blocking=False, context=context
)
return directive.response()
@HANDLERS.register(("Alexa.TimeHoldController", "Resume"))
async def async_api_resume(hass, config, directive, context):
"""Process a TimeHoldController Resume request."""
entity = directive.entity
data = {ATTR_ENTITY_ID: entity.entity_id}
if entity.domain == timer.DOMAIN:
service = timer.SERVICE_START
elif entity.domain == vacuum.DOMAIN:
service = vacuum.SERVICE_START_PAUSE
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
entity.domain, service, data, blocking=False, context=context
)
return directive.response()

View File

@@ -190,7 +190,12 @@ class AlexaGlobalCatalog:
class AlexaCapabilityResource:
"""Base class for Alexa capabilityResources, ModeResources, and presetResources objects.
"""Base class for Alexa capabilityResources, modeResources, and presetResources objects.
Resources objects labels must be unique across all modeResources and presetResources within the same device.
To provide support for all supported locales, include one label from the AlexaGlobalCatalog in the labels array.
You cannot use any words from the following list as friendly names:
https://developer.amazon.com/docs/alexa/device-apis/resources-and-assets.html#names-you-cannot-use
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#capability-resources
"""
@@ -312,6 +317,14 @@ class AlexaSemantics:
Semantics is supported for the following interfaces only: ModeController, RangeController, and ToggleController.
Semantics stateMappings are only supported for one interface of the same type on the same device. If a device has
multiple RangeControllers only one interface may use stateMappings otherwise discovery will fail.
You can support semantics actionMappings on different controllers for the same device, however each controller must
support different phrases. For example, you can support "raise" on a RangeController, and "open" on a ModeController,
but you can't support "open" on both RangeController and ModeController. Semantics stateMappings are only supported
for one interface on the same device.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#semantics-object
"""

View File

@@ -6,6 +6,9 @@
"missing_configuration": "Consulta la documentaci\u00f3 sobre com configurar Almond."
},
"step": {
"hassio_confirm": {
"title": "Almond (complement de Hass.io)"
},
"pick_implementation": {
"title": "Selecci\u00f3 del m\u00e8tode d'autenticaci\u00f3"
}

View File

@@ -0,0 +1,10 @@
{
"config": {
"step": {
"hassio_confirm": {
"description": "Chcete nakonfigurovat slu\u017ebu Home Assistant pro p\u0159ipojen\u00ed k Almond pomoc\u00ed hass.io {addon}?",
"title": "Almond prost\u0159ednictv\u00edm dopl\u0148ku Hass.io"
}
}
}
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Tjek venligst dokumentationen om, hvordan man indstiller Almond."
},
"step": {
"hassio_confirm": {
"description": "Vil du konfigurere Home Assistant til at oprette forbindelse til Almond leveret af Hass.io-tilf\u00f8jelsen: {addon}?",
"title": "Almond via Hass.io-tilf\u00f8jelse"
},
"pick_implementation": {
"title": "V\u00e6lg godkendelsesmetode"
}

View File

@@ -1,9 +1,9 @@
{
"config": {
"abort": {
"already_setup": "Sie k\u00f6nnen nur ein Almond-Konto konfigurieren.",
"already_setup": "Du kannst nur ein Almond-Konto konfigurieren.",
"cannot_connect": "Verbindung zum Almond-Server nicht m\u00f6glich.",
"missing_configuration": "Bitte \u00fcberpr\u00fcfen Sie die Dokumentation zur Einrichtung von Almond."
"missing_configuration": "Bitte \u00fcberpr\u00fcfe die Dokumentation zur Einrichtung von Almond."
},
"step": {
"pick_implementation": {

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Please check the documentation on how to set up Almond."
},
"step": {
"hassio_confirm": {
"description": "Do you want to configure Home Assistant to connect to Almond provided by the Hass.io add-on: {addon}?",
"title": "Almond via Hass.io add-on"
},
"pick_implementation": {
"title": "Pick Authentication Method"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Consulte la documentaci\u00f3n sobre c\u00f3mo configurar Almond."
},
"step": {
"hassio_confirm": {
"description": "\u00bfDesea configurar Home Assistant para conectarse a Almond proporcionado por el complemento Hass.io: {addon} ?",
"title": "Almond a trav\u00e9s del complemento Hass.io"
},
"pick_implementation": {
"title": "Seleccione el m\u00e9todo de autenticaci\u00f3n"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Veuillez consulter la documentation pour savoir comment configurer Almond."
},
"step": {
"hassio_confirm": {
"description": "Voulez-vous configurer Home Assistant pour se connecter \u00e0 Almond fourni par le module compl\u00e9mentaire Hass.io: {addon} ?",
"title": "Almonf via le module compl\u00e9mentaire Hass.io"
},
"pick_implementation": {
"title": "S\u00e9lectionner une m\u00e9thode d'authentification"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Si prega di controllare la documentazione su come impostare Almond."
},
"step": {
"hassio_confirm": {
"description": "Vuoi configurare Home Assistant a connettersi ad Almond tramite il componente aggiuntivo Hass.io: {addon} ?",
"title": "Almond tramite il componente aggiuntivo di Hass.io"
},
"pick_implementation": {
"title": "Seleziona metodo di autenticazione"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Almond \uc124\uc815 \ubc29\ubc95\uc5d0 \ub300\ud55c \uc124\uba85\uc11c\ub97c \ud655\uc778\ud574\uc8fc\uc138\uc694."
},
"step": {
"hassio_confirm": {
"description": "Hass.io {addon} \uc560\ub4dc\uc628\uc73c\ub85c Almond \uc5d0 \uc5f0\uacb0\ud558\ub3c4\ub85d Home Assistant \ub97c \uad6c\uc131\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?",
"title": "Hass.io \uc560\ub4dc\uc628\uc758 Almond"
},
"pick_implementation": {
"title": "\uc778\uc99d \ubc29\ubc95 \uc120\ud0dd"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Kuckt w.e.g. Dokumentatioun iwwert d'ariichten vun Almond."
},
"step": {
"hassio_confirm": {
"description": "W\u00ebllt dir Home Assistant konfigur\u00e9iere fir sech mam Almond ze verbannen dee vun der hass.io Erweiderung {addon} bereet gestallt g\u00ebtt?",
"title": "Almond via Hass.io Erweiderung"
},
"pick_implementation": {
"title": "Wielt Authentifikatiouns Method aus"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Vennligst sjekk dokumentasjonen om hvordan du setter opp Almond."
},
"step": {
"hassio_confirm": {
"description": "Vil du konfigurere Home Assistant til \u00e5 koble til Almond levert av Hass.io add-on: {addon}?",
"title": "Almond via Hass.io add-on"
},
"pick_implementation": {
"title": "Velg autentiseringsmetode"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "Prosz\u0119 zapozna\u0107 si\u0119 z dokumentacj\u0105 konfiguracji Almond."
},
"step": {
"hassio_confirm": {
"description": "Czy chcesz skonfigurowa\u0107 Home Assistant'a, aby \u0142\u0105czy\u0142 si\u0119 z Almond dostarczonym przez dodatek Hass.io: {addon}?",
"title": "Almond poprzez dodatek Hass.io"
},
"pick_implementation": {
"title": "Wybierz metod\u0119 uwierzytelniania"
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Almond."
},
"step": {
"hassio_confirm": {
"description": "\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a Almond (\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Hass.io \"{addon}\")?",
"title": "Almond (\u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f Hass.io)"
},
"pick_implementation": {
"title": "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438"
}

View File

@@ -0,0 +1,9 @@
{
"config": {
"step": {
"hassio_confirm": {
"title": "Almond via Hass.io-till\u00e4gget"
}
}
}
}

View File

@@ -6,6 +6,10 @@
"missing_configuration": "\u8acb\u53c3\u8003\u76f8\u95dc\u6587\u4ef6\u4ee5\u4e86\u89e3\u5982\u4f55\u8a2d\u5b9a Almond\u3002"
},
"step": {
"hassio_confirm": {
"description": "\u662f\u5426\u8981\u8a2d\u5b9a Home Assistant \u4ee5\u4f7f\u7528 Hass.io \u9644\u52a0\u7d44\u4ef6\uff1a{addon} \u9023\u7dda\u81f3 Almond\uff1f",
"title": "\u4f7f\u7528 Hass.io \u9644\u52a0\u7d44\u4ef6 Almond"
},
"pick_implementation": {
"title": "\u9078\u64c7\u9a57\u8b49\u6a21\u5f0f"
}

View File

@@ -3,6 +3,10 @@
"step": {
"pick_implementation": {
"title": "Pick Authentication Method"
},
"hassio_confirm": {
"title": "Almond via Hass.io add-on",
"description": "Do you want to configure Home Assistant to connect to Almond provided by the Hass.io add-on: {addon}?"
}
},
"abort": {

View File

@@ -30,11 +30,6 @@ from .const import (
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up Ambient PWS binary sensors based on the old way."""
pass
async def async_setup_entry(hass, entry, async_add_entities):
"""Set up Ambient PWS binary sensors based on a config entry."""
ambient = hass.data[DOMAIN][DATA_CLIENT][entry.entry_id]

View File

@@ -20,11 +20,6 @@ from .const import (
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up Ambient PWS sensors based on existing config."""
pass
async def async_setup_entry(hass, entry, async_add_entities):
"""Set up Ambient PWS sensors based on a config entry."""
ambient = hass.data[DOMAIN][DATA_CLIENT][entry.entry_id]

View File

@@ -256,7 +256,7 @@ def setup(hass, config):
async_dispatcher_send(hass, service_signal(call.service, entity_id), *args)
for service, params in CAMERA_SERVICES.items():
hass.services.async_register(DOMAIN, service, async_service_handler, params[0])
hass.services.register(DOMAIN, service, async_service_handler, params[0])
return True

View File

@@ -4,5 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/amcrest",
"requirements": ["amcrest==1.5.3"],
"dependencies": ["ffmpeg"],
"codeowners": []
"codeowners": ["@pnbruckner"]
}

View File

@@ -4,7 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/androidtv",
"requirements": [
"adb-shell==0.1.1",
"androidtv==0.0.38",
"androidtv==0.0.39",
"pure-python-adb==0.2.2.dev0"
],
"dependencies": [],

View File

@@ -26,6 +26,7 @@ from homeassistant.components.media_player.const import (
SUPPORT_TURN_OFF,
SUPPORT_TURN_ON,
SUPPORT_VOLUME_MUTE,
SUPPORT_VOLUME_SET,
SUPPORT_VOLUME_STEP,
)
from homeassistant.const import (
@@ -59,6 +60,7 @@ SUPPORT_ANDROIDTV = (
| SUPPORT_SELECT_SOURCE
| SUPPORT_STOP
| SUPPORT_VOLUME_MUTE
| SUPPORT_VOLUME_SET
| SUPPORT_VOLUME_STEP
)
@@ -80,6 +82,7 @@ CONF_ADBKEY = "adbkey"
CONF_ADB_SERVER_IP = "adb_server_ip"
CONF_ADB_SERVER_PORT = "adb_server_port"
CONF_APPS = "apps"
CONF_EXCLUDE_UNNAMED_APPS = "exclude_unnamed_apps"
CONF_GET_SOURCES = "get_sources"
CONF_STATE_DETECTION_RULES = "state_detection_rules"
CONF_TURN_ON_COMMAND = "turn_on_command"
@@ -132,12 +135,15 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
vol.Optional(CONF_ADB_SERVER_IP): cv.string,
vol.Optional(CONF_ADB_SERVER_PORT, default=DEFAULT_ADB_SERVER_PORT): cv.port,
vol.Optional(CONF_GET_SOURCES, default=DEFAULT_GET_SOURCES): cv.boolean,
vol.Optional(CONF_APPS, default=dict()): vol.Schema({cv.string: cv.string}),
vol.Optional(CONF_APPS, default=dict()): vol.Schema(
{cv.string: vol.Any(cv.string, None)}
),
vol.Optional(CONF_TURN_ON_COMMAND): cv.string,
vol.Optional(CONF_TURN_OFF_COMMAND): cv.string,
vol.Optional(CONF_STATE_DETECTION_RULES, default={}): vol.Schema(
{cv.string: ha_state_detection_rules_validator(vol.Invalid)}
),
vol.Optional(CONF_EXCLUDE_UNNAMED_APPS, default=False): cv.boolean,
}
)
@@ -230,6 +236,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
config[CONF_GET_SOURCES],
config.get(CONF_TURN_ON_COMMAND),
config.get(CONF_TURN_OFF_COMMAND),
config[CONF_EXCLUDE_UNNAMED_APPS],
]
if aftv.DEVICE_CLASS == DEVICE_ANDROIDTV:
@@ -365,7 +372,14 @@ class ADBDevice(MediaPlayerDevice):
"""Representation of an Android TV or Fire TV device."""
def __init__(
self, aftv, name, apps, get_sources, turn_on_command, turn_off_command
self,
aftv,
name,
apps,
get_sources,
turn_on_command,
turn_off_command,
exclude_unnamed_apps,
):
"""Initialize the Android TV / Fire TV device."""
self.aftv = aftv
@@ -373,7 +387,7 @@ class ADBDevice(MediaPlayerDevice):
self._app_id_to_name = APPS.copy()
self._app_id_to_name.update(apps)
self._app_name_to_id = {
value: key for key, value in self._app_id_to_name.items()
value: key for key, value in self._app_id_to_name.items() if value
}
self._get_sources = get_sources
self._keys = KEYS
@@ -384,12 +398,15 @@ class ADBDevice(MediaPlayerDevice):
self.turn_on_command = turn_on_command
self.turn_off_command = turn_off_command
self._exclude_unnamed_apps = exclude_unnamed_apps
# ADB exceptions to catch
if not self.aftv.adb_server_ip:
# Using "adb_shell" (Python ADB implementation)
self.exceptions = (
AttributeError,
BrokenPipeError,
ConnectionResetError,
TypeError,
ValueError,
InvalidChecksumError,
@@ -558,11 +575,24 @@ class AndroidTVDevice(ADBDevice):
"""Representation of an Android TV device."""
def __init__(
self, aftv, name, apps, get_sources, turn_on_command, turn_off_command
self,
aftv,
name,
apps,
get_sources,
turn_on_command,
turn_off_command,
exclude_unnamed_apps,
):
"""Initialize the Android TV device."""
super().__init__(
aftv, name, apps, get_sources, turn_on_command, turn_off_command
aftv,
name,
apps,
get_sources,
turn_on_command,
turn_off_command,
exclude_unnamed_apps,
)
self._is_volume_muted = None
@@ -600,9 +630,13 @@ class AndroidTVDevice(ADBDevice):
self._available = False
if running_apps:
self._sources = [
self._app_id_to_name.get(app_id, app_id) for app_id in running_apps
sources = [
self._app_id_to_name.get(
app_id, app_id if not self._exclude_unnamed_apps else None
)
for app_id in running_apps
]
self._sources = [source for source in sources if source]
else:
self._sources = None
@@ -631,6 +665,11 @@ class AndroidTVDevice(ADBDevice):
"""Mute the volume."""
self.aftv.mute_volume()
@adb_decorator()
def set_volume_level(self, volume):
"""Set the volume level."""
self.aftv.set_volume_level(volume)
@adb_decorator()
def volume_down(self):
"""Send volume down command."""
@@ -670,9 +709,13 @@ class FireTVDevice(ADBDevice):
self._available = False
if running_apps:
self._sources = [
self._app_id_to_name.get(app_id, app_id) for app_id in running_apps
sources = [
self._app_id_to_name.get(
app_id, app_id if not self._exclude_unnamed_apps else None
)
for app_id in running_apps
]
self._sources = [source for source in sources if source]
else:
self._sources = None

View File

@@ -20,6 +20,7 @@ from homeassistant.const import (
STATE_OFF,
STATE_ON,
)
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getLogger(__name__)
@@ -55,9 +56,10 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
_LOGGER.info("Provisioning Anthem AVR device at %s:%d", host, port)
@callback
def async_anthemav_update_callback(message):
"""Receive notification from transport that new data exists."""
_LOGGER.info("Received update callback from AVR: %s", message)
_LOGGER.debug("Received update callback from AVR: %s", message)
hass.async_create_task(device.async_update_ha_state())
avr = await anthemav.Connection.create(

View File

@@ -411,6 +411,7 @@ async def async_services_json(hass):
return [{"domain": key, "services": value} for key, value in descriptions.items()]
@ha.callback
def async_events_json(hass):
"""Generate event data to JSONify."""
return [

View File

@@ -229,62 +229,42 @@ class AppleTvDevice(MediaPlayerDevice):
self._playing = None
self._power.set_power_on(False)
def async_media_play_pause(self):
"""Pause media on media player.
async def async_media_play_pause(self):
"""Pause media on media player."""
if not self._playing:
return
state = self.state
if state == STATE_PAUSED:
await self.atv.remote_control.play()
elif state == STATE_PLAYING:
await self.atv.remote_control.pause()
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_play(self):
"""Play media."""
if self._playing:
state = self.state
if state == STATE_PAUSED:
return self.atv.remote_control.play()
if state == STATE_PLAYING:
return self.atv.remote_control.pause()
await self.atv.remote_control.play()
def async_media_play(self):
"""Play media.
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_stop(self):
"""Stop the media player."""
if self._playing:
return self.atv.remote_control.play()
await self.atv.remote_control.stop()
def async_media_stop(self):
"""Stop the media player.
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_pause(self):
"""Pause the media player."""
if self._playing:
return self.atv.remote_control.stop()
await self.atv.remote_control.pause()
def async_media_pause(self):
"""Pause the media player.
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_next_track(self):
"""Send next track command."""
if self._playing:
return self.atv.remote_control.pause()
await self.atv.remote_control.next()
def async_media_next_track(self):
"""Send next track command.
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_previous_track(self):
"""Send previous track command."""
if self._playing:
return self.atv.remote_control.next()
await self.atv.remote_control.previous()
def async_media_previous_track(self):
"""Send previous track command.
This method must be run in the event loop and returns a coroutine.
"""
async def async_media_seek(self, position):
"""Send seek command."""
if self._playing:
return self.atv.remote_control.previous()
def async_media_seek(self, position):
"""Send seek command.
This method must be run in the event loop and returns a coroutine.
"""
if self._playing:
return self.atv.remote_control.set_position(position)
await self.atv.remote_control.set_position(position)

View File

@@ -61,17 +61,10 @@ class AppleTVRemote(remote.RemoteDevice):
"""
self._power.set_power_on(False)
def async_send_command(self, command, **kwargs):
"""Send a command to one device.
async def async_send_command(self, command, **kwargs):
"""Send a command to one device."""
for single_command in command:
if not hasattr(self._atv.remote_control, single_command):
continue
This method must be run in the event loop and returns a coroutine.
"""
# Send commands in specified order but schedule only one coroutine
async def _send_commands():
for single_command in command:
if not hasattr(self._atv.remote_control, single_command):
continue
await getattr(self._atv.remote_control, single_command)()
return _send_commands()
await getattr(self._atv.remote_control, single_command)()

View File

@@ -1,8 +1,8 @@
{
"domain": "apprise",
"name": "Apprise",
"documentation": "https://www.home-assistant.io/components/apprise",
"requirements": ["apprise==0.8.2"],
"documentation": "https://www.home-assistant.io/integrations/apprise",
"requirements": ["apprise==0.8.3"],
"dependencies": [],
"codeowners": ["@caronc"]
}

View File

@@ -1,4 +1,5 @@
"""Support for the Asterisk Voicemail interface."""
from functools import partial
import logging
from asterisk_mbox import ServerError
@@ -55,7 +56,9 @@ class AsteriskMailbox(Mailbox):
client = self.hass.data[ASTERISK_DOMAIN].client
try:
return client.mp3(msgid, sync=True)
return await self.hass.async_add_executor_job(
partial(client.mp3, msgid, sync=True)
)
except ServerError as err:
raise StreamError(err)
@@ -63,9 +66,9 @@ class AsteriskMailbox(Mailbox):
"""Return a list of the current messages."""
return self.hass.data[ASTERISK_DOMAIN].messages
def async_delete(self, msgid):
async def async_delete(self, msgid):
"""Delete the specified messages."""
client = self.hass.data[ASTERISK_DOMAIN].client
_LOGGER.info("Deleting: %s", msgid)
client.delete(msgid)
await self.hass.async_add_executor_job(client.delete, msgid)
return True

View File

@@ -1,6 +1,7 @@
"""Support for aurora forecast data sensor."""
from datetime import timedelta
import logging
from math import floor
from aiohttp.hdrs import USER_AGENT
import requests
@@ -99,8 +100,6 @@ class AuroraData:
"""Initialize the data object."""
self.latitude = latitude
self.longitude = longitude
self.number_of_latitude_intervals = 513
self.number_of_longitude_intervals = 1024
self.headers = {USER_AGENT: HA_USER_AGENT}
self.threshold = int(threshold)
self.is_visible = None
@@ -126,18 +125,22 @@ class AuroraData:
def get_aurora_forecast(self):
"""Get forecast data and parse for given long/lat."""
raw_data = requests.get(URL, headers=self.headers, timeout=5).text
# We discard comment rows (#)
# We split the raw text by line (\n)
# For each line we trim leading spaces and split by spaces
forecast_table = [
row.strip(" ").split(" ")
row.strip().split()
for row in raw_data.split("\n")
if not row.startswith("#")
]
# Convert lat and long for data points in table
converted_latitude = round(
(self.latitude / 180) * self.number_of_latitude_intervals
)
converted_longitude = round(
(self.longitude / 360) * self.number_of_longitude_intervals
# Assumes self.latitude belongs to [-90;90[ (South to North)
# Assumes self.longitude belongs to [-180;180[ (West to East)
# No assumptions made regarding the number of rows and columns
converted_latitude = floor((self.latitude + 90) * len(forecast_table) / 180)
converted_longitude = floor(
(self.longitude + 180) * len(forecast_table[converted_latitude]) / 360
)
return forecast_table[converted_latitude][converted_longitude]

View File

@@ -25,8 +25,8 @@
},
"step": {
"init": {
"description": "\u6b32\u555f\u7528\u4e00\u6b21\u6027\u4e14\u5177\u6642\u6548\u6027\u7684\u5bc6\u78bc\u4e4b\u5169\u6b65\u9a5f\u9a57\u8b49\u529f\u80fd\uff0c\u8acb\u4f7f\u7528\u60a8\u7684\u9a57\u8b49 App \u6383\u7784\u4e0b\u65b9\u7684 QR code \u3002\u5018\u82e5\u60a8\u5c1a\u672a\u5b89\u88dd\u4efb\u4f55 App\uff0c\u63a8\u85a6\u60a8\u4f7f\u7528 [Google Authenticator](https://support.google.com/accounts/answer/1066447) \u6216 [Authy](https://authy.com/)\u3002\n\n{qr_code}\n\n\u65bc\u641c\u5c0b\u4e4b\u5f8c\uff0c\u8f38\u5165 App \u4e2d\u7684\u516d\u4f4d\u6578\u5b57\u9032\u884c\u8a2d\u5b9a\u9a57\u8b49\u3002\u5047\u5982\u641c\u5c0b\u51fa\u73fe\u554f\u984c\uff0c\u8acb\u624b\u52d5\u8f38\u5165\u4ee5\u4e0b\u9a57\u8b49\u78bc **`{code}`**\u3002",
"title": "\u4f7f\u7528 TOTP \u8a2d\u5b9a\u5169\u6b65\u9a5f\u9a57\u8b49"
"description": "\u6b32\u555f\u7528\u4e00\u6b21\u6027\u4e14\u5177\u6642\u6548\u6027\u7684\u5bc6\u78bc\u4e4b\u96d9\u91cd\u9a57\u8b49\u529f\u80fd\uff0c\u8acb\u4f7f\u7528\u60a8\u7684\u9a57\u8b49 App \u6383\u7784\u4e0b\u65b9\u7684 QR code \u3002\u5018\u82e5\u60a8\u5c1a\u672a\u5b89\u88dd\u4efb\u4f55 App\uff0c\u63a8\u85a6\u60a8\u4f7f\u7528 [Google Authenticator](https://support.google.com/accounts/answer/1066447) \u6216 [Authy](https://authy.com/)\u3002\n\n{qr_code}\n\n\u65bc\u641c\u5c0b\u4e4b\u5f8c\uff0c\u8f38\u5165 App \u4e2d\u7684\u516d\u4f4d\u6578\u5b57\u9032\u884c\u8a2d\u5b9a\u9a57\u8b49\u3002\u5047\u5982\u641c\u5c0b\u51fa\u73fe\u554f\u984c\uff0c\u8acb\u624b\u52d5\u8f38\u5165\u4ee5\u4e0b\u9a57\u8b49\u78bc **`{code}`**\u3002",
"title": "\u4f7f\u7528 TOTP \u8a2d\u5b9a\u96d9\u91cd\u9a57\u8b49"
}
},
"title": "TOTP"

View File

@@ -1,17 +1,19 @@
"""Allow to set up simple automation rules via the config file."""
import asyncio
from functools import partial
import importlib
import logging
from typing import Any, Awaitable, Callable
from typing import Any, Awaitable, Callable, List, Optional, Set
import voluptuous as vol
from homeassistant.components import sun
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_NAME,
CONF_DEVICE_ID,
CONF_ENTITY_ID,
CONF_ID,
CONF_PLATFORM,
CONF_ZONE,
EVENT_AUTOMATION_TRIGGERED,
EVENT_HOMEASSISTANT_START,
SERVICE_RELOAD,
@@ -20,11 +22,10 @@ from homeassistant.const import (
SERVICE_TURN_ON,
STATE_ON,
)
from homeassistant.core import Context, CoreState, HomeAssistant
from homeassistant.core import Context, CoreState, HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import condition, extract_domain_configs, script
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import make_entity_service_schema
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.restore_state import RestoreEntity
@@ -93,29 +94,23 @@ _TRIGGER_SCHEMA = vol.All(
_CONDITION_SCHEMA = vol.All(cv.ensure_list, [cv.CONDITION_SCHEMA])
PLATFORM_SCHEMA = vol.Schema(
{
# str on purpose
CONF_ID: str,
CONF_ALIAS: cv.string,
vol.Optional(CONF_DESCRIPTION): cv.string,
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
vol.Optional(CONF_CONDITION): _CONDITION_SCHEMA,
vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA,
}
PLATFORM_SCHEMA = vol.All(
cv.deprecated(CONF_HIDE_ENTITY, invalidation_version="0.107"),
vol.Schema(
{
# str on purpose
CONF_ID: str,
CONF_ALIAS: cv.string,
vol.Optional(CONF_DESCRIPTION): cv.string,
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
vol.Optional(CONF_CONDITION): _CONDITION_SCHEMA,
vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA,
}
),
)
TRIGGER_SERVICE_SCHEMA = make_entity_service_schema(
{
vol.Optional(ATTR_VARIABLES, default={}): dict,
vol.Optional(CONF_SKIP_CONDITION, default=True): bool,
}
)
RELOAD_SERVICE_SCHEMA = vol.Schema({})
@bind_hass
def is_on(hass, entity_id):
@@ -127,48 +122,97 @@ def is_on(hass, entity_id):
return hass.states.is_state(entity_id, STATE_ON)
@callback
def automations_with_entity(hass: HomeAssistant, entity_id: str) -> List[str]:
"""Return all automations that reference the entity."""
if DOMAIN not in hass.data:
return []
component = hass.data[DOMAIN]
results = []
for automation_entity in component.entities:
if entity_id in automation_entity.referenced_entities:
results.append(automation_entity.entity_id)
return results
@callback
def entities_in_automation(hass: HomeAssistant, entity_id: str) -> List[str]:
"""Return all entities in a scene."""
if DOMAIN not in hass.data:
return []
component = hass.data[DOMAIN]
automation_entity = component.get_entity(entity_id)
if automation_entity is None:
return []
return list(automation_entity.referenced_entities)
@callback
def automations_with_device(hass: HomeAssistant, device_id: str) -> List[str]:
"""Return all automations that reference the device."""
if DOMAIN not in hass.data:
return []
component = hass.data[DOMAIN]
results = []
for automation_entity in component.entities:
if device_id in automation_entity.referenced_devices:
results.append(automation_entity.entity_id)
return results
@callback
def devices_in_automation(hass: HomeAssistant, entity_id: str) -> List[str]:
"""Return all devices in a scene."""
if DOMAIN not in hass.data:
return []
component = hass.data[DOMAIN]
automation_entity = component.get_entity(entity_id)
if automation_entity is None:
return []
return list(automation_entity.referenced_devices)
async def async_setup(hass, config):
"""Set up the automation."""
component = EntityComponent(_LOGGER, DOMAIN, hass)
hass.data[DOMAIN] = component = EntityComponent(_LOGGER, DOMAIN, hass)
await _async_process_config(hass, config, component)
async def trigger_service_handler(service_call):
async def trigger_service_handler(entity, service_call):
"""Handle automation triggers."""
tasks = []
for entity in await component.async_extract_from_service(service_call):
tasks.append(
entity.async_trigger(
service_call.data[ATTR_VARIABLES],
skip_condition=service_call.data[CONF_SKIP_CONDITION],
context=service_call.context,
)
)
await entity.async_trigger(
service_call.data[ATTR_VARIABLES],
skip_condition=service_call.data[CONF_SKIP_CONDITION],
context=service_call.context,
)
if tasks:
await asyncio.wait(tasks)
async def turn_onoff_service_handler(service_call):
"""Handle automation turn on/off service calls."""
tasks = []
method = f"async_{service_call.service}"
for entity in await component.async_extract_from_service(service_call):
tasks.append(getattr(entity, method)())
if tasks:
await asyncio.wait(tasks)
async def toggle_service_handler(service_call):
"""Handle automation toggle service calls."""
tasks = []
for entity in await component.async_extract_from_service(service_call):
if entity.is_on:
tasks.append(entity.async_turn_off())
else:
tasks.append(entity.async_turn_on())
if tasks:
await asyncio.wait(tasks)
component.async_register_entity_service(
SERVICE_TRIGGER,
{
vol.Optional(ATTR_VARIABLES, default={}): dict,
vol.Optional(CONF_SKIP_CONDITION, default=True): bool,
},
trigger_service_handler,
)
component.async_register_entity_service(SERVICE_TOGGLE, {}, "async_toggle")
component.async_register_entity_service(SERVICE_TURN_ON, {}, "async_turn_on")
component.async_register_entity_service(SERVICE_TURN_OFF, {}, "async_turn_off")
async def reload_service_handler(service_call):
"""Remove all automations and load new ones from config."""
@@ -177,33 +221,10 @@ async def async_setup(hass, config):
return
await _async_process_config(hass, conf, component)
hass.services.async_register(
DOMAIN, SERVICE_TRIGGER, trigger_service_handler, schema=TRIGGER_SERVICE_SCHEMA
)
async_register_admin_service(
hass,
DOMAIN,
SERVICE_RELOAD,
reload_service_handler,
schema=RELOAD_SERVICE_SCHEMA,
hass, DOMAIN, SERVICE_RELOAD, reload_service_handler, schema=vol.Schema({}),
)
hass.services.async_register(
DOMAIN,
SERVICE_TOGGLE,
toggle_service_handler,
schema=make_entity_service_schema({}),
)
for service in (SERVICE_TURN_ON, SERVICE_TURN_OFF):
hass.services.async_register(
DOMAIN,
service,
turn_onoff_service_handler,
schema=make_entity_service_schema({}),
)
return True
@@ -214,29 +235,36 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
self,
automation_id,
name,
async_attach_triggers,
trigger_config,
cond_func,
async_action,
action_script,
hidden,
initial_state,
):
"""Initialize an automation entity."""
self._id = automation_id
self._name = name
self._async_attach_triggers = async_attach_triggers
self._trigger_config = trigger_config
self._async_detach_triggers = None
self._cond_func = cond_func
self._async_action = async_action
self.action_script = action_script
self._last_triggered = None
self._hidden = hidden
self._initial_state = initial_state
self._is_enabled = False
self._referenced_entities: Optional[Set[str]] = None
self._referenced_devices: Optional[Set[str]] = None
@property
def name(self):
"""Name of the automation."""
return self._name
@property
def unique_id(self):
"""Return unique ID."""
return self._id
@property
def should_poll(self):
"""No polling needed for automation entities."""
@@ -257,6 +285,45 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
"""Return True if entity is on."""
return self._async_detach_triggers is not None or self._is_enabled
@property
def referenced_devices(self):
"""Return a set of referenced devices."""
if self._referenced_devices is not None:
return self._referenced_devices
referenced = self.action_script.referenced_devices
if self._cond_func is not None:
for conf in self._cond_func.config:
referenced |= condition.async_extract_devices(conf)
for conf in self._trigger_config:
device = _trigger_extract_device(conf)
if device is not None:
referenced.add(device)
self._referenced_devices = referenced
return referenced
@property
def referenced_entities(self):
"""Return a set of referenced entities."""
if self._referenced_entities is not None:
return self._referenced_entities
referenced = self.action_script.referenced_entities
if self._cond_func is not None:
for conf in self._cond_func.config:
referenced |= condition.async_extract_entities(conf)
for conf in self._trigger_config:
for entity_id in _trigger_extract_entities(conf):
referenced.add(entity_id)
self._referenced_entities = referenced
return referenced
async def async_added_to_hass(self) -> None:
"""Startup with initial state or previous state."""
await super().async_added_to_hass()
@@ -307,7 +374,11 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
This method is a coroutine.
"""
if not skip_condition and not self._cond_func(variables):
if (
not skip_condition
and self._cond_func is not None
and not self._cond_func(variables)
):
return
# Create a new context referring to the old context.
@@ -320,7 +391,16 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
{ATTR_NAME: self._name, ATTR_ENTITY_ID: self.entity_id},
context=trigger_context,
)
await self._async_action(self.entity_id, variables, trigger_context)
_LOGGER.info("Executing %s", self._name)
try:
await self.action_script.async_run(variables, trigger_context)
except Exception as err: # pylint: disable=broad-except
self.action_script.async_log_exception(
_LOGGER, f"Error while executing automation {self.entity_id}", err
)
self._last_triggered = utcnow()
await self.async_update_ha_state()
@@ -341,9 +421,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
# HomeAssistant is starting up
if self.hass.state != CoreState.not_running:
self._async_detach_triggers = await self._async_attach_triggers(
self.async_trigger
)
self._async_detach_triggers = await self._async_attach_triggers()
self.async_write_ha_state()
return
@@ -353,9 +431,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
if not self._is_enabled or self._async_detach_triggers is not None:
return
self._async_detach_triggers = await self._async_attach_triggers(
self.async_trigger
)
self._async_detach_triggers = await self._async_attach_triggers()
self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_START, async_enable_automation
@@ -375,6 +451,38 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
self.async_write_ha_state()
async def _async_attach_triggers(self):
"""Set up the triggers."""
removes = []
info = {"name": self._name}
for conf in self._trigger_config:
platform = importlib.import_module(
".{}".format(conf[CONF_PLATFORM]), __name__
)
remove = await platform.async_attach_trigger(
self.hass, conf, self.async_trigger, info
)
if not remove:
_LOGGER.error("Error setting up trigger %s", self._name)
continue
_LOGGER.info("Initialized trigger %s", self._name)
removes.append(remove)
if not removes:
return None
@callback
def remove_triggers():
"""Remove attached triggers."""
for remove in removes:
remove()
return remove_triggers
@property
def device_state_attributes(self):
"""Return automation attributes."""
@@ -401,7 +509,7 @@ async def _async_process_config(hass, config, component):
hidden = config_block[CONF_HIDE_ENTITY]
initial_state = config_block.get(CONF_INITIAL_STATE)
action = _async_get_action(hass, config_block.get(CONF_ACTION, {}), name)
action_script = script.Script(hass, config_block.get(CONF_ACTION, {}), name)
if CONF_CONDITION in config_block:
cond_func = await _async_process_if(hass, config, config_block)
@@ -409,24 +517,14 @@ async def _async_process_config(hass, config, component):
if cond_func is None:
continue
else:
cond_func = None
def cond_func(variables):
"""Condition will always pass."""
return True
async_attach_triggers = partial(
_async_process_trigger,
hass,
config,
config_block.get(CONF_TRIGGER, []),
name,
)
entity = AutomationEntity(
automation_id,
name,
async_attach_triggers,
config_block[CONF_TRIGGER],
cond_func,
action,
action_script,
hidden,
initial_state,
)
@@ -437,27 +535,9 @@ async def _async_process_config(hass, config, component):
await component.async_add_entities(entities)
def _async_get_action(hass, config, name):
"""Return an action based on a configuration."""
script_obj = script.Script(hass, config, name)
async def action(entity_id, variables, context):
"""Execute an action."""
_LOGGER.info("Executing %s", name)
try:
await script_obj.async_run(variables, context)
except Exception as err: # pylint: disable=broad-except
script_obj.async_log_exception(
_LOGGER, f"Error while executing automation {entity_id}", err
)
return action
async def _async_process_if(hass, config, p_config):
"""Process if checks."""
if_configs = p_config.get(CONF_CONDITION)
if_configs = p_config[CONF_CONDITION]
checks = []
for if_config in if_configs:
@@ -471,35 +551,33 @@ async def _async_process_if(hass, config, p_config):
"""AND all conditions."""
return all(check(hass, variables) for check in checks)
if_action.config = if_configs
return if_action
async def _async_process_trigger(hass, config, trigger_configs, name, action):
"""Set up the triggers.
This method is a coroutine.
"""
removes = []
info = {"name": name}
for conf in trigger_configs:
platform = importlib.import_module(".{}".format(conf[CONF_PLATFORM]), __name__)
remove = await platform.async_attach_trigger(hass, conf, action, info)
if not remove:
_LOGGER.error("Error setting up trigger %s", name)
continue
_LOGGER.info("Initialized trigger %s", name)
removes.append(remove)
if not removes:
@callback
def _trigger_extract_device(trigger_conf: dict) -> Optional[str]:
"""Extract devices from a trigger config."""
if trigger_conf[CONF_PLATFORM] != "device":
return None
def remove_triggers():
"""Remove attached triggers."""
for remove in removes:
remove()
return trigger_conf[CONF_DEVICE_ID]
return remove_triggers
@callback
def _trigger_extract_entities(trigger_conf: dict) -> List[str]:
"""Extract entities from a trigger config."""
if trigger_conf[CONF_PLATFORM] in ("state", "numeric_state"):
return trigger_conf[CONF_ENTITY_ID]
if trigger_conf[CONF_PLATFORM] == "zone":
return trigger_conf[CONF_ENTITY_ID] + [trigger_conf[CONF_ZONE]]
if trigger_conf[CONF_PLATFORM] == "geo_location":
return [trigger_conf[CONF_ZONE]]
if trigger_conf[CONF_PLATFORM] == "sun":
return [sun.ENTITY_ID]
return []

View File

@@ -92,6 +92,7 @@ async def async_attach_trigger(hass, config, action, automation_info):
hass.data["litejet_system"].on_switch_pressed(number, pressed)
hass.data["litejet_system"].on_switch_released(number, released)
@callback
def async_remove():
"""Remove all subscriptions used for this trigger."""
return

View File

@@ -2,7 +2,7 @@
"domain": "aws",
"name": "Amazon Web Services (AWS)",
"documentation": "https://www.home-assistant.io/integrations/aws",
"requirements": ["aiobotocore==0.10.4"],
"requirements": ["aiobotocore==0.11.1"],
"dependencies": [],
"codeowners": ["@awarecan", "@robbiet480"]
}

View File

@@ -4,7 +4,8 @@
"already_configured": "L'appareil est d\u00e9j\u00e0 configur\u00e9",
"bad_config_file": "Mauvaises donn\u00e9es du fichier de configuration",
"link_local_address": "Les adresses locales ne sont pas prises en charge",
"not_axis_device": "L'appareil d\u00e9couvert n'est pas un appareil Axis"
"not_axis_device": "L'appareil d\u00e9couvert n'est pas un appareil Axis",
"updated_configuration": "Mise \u00e0 jour de la configuration du dispositif avec la nouvelle adresse de l'h\u00f4te"
},
"error": {
"already_configured": "L'appareil est d\u00e9j\u00e0 configur\u00e9",

View File

@@ -59,11 +59,11 @@
"moving": "{entity_name} ha iniziato a muoversi",
"no_gas": "{entity_name} ha smesso la rilevazione di gas",
"no_light": "{entity_name} smesso il rilevamento di luce",
"no_motion": "{nome_entit\u00e0} ha smesso di rilevare il movimento",
"no_problem": "{nome_entit\u00e0} ha smesso di rilevare un problema",
"no_motion": "{entity_name} ha smesso di rilevare il movimento",
"no_problem": "{entity_name} ha smesso di rilevare un problema",
"no_smoke": "{entity_name} ha smesso la rilevazione di fumo",
"no_sound": "{nome_entit\u00e0} ha smesso di rilevare il suono",
"no_vibration": "{nome_entit\u00e0} ha smesso di rilevare le vibrazioni",
"no_sound": "{entity_name} ha smesso di rilevare il suono",
"no_vibration": "{entity_name} ha smesso di rilevare le vibrazioni",
"not_bat_low": "{entity_name} batteria normale",
"not_cold": "{entity_name} non \u00e8 diventato freddo",
"not_connected": "{entity_name} \u00e8 disconnesso",

View File

@@ -5,7 +5,7 @@ import voluptuous as vol
from homeassistant.components.device_automation.const import CONF_IS_OFF, CONF_IS_ON
from homeassistant.const import ATTR_DEVICE_CLASS, CONF_ENTITY_ID, CONF_FOR, CONF_TYPE
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import condition, config_validation as cv
from homeassistant.helpers.entity_registry import (
async_entries_for_device,
@@ -232,6 +232,7 @@ async def async_get_conditions(
return conditions
@callback
def async_condition_from_config(
config: ConfigType, config_validation: bool
) -> condition.ConditionCheckerType:

View File

@@ -10,6 +10,7 @@ import socket
import voluptuous as vol
from homeassistant.const import CONF_HOST
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.util.dt import utcnow
@@ -64,67 +65,67 @@ SERVICE_SEND_SCHEMA = vol.Schema(
SERVICE_LEARN_SCHEMA = vol.Schema({vol.Required(CONF_HOST): cv.string})
@callback
def async_setup_service(hass, host, device):
"""Register a device for given host for use in services."""
hass.data.setdefault(DOMAIN, {})[host] = device
if not hass.services.has_service(DOMAIN, SERVICE_LEARN):
if hass.services.has_service(DOMAIN, SERVICE_LEARN):
return
async def _learn_command(call):
"""Learn a packet from remote."""
device = hass.data[DOMAIN][call.data[CONF_HOST]]
async def _learn_command(call):
"""Learn a packet from remote."""
device = hass.data[DOMAIN][call.data[CONF_HOST]]
try:
auth = await hass.async_add_executor_job(device.auth)
except socket.timeout:
_LOGGER.error("Failed to connect to device, timeout")
try:
auth = await hass.async_add_executor_job(device.auth)
except socket.timeout:
_LOGGER.error("Failed to connect to device, timeout")
return
if not auth:
_LOGGER.error("Failed to connect to device")
return
await hass.async_add_executor_job(device.enter_learning)
_LOGGER.info("Press the key you want Home Assistant to learn")
start_time = utcnow()
while (utcnow() - start_time) < timedelta(seconds=20):
packet = await hass.async_add_executor_job(device.check_data)
if packet:
data = b64encode(packet).decode("utf8")
log_msg = f"Received packet is: {data}"
_LOGGER.info(log_msg)
hass.components.persistent_notification.async_create(
log_msg, title="Broadlink switch"
)
return
if not auth:
_LOGGER.error("Failed to connect to device")
return
await hass.async_add_executor_job(device.enter_learning)
_LOGGER.info("Press the key you want Home Assistant to learn")
start_time = utcnow()
while (utcnow() - start_time) < timedelta(seconds=20):
packet = await hass.async_add_executor_job(device.check_data)
if packet:
data = b64encode(packet).decode("utf8")
log_msg = f"Received packet is: {data}"
_LOGGER.info(log_msg)
hass.components.persistent_notification.async_create(
log_msg, title="Broadlink switch"
)
return
await asyncio.sleep(1)
_LOGGER.error("No signal was received")
hass.components.persistent_notification.async_create(
"No signal was received", title="Broadlink switch"
)
hass.services.async_register(
DOMAIN, SERVICE_LEARN, _learn_command, schema=SERVICE_LEARN_SCHEMA
await asyncio.sleep(1)
_LOGGER.error("No signal was received")
hass.components.persistent_notification.async_create(
"No signal was received", title="Broadlink switch"
)
if not hass.services.has_service(DOMAIN, SERVICE_SEND):
hass.services.async_register(
DOMAIN, SERVICE_LEARN, _learn_command, schema=SERVICE_LEARN_SCHEMA
)
async def _send_packet(call):
"""Send a packet."""
device = hass.data[DOMAIN][call.data[CONF_HOST]]
packets = call.data[CONF_PACKET]
for packet in packets:
for retry in range(DEFAULT_RETRY):
async def _send_packet(call):
"""Send a packet."""
device = hass.data[DOMAIN][call.data[CONF_HOST]]
packets = call.data[CONF_PACKET]
for packet in packets:
for retry in range(DEFAULT_RETRY):
try:
await hass.async_add_executor_job(device.send_data, packet)
break
except (socket.timeout, ValueError):
try:
await hass.async_add_executor_job(device.send_data, packet)
break
except (socket.timeout, ValueError):
try:
await hass.async_add_executor_job(device.auth)
except socket.timeout:
if retry == DEFAULT_RETRY - 1:
_LOGGER.error("Failed to send packet to device")
await hass.async_add_executor_job(device.auth)
except socket.timeout:
if retry == DEFAULT_RETRY - 1:
_LOGGER.error("Failed to send packet to device")
hass.services.async_register(
DOMAIN, SERVICE_SEND, _send_packet, schema=SERVICE_SEND_SCHEMA
)
hass.services.async_register(
DOMAIN, SERVICE_SEND, _send_packet, schema=SERVICE_SEND_SCHEMA
)

View File

@@ -0,0 +1,14 @@
{
"config": {
"flow_title": "Tisk\u00e1rna Brother: {model} {serial_number}",
"step": {
"zeroconf_confirm": {
"data": {
"type": "Typ tisk\u00e1rny"
},
"description": "Chcete p\u0159idat tisk\u00e1rnu Brother {model} se s\u00e9riov\u00fdm \u010d\u00edslem \"{serial_number}\" do Home Assistant?",
"title": "Objeven\u00e1 tisk\u00e1rna Brother"
}
}
}
}

View File

@@ -9,6 +9,7 @@
"snmp_error": "SNMP-server er sl\u00e5et fra, eller printeren underst\u00f8ttes ikke.",
"wrong_host": "Ugyldigt v\u00e6rtsnavn eller IP-adresse."
},
"flow_title": "Brother-printer: {model} {serial_number}",
"step": {
"user": {
"data": {
@@ -17,6 +18,13 @@
},
"description": "Konfigurer Brother-printerintegration. Hvis du har problemer med konfiguration, kan du g\u00e5 til: https://www.home-assistant.io/integrations/brother",
"title": "Brother-printer"
},
"zeroconf_confirm": {
"data": {
"type": "Type af printer"
},
"description": "Vil du tilf\u00f8je Brother-printeren {model} med serienummeret `{serial_number}` til Home Assistant?",
"title": "Fandt Brother-printer"
}
},
"title": "Brother-printer"

View File

@@ -0,0 +1,24 @@
{
"config": {
"abort": {
"already_configured": "Dieser Drucker ist bereits konfiguriert",
"unsupported_model": "Dieses Druckermodell wird nicht unterst\u00fctzt."
},
"error": {
"connection_error": "Verbindungsfehler",
"snmp_error": "SNMP-Server deaktiviert oder Drucker nicht unterst\u00fctzt.",
"wrong_host": " Ung\u00fcltiger Hostname oder IP-Adresse"
},
"step": {
"user": {
"data": {
"host": "Drucker Hostname oder IP-Adresse",
"type": "Typ des Druckers"
},
"description": "Einrichten der Brother-Drucker-Integration. Wenn Du Probleme mit der Konfiguration hast, gehe zu: https://www.home-assistant.io/integrations/brother",
"title": "Brother Drucker"
}
},
"title": "Brother Drucker"
}
}

View File

@@ -9,6 +9,7 @@
"snmp_error": "SNMP server turned off or printer not supported.",
"wrong_host": "Invalid hostname or IP address."
},
"flow_title": "Brother Printer: {model} {serial_number}",
"step": {
"user": {
"data": {
@@ -17,6 +18,13 @@
},
"description": "Set up Brother printer integration. If you have problems with configuration go to: https://www.home-assistant.io/integrations/brother",
"title": "Brother Printer"
},
"zeroconf_confirm": {
"data": {
"type": "Type of the printer"
},
"description": "Do you want to add the Brother Printer {model} with serial number `{serial_number}` to Home Assistant?",
"title": "Discovered Brother Printer"
}
},
"title": "Brother Printer"

View File

@@ -9,6 +9,7 @@
"snmp_error": "El servidor SNMP est\u00e1 apagado o la impresora no es compatible.",
"wrong_host": "Nombre del host o direcci\u00f3n IP no v\u00e1lidos."
},
"flow_title": "Impresora Brother: {model} {serial_number}",
"step": {
"user": {
"data": {
@@ -17,6 +18,13 @@
},
"description": "Configure la integraci\u00f3n de impresoras Brother. Si tiene problemas con la configuraci\u00f3n, vaya a: https://www.home-assistant.io/integrations/brother",
"title": "Impresora Brother"
},
"zeroconf_confirm": {
"data": {
"type": "Tipo de impresora"
},
"description": "\u00bfQuiere a\u00f1adir la Impresora Brother {model} con el n\u00famero de serie `{serial_number}` a Home Assistant?",
"title": "Impresora Brother encontrada"
}
},
"title": "Impresora Brother"

View File

@@ -0,0 +1,29 @@
{
"config": {
"abort": {
"already_configured": "Cette imprimante est d\u00e9j\u00e0 configur\u00e9e.",
"unsupported_model": "Ce mod\u00e8le d'imprimante n'est pas pris en charge."
},
"error": {
"connection_error": "Erreur de connexion.",
"snmp_error": "Serveur SNMP d\u00e9sactiv\u00e9 ou imprimante non prise en charge.",
"wrong_host": "Nom d'h\u00f4te ou adresse IP invalide."
},
"step": {
"user": {
"data": {
"host": "Nom d'h\u00f4te ou adresse IP de l'imprimante",
"type": "Type d'imprimante"
},
"description": "Configurez l'int\u00e9gration de l'imprimante Brother. Si vous avez des probl\u00e8mes avec la configuration, allez \u00e0 : https://www.home-assistant.io/integrations/brother",
"title": "Imprimante Brother"
},
"zeroconf_confirm": {
"data": {
"type": "Type d'imprimante"
}
}
},
"title": "Imprimante Brother"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"flow_title": "Brother nyomtat\u00f3: {model} {serial_number}",
"step": {
"zeroconf_confirm": {
"data": {
"type": "A nyomtat\u00f3 t\u00edpusa"
},
"description": "Hozz\u00e1 akarja adni a {model} Brother nyomtat\u00f3t, amelynek sorsz\u00e1ma: {serial_number} `, a Home Assistant-hoz?",
"title": "Felfedezett Brother nyomtat\u00f3"
}
},
"title": "Brother nyomtat\u00f3"
}
}

View File

@@ -9,6 +9,7 @@
"snmp_error": "Server SNMP spento o stampante non supportata.",
"wrong_host": "Nome host o indirizzo IP non valido."
},
"flow_title": "Stampante Brother: {model} {serial_number}",
"step": {
"user": {
"data": {
@@ -17,6 +18,13 @@
},
"description": "Configurare l'integrazione della stampante Brother. In caso di problemi con la configurazione, visitare: https://www.home-assistant.io/integrations/brother",
"title": "Stampante Brother"
},
"zeroconf_confirm": {
"data": {
"type": "Tipo di stampante"
},
"description": "Vuoi aggiungere la stampante Brother {model} con il numero seriale `{serial_number}` a Home Assistant?",
"title": "Trovata stampante Brother"
}
},
"title": "Stampante Brother"

Some files were not shown because too many files have changed in this diff Show More