Compare commits

...

687 Commits

Author SHA1 Message Date
Paulus Schoutsen
1b89fef888 Bumped version to 0.104.0b4 2020-01-11 20:16:43 -08:00
Paulus Schoutsen
3715f821d7 Fix update person validation (#30691) 2020-01-11 20:16:18 -08:00
Paulus Schoutsen
dc57d670d8 Log error when integration is missing platform setup (#30690) 2020-01-11 20:16:17 -08:00
Paulus Schoutsen
c00af14ee2 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 20:16:17 -08:00
SukramJ
b383a5195f Fix Error with HomematicIP Cloud Cover (#30667) 2020-01-11 20:16:16 -08:00
Paulus Schoutsen
e3b37c44d6 Bumped version to 0.104.0b3 2020-01-11 16:17:03 -08:00
Paulus Schoutsen
718f3438ea Upgrade Ring to new version (#30666)
* Upgrade Ring to new version

* Move legacy cleanup down

* Fix test
2020-01-11 16:16:58 -08:00
Paulus Schoutsen
86bdba2ea2 Bumped version to 0.104.0b2 2020-01-10 20:18:35 -08:00
HomeAssistant Azure
77d184ee25 [ci skip] Translation update 2020-01-10 20:18:20 -08:00
HomeAssistant Azure
d0357ceecd [ci skip] Translation update 2020-01-10 20:18:20 -08:00
HomeAssistant Azure
0fc2cce4dc [ci skip] Translation update 2020-01-10 20:18:20 -08:00
Dave T
80a1084f2d Update ON/OFF condition and triggers to match documentation and UI, issue #30462 (#30663) 2020-01-10 20:17:13 -08:00
Alexei Chetroi
2eff988a5c 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:17:12 -08:00
Jc2k
449e6841a7 Fix HomeKit with entity registry restoration where supported_features is a non-None falsey (#30657)
* Fix homekit with #30094

* Fix test
2020-01-10 20:17:12 -08:00
Paulus Schoutsen
f505310f11 Bumped version to 0.104.0b1 2020-01-10 13:37:13 -08:00
Phil Bruckner
626c01b4a0 Do not save last_seen if older than prev_seen (#30647)
Also add warnings when updates skipped similar to google_maps
2020-01-10 13:37:03 -08:00
springstan
c785b791a2 Bump Adafruit_BBIO to 1.1.1 (#30630) 2020-01-10 13:37:02 -08:00
Pascal Vizeli
a6492cc7bb Set body size for Proxy / streams to 16mb (#30608) 2020-01-10 13:37:02 -08:00
Robert Svensson
5a8311e9d8 Fix problem with restoring POE control (#30597) 2020-01-10 13:37:01 -08:00
Paulus Schoutsen
0b3b589457 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 13:36:34 -08:00
Paulus Schoutsen
e58b41ef23 Implement capability attributes (#30545)
* Implement capability attributes

* Fix HeOS update order

* Fix test
2020-01-10 13:35:44 -08:00
Phil Bruckner
c7e300e5b1 Fix upnp raw sensor state formatting when None (#30444) 2020-01-10 13:35:43 -08:00
Paulus Schoutsen
5d850c5b19 Bumped version to 0.104.0b0 2020-01-08 21:06:22 +01:00
Paulus Schoutsen
95bc539bab Merge remote-tracking branch 'origin/master' into dev 2020-01-08 21:05:53 +01:00
Mariano Faraco
9e885112ec Add last_online and level attribute to steam online (#30321)
* Steam Online: Add last_online and Level attributes

* Steam Online: Add last_online and Level attributes

* Fixes from comments on initial pull request

* Push attributes only if they are not None
2020-01-08 21:04:42 +01:00
mohmacht
d048233776 The MFI Dimmer Switch model is missing from the list, causing the mfi Wall switches not to be recognized. (#30572)
Please add this one model to support my mfi switches, thank you.

 python 1.py dump_sensors --noverify
               Model |                Label |             Tag |      Value | Extra
------------------------------------------------------------------------------
       Dimmer Switch |        Bedroom2Light |      active_pwr |  22.047071 | 1.0
       Dimmer Switch |      LivingRoomLight |      active_pwr |        0.0 | 0.0
       Dimmer Switch |      FamilyRoomLight |      active_pwr |  42.803919 | 1.0
       Dimmer Switch |   MasterBedroomLight |      active_pwr |        0.0 | 0.0
2020-01-08 21:04:33 +01:00
fwestenberg
498bec4a61 Add Stookalert integration (#30306)
* Added Stookalert integration

* Added Stookalert integration

* Added Stookalert integration

* Solved comments

* Flake8 change

* Bump stookalert to version 1.1.2

* Fixed attributes and state

* Get method for private variables

*  Update to stookalert 0.1.4

* Code optimization

* Update requirements
2020-01-08 21:03:50 +01:00
Franck Nijhof
d659807b6f Fix WLED transition time unit (#30583) 2020-01-08 21:03:36 +01:00
Bram Kragten
6112092949 Updated frontend to 20200108.0 (#30591) 2020-01-08 21:02:07 +01:00
David Bonnes
2c1e354537 evohome: allow two round thermostats per gateway (#30589)
* bugfix issue #30517
* bump library, tweak name in manifest
* remove lint hint
2020-01-08 18:57:28 +00:00
Maciej Bieniek
4cd2e09fb3 Add missing string for already_configured in GIOS integration (#30590) 2020-01-08 19:44:03 +01:00
Franck Nijhof
120a96ff59 Bump adguardhome to 0.4.1 (#30586) 2020-01-08 10:48:57 -05:00
Maciej Bieniek
6e3e383b3f Add missing string for already_configured in Brother integration (#30584) 2020-01-08 16:15:05 +01:00
Franck Nijhof
0e9b414c26 Migrate Integration Quality Scale from docs to manifest (#30579) 2020-01-08 14:19:42 +01:00
Alexei Chetroi
ae8957ae12 Use more consts for person implementation (#30553)
* Use more consts for person implementation.

* Use ATTR_ENTITY_ID.
2020-01-08 07:35:34 -05:00
Santobert
3d7488d188 Trigger automation without skipping condition (#28484)
* Trigger automation without skipping condition

* [] instead of .get()

* Update __init__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-08 10:36:11 +01:00
Robert Svensson
84a1afc785 deCONZ - Fix device automations (#30577) 2020-01-08 10:06:33 +01:00
Robert Svensson
0d48d682dc deCONZ - Make sensors sorted on creation for deterministic order (#30569)
* Make sensors sorted on creation for deterministic order

* Martins comment
2020-01-08 09:30:02 +01:00
Ernst Klamer
31553796da Bump pyRFXtrx to 0.25 (#30566) 2020-01-08 09:20:50 +01:00
Daniel Shokouhi
130a577e67 Add android repo to issue template (#30571) 2020-01-07 22:10:04 -05:00
HomeAssistant Azure
8b7ffcdaf1 [ci skip] Translation update 2020-01-08 00:31:50 +00:00
Bram Kragten
16199b7a52 Add command to delete lovelace config (#30558)
* Add command to delete lovelace config

* Test + decorator for WS
2020-01-07 22:59:04 +01:00
Bram Kragten
1ce662d699 Updated frontend to 20200107.0 (#30561) 2020-01-07 22:55:10 +01:00
Franck Nijhof
bfa0edaf92 Migrate Integration Quality Scale from docs to manifest: internal (#30551) 2020-01-07 20:58:49 +01:00
Sascha Kühndel
23700e4db8 Fix hue flashing innr lights (#29828) 2020-01-07 20:56:57 +01:00
FrengerH
83d18c183b Fix missing strings for deconz magic cube rotation support (#30552)
* Fix missing strings for deconz magic cube rotation

* Fix missing strings for deconz magic cube rotation
2020-01-07 19:06:25 +01:00
Aaron Bach
856db4d122 Fix incorrect Rainmachine dict lookups (#30550) 2020-01-07 10:43:12 -07:00
Paulus Schoutsen
9aa02e35a7 Entity Component to no longer generate automatic groups (#23789) 2020-01-07 17:30:53 +01:00
tetienne
13e6479b6e Ease code before adding color and temperature to light template (#30455)
* Split async_update

* Use pytest parameters to avoid duplicate code

* Fix UnboundLocalError

* Test error rendering for template state

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-07 17:22:42 +01:00
Franck Nijhof
e18426051b Add Integration Quality Scale to manifest (#30547) 2020-01-07 17:21:56 +01:00
SukramJ
a4c830b5e4 Add reset_energy_counter service to Homematic IP Cloud (#30256)
* Add reset_energy_counter service to Homematic IP Cloud

* Fix isort

* Register service as admin service
2020-01-07 10:24:46 -05:00
Aleix Murtra
1d1aa06d05 Add TMB sensor (#27964)
* Add TMB i-Bus sensor

* Raise exception if HTTP error

* Addressed comments

* Fixed format

* Fixed format

* Addressed comments

* Remove guard before add_entities method

* Remove unauthorized exception

* Make CONF_BUS_STOPS option required
2020-01-07 16:22:16 +01:00
Franck Nijhof
b4d6d238e5 Correct names in manifests (T-Z) (#30546) 2020-01-07 14:31:18 +01:00
springstan
a5cc08c8b6 Update featured integrations screenshot in README (#30134)
* Update featured integrations in README

* Update screenshot to include Somfy and exclude Almond

* Update outdated screenshot of featured components
2020-01-07 14:30:52 +01:00
Franck Nijhof
22760a0bee Correct names in manifests (Q-S) (#30543) 2020-01-07 08:19:44 -05:00
Paulus Schoutsen
b27e05fc8d Use capability attributes in climate (#30544)
Co-authored-by: Jc2k <john.carr@unrouted.co.uk>
2020-01-07 14:14:46 +01:00
Raman Gupta
a9f6dd698e Remove suppress_warning from config options for vizio component (#30536)
* move constants, move schema validation to init, prepare for zeroconf/config flow

* mistake in refactor

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* fix schema validation

* remove suppress warning config option

* remove config_flow from manifest since its not ready yet

* update requirements_all.txt

* fix issue with merge conflict
2020-01-07 13:31:13 +01:00
Jeff Irion
73af75cb41 Catch UnicodeDecodeError exceptions in 'androidtv.adb_command' service (#30538)
* Catch UnicodeDecodeError exceptions in 'androidtv.adb_command' service

* Replace "adb_command" with SERVICE_ADB_COMMAND
2020-01-07 13:30:34 +01:00
Jeff Irion
98bb400f3a Bump adb-shell to 0.1.1 and androidtv to 0.0.38 (#30539)
* Bump adb-shell to 0.1.1 and androidtv to 0.0.38

* Bump adb-shell to 0.1.1 and androidtv to 0.0.38

* Bump adb-shell to 0.1.1 and androidtv to 0.0.38
2020-01-07 13:30:15 +01:00
Franck Nijhof
dc02c28891 Correct names in manifests (M-P) (#30541) 2020-01-07 13:28:35 +01:00
Paulus Schoutsen
c963128306 Upgrade to use new version of HASS-nabucasa (#30506)
* Upgrade to use new version of HASS-nabucasa

* Update hass-nabucasa to 0.31
2020-01-07 13:25:57 +01:00
Casper
6dc49a44d9 Update manifest.json: Typo fixed (#30542) 2020-01-07 13:23:52 +01:00
Colin Frei
b3f429eefa Swiss Transport Data: Save delay on sensor (#30526) 2020-01-07 12:27:34 +01:00
Jason Ross
692e87f5cc Add venstar PIN to config and client initialization (#30300)
* Add PIN to config and client  initialization

* Fix Formatting Error

* update PLATFORM_SCHEMA validation with the new option.
2020-01-07 10:20:46 +01:00
Alexei Chetroi
6740249bef Use collection helpers for input_boolean (#30514)
* Refactor input_boolean to use config dict for instantiation.

* Refactor input_boolean to use YamlCollection.

* Add storage collection to input_boolean.

* Update homeassistant/components/input_boolean/__init__.py

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

* Doh.

* Address comments.

* Add editable device state attribute.

* Clean up entities from entity registry on removal.

Reload yaml from correct source.

* Add tests.

* Update homeassistant/components/input_boolean/__init__.py

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

* Don't reset entity state on updates.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-01-07 08:53:43 +01:00
Franck Nijhof
345cc244ed Correct names in manifests (C-L) (#30532) 2020-01-07 08:19:17 +01:00
Raman Gupta
7d58de1bda Update vizio component to prepare for config flow and zeroconf support (#30522)
* move constants, move schema validation to init, prepare for zeroconf/config flow

* update requirements_all and make setup validation more pythonic

* mistake in refactor

* un-revert change from previous PR

* rename schema var

* update .coveragerc, move validate_auth to __init__, only attempt to get ESN if device setup is validated

* reinstate validate_setup but change logic to use new connection test function

* fix schema validation

* simplify string empty check logic

* missed commit
2020-01-06 20:32:31 -05:00
Eleftherios Chamakiotis
e22742550c Add "autobypass" option when arming AlarmDecoder integration (#30002)
* Initial implementation

* Passing autobypass parameter to constructor, as suggested

* Black formatting

* Removed default value from autobypass parameter of the constructor, as it's redundant
2020-01-06 20:17:21 -05:00
Trekky12
5ed1f16f25 Add pilight dimmer as light component (#30107)
* Add pilight dimmer as light component

* fix CI errors

* fix missing new lines

* improve formatting and addresses comments of @springstan

* rename config parameter and remove super() call to match pylint

* import only used constants of the pilight component

* Add myself to the code owners

* fix CODEOWNERS
2020-01-06 20:13:08 -05:00
HomeAssistant Azure
8c70fb5463 [ci skip] Translation update 2020-01-07 00:32:07 +00:00
Quentame
1587603c4c Bump synologydsm to 0.3.0 (#30529) 2020-01-06 17:38:42 -06:00
Markus Nigbur
453f7c7294 Fire restarted event on restarting active timer (#30475)
* Fire restarted event on restarting active timer

* Added test for the restart event
2020-01-07 00:00:23 +01:00
Franck Nijhof
6f92c19302 Correct integration names in manifests (A-B) (#30527)
* Correct names in manifests (A-B)

* Just Baidu

* Asterisk Call Detail Records
2020-01-06 23:59:12 +01:00
rccoleman
4a2987e790 Allow specific status codes while notifying mobile_app devices (#30496)
* Removed check and return with a notification status of 201

* Allow additional result codes

Allow 200, 201, and 202 as valid result codes
2020-01-06 23:41:07 +01:00
Jeff Irion
5ec5df77cc Register 'androidtv.download' and 'androidtv.upload' services (#30086)
* Add tests

* Add FileSync test

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

* Update example paths in services.yaml

* Bump androidtv to 0.0.37

* Bump androidtv to 0.0.37

* Bump androidtv to 0.0.37

* Import LockNotAcquiredException

* Import LockNotAcquiredException from androidtv.exceptions

* Rename 'host' to 'address'

* Add a logging statement when an ADB command is skipped

* Check hass.config.is_allowed_path(local_path)

* Add return

* Fix pylint

* Reduce duplicated code (AndroidTVDevice vs. FireTVDevice)

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

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

* Replace "command" with ATTR_COMMAND

* Don't try to connect to a device if it is a duplicate
2020-01-06 23:10:13 +01:00
Paulus Schoutsen
fbc53a886f Merge pull request #30525 from home-assistant/rc
0.103.6
2020-01-06 22:43:24 +01:00
Alexxander0
e88bfda2a8 Fix AVM FRITZ!DECT switch total consumption (#30478)
actor.get_energy() returns Wh, so division by 1000 is correct
2020-01-06 22:23:26 +01:00
Paulus Schoutsen
5675f16b61 Bumped version to 0.103.6 2020-01-06 22:02:31 +01:00
Paulus Schoutsen
4d0a093ec4 Fix google sync (#30524) 2020-01-06 22:02:25 +01:00
michaeldavie
60a9de40aa Bump env_canada to 0.0.31 (#30409) 2020-01-06 22:02:24 +01:00
Andrew Sayre
ed6b95f14a Bump pysmartthings 0.7.0 (#30302) 2020-01-06 22:01:06 +01:00
Robert Svensson
ce114b81c3 Handle wired bug on restart (#30276) 2020-01-06 22:01:05 +01:00
Paulus Schoutsen
05374d7c85 Fix google sync (#30524) 2020-01-06 22:00:39 +01:00
Franck Nijhof
a84741392b Format all manifests with prettier (#30521) 2020-01-06 21:28:23 +01:00
Maciej Bieniek
21029b1d7b Add Brother Printer integration (#30359)
* Init entities as unavailable when offline

* Initial commit

* Fix CODEOWNERS

* CODEOWNERS

* Run script.hassfest

* Add initial test

* Bump library

* More tests

* Tests

* Add new sensors and fix KeyError

* Fix unique_id and device_info

* Fix check for configured device

* More tests

* Bump library version

* Add uptime sensor

* Use config entry unique ID

* Run python3 -m script.gen_requirements_all

* Fix pylint error

* Remove pysnmp dependency

* Raise ConfigEntryNotReady when device offline at HA start

* Remove period from logging message

* Generator simplification

* Change raise_on_progress

* Rename data to printer

* Move update state to async_update

* Remove unused _unit_of_measurement

* Remove update of device_info

* Suggested change for tests

* Remove unnecessary argument

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

* Fix mqtt fan test

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

* Fix comment from review

* Fix comment from review

* Lint fix
2020-01-06 16:35:10 +01:00
Ben
1fffa210e1 Add surepetcare component (#24426)
* add surepetcare

* cleanup

* remove unused imports and comments

* remove comment

* fix bug which prevented updating the sensors

* improve config validation

* fix voluptuous usage

* fix format & credential storage

* various fixes to hass-conform

* small format fixes

* change False to None

* still trying to be hass-conform

* remove unused class

* fix imports

* fix f-string

* add guard clause?!

* central data fetch

* do not pass in hass, will be provided automatically

* make the linters happy

* disable constant-test warning and add commas

* worksforme

* fix link in manifest

* remove icon

* bump surepy to 0.1.5

* worksforme

* small doc fixes

* add discovery_info guard

* result of another awesome review

* and again :)

* exclude surepetcare in .coveragerc
2020-01-06 09:00:01 -05:00
SukramJ
0971c681af Add HmIP-PMFS and HmIP-WHS2 to HomematicIP Cloud (#30325)
* update test data

* Update homematicip_cloud.json

* Add HmIP-WHS2

* Add HmIP-PMFS
2020-01-06 08:35:41 -05:00
Gido
10e698e0b2 Update GarbageTypeCodes for rova
Updating rova/sensor.py. Rova json format changed for garbage collection.
2020-01-06 08:34:15 -05:00
Ville Skyttä
80cbc32c49 Spell Zigbee consistently, with lowercase "b" (#30440)
https://zigbeealliance.org/developer_resources/zigbee-specification/
"Please note that this uses old branding, Zigbee is always a lowercase
 B, not a capital. This change occurred shortly after the official
 release of this document."

Also other docs at https://zigbeealliance.org/solution_type/zigbee/,
https://github.com/zigpy/zigpy/issues/111
2020-01-06 08:32:10 -05:00
FrengerH
0d1da9f5cb deCONZ - Rotation support for Xiaomi magic cube (#30472)
* Added rotation to deconz magic cube event

* Device trigger support
2020-01-06 12:34:27 +01:00
Alan Tse
f4f7c25f74 Bump teslajsonpy to 0.2.2 (#30512)
Fixes #30235
2020-01-06 09:52:26 +01:00
HomeAssistant Azure
d1ed67f44a [ci skip] Translation update 2020-01-06 00:32:11 +00:00
brefra
4efbe7135c Add LED control of push buttons and bump velbus-library (#30445)
* Add LED control

* Bump python-velbus library to 2.0.35

To have LED control available in library

* Apply black formating

* Fix no-else-return pylint error

* Changed to f-string and more dry code

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

* Save an indented else block

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

* Lint fix
2020-01-05 15:56:46 +01:00
Paulus Schoutsen
8625e962ce Remove double person data validation (#30501) 2020-01-05 15:50:59 +01:00
Franck Nijhof
0a9ac91dec Migrate automatic tests from coroutine to async/await (#30371)
* Migrate automatic tests from coroutine to async/await

* Remove unneeded side effect

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

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

* Update restore_state.py
2020-01-05 11:58:59 +01:00
Raman Gupta
2ac5862eda Add unique id property for Vizio devices so they get added to entity registry (#30497)
* add unique id property for Vizio devices so they get added to entity registry

* update requirements

* small change to make code more readable

* update to use f-string for consistency

* fix property name

* set unique_id to none if serial number couldnt be found

* set unique_id to none

* ESN should be globally unique so no device type needed. pyvizio will set ESN to None if ESN is unobtainable
2020-01-05 11:20:06 +01:00
Paulus Schoutsen
30076d1843 Add person reload service (#30493) 2020-01-05 11:16:37 +01:00
Robert Svensson
35e19eec18 Axis - Allow manual configuration to update existing configuration (#30467)
* Allow manual configuration to update existing configuration

* Harmonize tests

* Understand what Elupus means...
2020-01-05 10:11:17 +01:00
HomeAssistant Azure
063193e6e5 [ci skip] Translation update 2020-01-05 00:32:15 +00:00
Pascal Vizeli
e95a04b6f6 bump hassio-builder version 2020-01-05 00:28:42 +01:00
Pascal Vizeli
8c2858ebde support odroid-n2 on release 2020-01-05 00:26:39 +01:00
Paulus Schoutsen
95cd0a2c68 Mobile App add device tracker to person registering app (#30460) 2020-01-04 23:15:50 +01:00
Phil Bruckner
e233dd7cbe Fix timer with empty config (#30463) 2020-01-04 23:01:58 +01:00
David F. Mulcahey
6c89b6c5a2 Add Zigbee group binding to ZHA (#30433)
* initial group binding work
* add group cluster binding
2020-01-04 16:58:51 -05:00
Robert Svensson
967fe89f6d deCONZ - Allow manual configuration to update existing configuration (#30469)
* Allow manual configuration to update existing configuration

* Harmonize tests
2020-01-04 22:55:57 +01:00
Franck Nijhof
639cdf5eef Bump twentemilieu to 0.2.0 (#30471) 2020-01-04 22:55:04 +01:00
Franck Nijhof
42b86d4b4e Bump wled to 0.2.1 (#30474)
* Bump wled to 0.2.0

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

* Improve robustness of the tests
2020-01-04 22:48:31 +01:00
Franck Nijhof
bf9418e51a Bump adguardhome to 0.4.0 (#30483) 2020-01-04 22:47:34 +01:00
Franck Nijhof
3b14d9f375 Add unique ID to elgato config entries (#30486) 2020-01-04 22:45:11 +01:00
Franck Nijhof
4ea0754094 Fix WLED light transition (#30490) 2020-01-04 22:44:28 +01:00
Franck Nijhof
049ced63b1 Bump elgato to 0.2.0 (#30485) 2020-01-04 20:25:07 +01:00
Paulus Schoutsen
2f362b44c4 Allow adding unique device ID to mobile app registration (#30457)
* Allow adding unique device ID to mobile app registration

* Remove unknown data

* Better fix
2020-01-04 13:45:03 +01:00
Paulus Schoutsen
6e909ab3f1 Only return remote UI url if remote UI enabled (#30453) 2020-01-04 13:43:59 +01:00
Robert Svensson
63347ebeb5 Make Axis integration use config entry unique id (#30461)
* Make Axis integration use config entry unique id
2020-01-04 08:58:18 +01:00
HomeAssistant Azure
075d3f6e32 [ci skip] Translation update 2020-01-04 00:32:23 +00:00
Joakim Plate
8dc57a3700 Allow all sources and sound modes to be selected in google assistant (#30418)
* Simplify media player source list

Google don't need a whitelisted set of modes anymore. So let's just forward any mode that we have.

* Report current mode with the setting name, not a synonym

* Refactor mode generation to support other modes

* Support sound mode as mode as well

* Adjust failing test now with sound modes
2020-01-04 00:39:03 +01:00
Phil Bruckner
d6e230e66b Fix counter with empty config (#30454) 2020-01-04 00:03:54 +01:00
brefra
b75aa7eb3a Fix async call inside sync context (#30458)
* Fix async call inside sync context

* Apply black formatting
2020-01-04 00:01:37 +01:00
Paulus Schoutsen
b9aba30a6e Extract Collection helper from Person integration (#30313)
* Add CRUD foundation

* Use collection helper in person integration

* Lint/pytest

* Add tests

* Lint

* Create notification
2020-01-03 21:37:11 +01:00
David Cramer
3033dbd86c Add Sentry component (#30422) 2020-01-03 21:34:20 +01:00
Robert Svensson
bb55606d29 Axis - Remove manual configuration and legacy config file import (#30365)
* Remove manual configuration and legacy config file import

* Remove unused imports in tests after rebase
2020-01-03 14:25:31 -06:00
ochlocracy
6387a50697 Implement supported locales for Alexa capabilities (#30285)
* Implement Alexa capability supported locales.

* Check config for supported locales.

* Removed unused import.

* Applied some potpourri to improve code smell.

* Change supported_locales to set.
2020-01-03 21:23:22 +01:00
Jc2k
80701c8f2a Defer homekit_controller initial poll after all entities are created (#30355)
* Make sure first poll happens after sub-platforms are loaded and entities are created.

* Function dosn't need to return anything

* Don't forward entry if already forwarded it
2020-01-03 21:22:27 +01:00
Robert Svensson
2b26af89df Improve tests based on Martins feedback from Axis improve tests (#30442) 2020-01-03 12:23:17 -06:00
Marcelo Moreira de Mello
e7af759330 Bump ring to 0.2.9 (#30439) 2020-01-03 12:19:14 -06:00
Robert Svensson
ec61342ec3 deCONZ - Improve tests based on Martins feedback in Axis integration (#30438) 2020-01-03 18:11:04 +01:00
Josh Anderson
8a1fc8b8f0 Check status field for UPS online binary sensor (#30144)
Avoids issue where status was previously reported as offline when
battery was low or UPS was over voltage
2020-01-03 17:40:36 +01:00
Jc2k
6b519499a7 Don't expose flows that aren't initialised. (#30432)
* Don't expose flows that aren't initialised.

If a flow init does not return immediately then there is a window where our
behaviour is screwy:

 * Can try to configure a flow that isn't ready
 * Can show notifications for discoveries that might yet return an abort

This moves the flow discovery events and notifications to after the flow is
initialised and hides flows that don't have a cur_step from async_progress

* Fix tradfri test

* Black.

* Lint fixes
2020-01-03 17:28:05 +01:00
Jc2k
df6c7b97f5 isort homekit (#30437) 2020-01-03 15:00:44 +00:00
Robert Svensson
536b201472 WIP deCONZ - Support Fyrtur/Kadrilj battery sensors (#30403)
* Sensor.binary is None means unsupported sensor
* Don't create ordinary sensor on ZHABattery type
2020-01-03 15:15:32 +01:00
Bas Nijholt
0d5486f772 Add KEF speakers integration (#28959)
* add KEF speakers platform for the integration

This will work with the KEF LS50 Wireless and KEF LSX speakers.
The development of this code happened on https://github.com/basnijholt/media_player.kef

* rename DATA_KEF -> DOMAIN

* use aiokef v0.2.0 and support LSX and new features

* sort imports

* fix @MartinHjelmare's suggestions

* remove _CONFIGURING

* change STATE_UNKNOWN to None

* use lat and long for unique_id

* bump aiokef to v0.2.2

* use config[ATTR] instead of config.get(ATTR)

* use getmac

* fix case when MAC is None

* use host as instance lifetime id

* fix requirements
2020-01-03 14:59:44 +01:00
Ville Skyttä
fa4fa30461 Various string cleanups (#30435)
* Remove some unnecessary string concatenations

* Replace some simple str.formats with f-strings

* Replace some string concatenations with f-strings
2020-01-03 14:47:06 +01:00
Sérgio
5ad209c6fd Handle telegram event commands with args (#30254)
* Handle telegram event commands with args

* Parse message regargless of command

* Lint

* Use multiple assignment
2020-01-03 08:22:14 -05:00
David K
859935e8bc Update HomeKit position state characteristic for covers (#27867)
* HomeKit: update position state characteristic for covers

position state is a mandatory characteristic for HK window coverings

* Test position state characteristic
2020-01-03 08:19:03 -05:00
Robert Svensson
b57da2f862 Axis - Improve tests based on feedback (#30430)
* Use MockConfigEntry, add_to_hass and hass.config_entries.async_setup

* Mock method instead of handling paths
2020-01-03 13:27:14 +01:00
Joakim Plate
0944d02262 Mark API key as deprecated (#30402)
Service account should be used instead
2020-01-03 12:12:29 +01:00
Ian Duffy
5580ee3fa1 Don't allow badly formed upnp devices to kill auto discovery (#30342)
Prevent the following from occurring:

```
2019-12-31 22:38:41 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 85, in async_init
    return await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 145, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/deconz/config_flow.py", line 182, in async_step_ssdp
    if discovery_info[ssdp.ATTR_UPNP_MANUFACTURER_URL] != DECONZ_MANUFACTURERURL:
KeyError: 'manufacturerURL'
2019-12-31 22:38:41 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 85, in async_init
    return await self._async_handle_step(flow, flow.init_step, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 145, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/deconz/config_flow.py", line 182, in async_step_ssdp
    if discovery_info[ssdp.ATTR_UPNP_MANUFACTURER_URL] != DECONZ_MANUFACTURERURL:
KeyError: 'manufacturerURL'
```
2020-01-03 12:08:40 +01:00
Stefan Agner
3f33fc6122 convert to integer if rounding precision is zero (#30226)
Convert values to integer if rounding precision is zero. With that a
value which is an integer before filtering can be configured to stay
integer when using precision = 0. This also aligns behavior of filters
to how rounding behaves in tempaltes (homeassistant/helpers/template.py,
function forgiving_round).
2020-01-03 11:54:19 +01:00
Jc2k
fdfedd086b Rework FlowManager to use inheritance (#30133)
* Pull async_finish_flow/async_create_flow out of ConfigEntries

* Towards refactoring

* mypy fixes

* Mark Flow manager with abc.* annotations

* Flake8 fixes

* Mypy fixes

* Blacken data_entry_flow

* Blacken longer signatures caused by mypy changes

* test fixes

* Test fixes

* Fix typo

* Avoid protected member lint (W0212) in config_entries

* More protected member fixes

* Missing await
2020-01-03 11:52:01 +01:00
Robert Svensson
0a4f3ec1ec Use config entry unique id for deCONZ (#30122)
* Use config entry unique id

* Clean up

* Backwards compatiblity note

* Fix some of Balloobs comments

* Bump dependency to v66

* Black somehow missed config flow tests...

* Move set unique ID til after possibility to update existing entry
2020-01-03 11:50:53 +01:00
Ville Skyttä
c130e81638 Fix number of times seen in debug message (#30429) 2020-01-03 11:31:50 +01:00
tetienne
f5aa89dd06 Fix set tilt position (#30428) 2020-01-03 11:31:05 +01:00
ochlocracy
3a18ef219b Add RTSP stream support for UVC (Unifi Video Client) integration (#30297)
* Add SUPPORT_STREAM to supported_features.

* Implement stream_source with channel RTSP URIs.

* Add Tests for Stream Support.

* Make stream_source async.

* Removed unused import.

* Re-wrote test to remove warning, and lint error.
2020-01-03 11:30:26 +01:00
Oliver
b097a64010 Implemented media_play & media_pause / push to version 0.7.11 of denonavr (#30421)
* Implement media_play & media_pause / push to version 0.7.11 of denonavr

* fix denonavr version in requirements_test_all.txt
2020-01-02 22:06:33 -06:00
David F. Mulcahey
ef8eefc7a0 Remove ZHA establish device mappings function (#30423)
* remove establish_device_mappings
* inline init
2020-01-02 21:21:09 -05:00
Josh Bendavid
4c6e10a988 Cleanup of state handling in webostv (#30416)
* cleanup unnecessary manipulation of state variables

* update unit test
2020-01-03 02:46:32 +01:00
HomeAssistant Azure
4bf15a07a3 [ci skip] Translation update 2020-01-03 00:32:16 +00:00
Robert Svensson
9b961632af Axis - Improve tests (#30415) 2020-01-03 00:02:59 +01:00
Josh Bendavid
c1936f6fe4 Add generic command/button functionality to webostv (#30379)
* add generic command/button functionality to webostv

* update codeowners
2020-01-02 22:32:56 +01:00
Josh Bendavid
9064058a03 Add generic command functionality to denonavr (#29295)
* Add generic command functionality to denonavr

* add minimal unit tests for denonavr

* fix import order

* simplify denonavr unit test

* handle domain specific service calls with dispatcher

* update unit tests

* update unit tests

* remove unnecessary return value

* fix handling of mock instances in unit tests
2020-01-02 22:30:20 +01:00
michaeldavie
b91cbb50c8 Bump env_canada to 0.0.31 (#30409) 2020-01-02 15:24:43 -06:00
springstan
8e5ccfcb8a Bump miflora and bluepy (#30411) 2020-01-02 15:24:29 -06:00
Franck Nijhof
4f8663846b Migrate frontend tests from coroutine to async/await (#30386) 2020-01-02 14:23:56 -06:00
Franck Nijhof
4e6d415541 Migrate media_player tests from coroutine to async/await (#30387) 2020-01-02 14:23:35 -06:00
Franck Nijhof
b9fcb87d2c Migrate generic tests from coroutine to async/await (#30388) 2020-01-02 14:23:16 -06:00
Franck Nijhof
1e3822bdd7 Migrate group tests from coroutine to async/await (#30389) 2020-01-02 14:22:49 -06:00
Franck Nijhof
332cbbd8b1 Migrate freedns tests from coroutine to async/await (#30390) 2020-01-02 14:22:30 -06:00
Franck Nijhof
5b2b86987b Migrate fido tests from coroutine to async/await (#30391) 2020-01-02 14:22:13 -06:00
Franck Nijhof
7b00e94184 Migrate local_file tests from coroutine to async/await (#30392) 2020-01-02 14:21:54 -06:00
Aaron David Schneider
5edf72c9ea fix issuecomment-570284682 (#30405) 2020-01-02 14:17:37 -06:00
Franck Nijhof
24d5e54eed Bump pre-commit to 1.21.0 (#30406) 2020-01-02 14:16:58 -06:00
Ville Skyttä
e6388e186c Remove unnecessary string literal concatenations (#30360) 2020-01-02 21:17:10 +02:00
Ernst Klamer
cac750066a Remove unnessecary rfxtrx light property def (#30397) 2020-01-02 16:44:29 +01:00
Ernst Klamer
77978a979b Restore state for Rfxtrx devices (#30309)
* Restore state rfxtrx switch

* Restore state RFXtrx lights

* Restore state RFXtrx covers

* Restore comment

* Remove line

* Remove logging

* fix black

* Fix typo
2020-01-02 07:59:13 +01:00
HomeAssistant Azure
769cf19052 [ci skip] Translation update 2020-01-02 00:32:24 +00:00
Alan Tse
fc08c62a31 Add charging rate sensor to Tesla (#30286)
* Add charging rate sensor to Tesla

* Remove reference to bin_type
2020-01-02 00:36:14 +01:00
Franck Nijhof
37d1771400 Migrate google_* tests from coroutine to async/await (#30377) 2020-01-01 17:24:30 -06:00
Franck Nijhof
bcb47dab45 Migrate discovery tests from coroutine to async/await (#30376) 2020-01-01 17:22:32 -06:00
Franck Nijhof
b43b50b6d2 Migrate ffmpeg tests from coroutine to async/await (#30375) 2020-01-01 17:22:08 -06:00
Franck Nijhof
c5298dc4dc Migrate cast tests from coroutine to async/await (#30374) 2020-01-01 17:21:42 -06:00
Franck Nijhof
c837f185f7 Migrate camera tests from coroutine to async/await (#30372) 2020-01-01 17:21:21 -06:00
Franck Nijhof
8814e1eadc Migrate no_ip tests from coroutine to async/await (#30370) 2020-01-01 17:18:40 -06:00
Franck Nijhof
47aa0043bf Migrate owntracks tests from coroutine to async/await (#30369) 2020-01-01 17:18:20 -06:00
Franck Nijhof
1a2a976be2 Migrate counter tests from coroutine to async/await (#30368) 2020-01-01 17:17:55 -06:00
Franck Nijhof
320dc52bb3 Migrate config tests from coroutine to async/await (#30366) 2020-01-01 17:16:27 -06:00
Franck Nijhof
4e7b35355d Migrate websocket_api tests from coroutine to async/await (#30364) 2020-01-01 17:15:29 -06:00
Franck Nijhof
0fb5fbd85c Migrate hassio tests from coroutine to async/await (#30363) 2020-01-01 17:13:43 -06:00
Franck Nijhof
3a4db2fae7 Migrate mailbox tests from coroutine to async/await (#30361) 2020-01-01 17:13:04 -06:00
Aaron David Schneider
99bc911f7f Add attributes to fritz device_tracker (#30350)
* add attributes to device_tracker

* fix pylint

* requested changes

* docstring updated
2020-01-01 22:03:37 +01:00
Alan Tse
790b2d00c7 Fix HVAC mode for Tesla (#30287)
* Fix HVAC mode for Tesla

* Change HVAC_MODE to HEAT_COOL
2020-01-01 20:49:20 +01:00
Fabian Affolter
0479e93de7 Upgrade python_opendata_transport to 0.2.1 (#30348) 2020-01-01 14:06:20 -05:00
Jeff Irion
83e05da0b3 Fix media_player example for select_source service (#30358) 2020-01-01 19:40:11 +01:00
Franck Nijhof
bc6e2a06e6 Migrate yr tests from coroutine to async/await (#30351) 2020-01-01 16:21:37 +01:00
Franck Nijhof
33828ae514 Migrate timer tests from coroutine to async/await (#30352) 2020-01-01 16:20:18 +01:00
Franck Nijhof
9ba0daa358 Migrate teksavvy tests from coroutine to async/await (#30353) 2020-01-01 16:18:17 +01:00
Franck Nijhof
9fbe6d60cb Migrate startca tests from coroutine to async/await (#30354) 2020-01-01 16:17:35 +01:00
Fabian Affolter
e099d57bde Upgrade zeroconf to 0.24.4 (#30347) 2020-01-01 14:04:37 +01:00
Josef Schlehofer
298d898627 Upgrade youtube_dl to version 2020.01.01 (#30341) 2020-01-01 12:36:43 +01:00
Alan Tse
272c00e81b Remove use of bin_type in Tesla component (#30315)
* Remove use of bin_type

* Convert _unit attribute to units

* Remove unnecessary variable assignment

* Change to using util library convert
2020-01-01 12:23:29 +01:00
HomeAssistant Azure
bb2d8e3f7d [ci skip] Translation update 2020-01-01 00:32:22 +00:00
Franck Nijhof
52ed9608e2 Migrate input_* tests from coroutine to async/await (#30336) 2020-01-01 01:22:44 +01:00
Josh Bendavid
fc23b4f83f Migrate webostv to new library and make integration async with callback state updates (#29296)
* migrate webostv to new aiopylgtv version of the library and add support
for generic commands, input/button commands, and callback state updates

* update requirements

* cleanup and bump aiopylgtv version

* update webostv unit tests

* make webostv unit tests work with python 3.7

* cleanup for code checks

* cleanup and code review

* make all client request functions coroutines

* make host required for webostv configuration

* remove generic command and button functionality plus related cleanup

* fix previous track function

* update unit tests

* fix imports for unit tests

* update unit test

* further unit test updates

* remove unnecessary setup call in unit tests

* restore previous behaviour with client key config file in hass configuration directory
2020-01-01 00:26:35 +01:00
Franck Nijhof
af153521dc Migrate emulated_hue tests from coroutine to async/await (#30331) 2019-12-31 16:50:07 -06:00
Franck Nijhof
194cb8dbf5 Migrate xiaomi_miio tests from coroutine to async/await (#30329) 2019-12-31 16:49:00 -06:00
Franck Nijhof
2ac5537495 Migrate alexa tests from coroutine to async/await (#30332) 2019-12-31 16:48:17 -06:00
Franck Nijhof
0280862780 Migrate api tests from coroutine to async/await (#30338) 2019-12-31 22:58:40 +01:00
Franck Nijhof
687a052d40 Migrate python_script tests from coroutine to async/await (#30335) 2019-12-31 22:48:43 +01:00
springstan
f11d39f8eb Bump alarmdecoder to 1.13.9 (#30303) 2019-12-31 15:54:31 -05:00
Franck Nijhof
d8d75d882b Bump pyps4-2ndscreen to 1.0.4 (#30327) 2019-12-31 15:52:45 -05:00
Franck Nijhof
cd8f954a4d Migrate wunderground tests from coroutine to async/await (#30330) 2019-12-31 21:04:24 +01:00
Franck Nijhof
30dbed3f98 Migrate dsmr tests from coroutine to async/await (#30333) 2019-12-31 21:03:21 +01:00
Franck Nijhof
2620a95944 Improve Withings tests in different time zone (#30326)
* Improve Withings tests in different time zone

* Address code review comment

* Spelling error in code doc
2019-12-31 11:10:39 -05:00
Alexei Chetroi
a3061bda60 Make the rest of ZHA platforms to use ZHA class registry (#30261)
* Refactor ZHA component tests fixtures.

* Add tests for ZHA device discovery.

* Refactor ZHA registry MatchRule.

Allow callables as a matching criteria.
Allow sets for model & manufacturer.

* Minor ZHA class registry refactoring.

Less cluttered strict_matching registrations.

* Add entities only if there are any.

* Migrate rest of ZHA platforms to ZHA registry.

* Pylint fixes.
2019-12-31 11:09:58 -05:00
Alan Tse
5ed44297e6 Simplify Tesla icon get code (#30301)
* Simplify icon get code

* Remove extraneous None
2019-12-31 16:27:39 +01:00
Lars-P
4031596aa7 Fix luftdaten integration by adding a sensor for pressure at sealevel (#30317) 2019-12-31 15:58:54 +01:00
brefra
3c8ebf1844 Add light support to Velbus integration (#30323)
* Add light support to Velbus integration

* Add Velbus light.py to .coveragerc

* Applied black formatting
2019-12-31 15:46:02 +01:00
Fabian Affolter
734ef5a7a9 Upgrade Sphinx to 2.3.1 (#30310) 2019-12-31 15:32:26 +01:00
Iulius
1c2618d99a Add separate command and state topics for mqtt lock (#29808)
* Update lock.py

Allow different command and state topic + different command and state values.

* Formatting updated after black run

* TC updated to reflect different state & cmd values

* Abbreviations for lock states added

* additional non-default state test

* whitespaces fixed

* black formatting run
2019-12-31 15:24:09 +01:00
Christian
fd0375ac20 Add support for Velux garage doors (#30214)
* Update manifest.json

* Update cover.py

Add GarageDoor

* Update to pyvlx 0.2.12

* Sort
2019-12-31 15:17:17 +01:00
Phil Bruckner
609bf445f0 Remove Amcrest deprecated sensors and switches (#30308) 2019-12-31 08:16:41 -06:00
Shawn Wilsher
e68cd339b9 Reduce solaredge logging severity (#30305)
* [solaredge] Reduce Severity of Log Line

This log error happens frequently for some sites, but it shouldn't be an error.
It is expected, per the SolarEdge Monitoring API, that some sites do not
support this information, and the expected result is that this would be
empty (see comments on #27959).

Fixes #27959

* Fix a typo

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2019-12-31 08:56:23 -05:00
rhadamantys
dedd1aec8c Add support for Somfy RTS power socket and Somfy io Temperature sensor (#30053)
* Added support for Somfy RTS wireless power socket and
Somfy Temperature Sensore Thermos Wirefree io

* Added code formatting fixes for commit 5faaf9c

* added support for RollerShutterRTSComponent from Somfy

* Added support for RTS roller shutter in set_cover_position

* Add support for Somfy RTS power socket and Somfy io temperature sensor

* black and isort fixes
2019-12-31 14:48:31 +01:00
SukramJ
b0a0871bed Bump dependency for HomematicIP Cloud (#30319) 2019-12-31 14:45:17 +01:00
Steven Barth
4bfc7b9848 Add homematic host port config for HMIP-only CCUs (#30077)
* homematic: Add host port config for HMIP-only CCUs

When adding a host (CCU) to the homematic component currently the hardcoded port 2001 is used to communicate with it.
However that port is only available on the target if the target supports HM (wireless) protocol which is not the case e.g. for
the Hass.io Homematic CCU addon when running in HMIP-only mode with the HMIP-RFUSB stick.

This allows to change the port home assistant uses to talk to the CCU in order to provide services under hte homematic homain, e.g. homematic.set_variable_value

The default value for this option is the old hardcoded value this the change should be backwards compatible with existing configurations.

* Change style of config retrieval
2019-12-31 08:41:44 -05:00
Philipp Schmitt
72e97792bd Update liveboxplay and pyteleloisirs (#30093) 2019-12-31 08:38:46 -05:00
Issac
3f570245aa Add local_ip component (#29973)
* Added localip component

* Split config and core logic, and migrate to sensor platform (requested by @MartinHjelmare)
Also allow overriding the sensor name via the config

* Tweak docstring

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

* Initial support for config entries

* Rename localip to local_ip (1/2)

* Rename localip to local_ip (2/2)

* Add test for config_flow

* Split and rename tests

* Remove unneeded code from config_flow

* Implement configuration as config entry import.  Other misc requested changes from code review.

* Fix tests

* minor code review fixes

* remove unneeded code

Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2019-12-31 14:34:53 +01:00
Franck Nijhof
5414e9d155 Fix Withings leaking time zone change into other tests (#30320)
* Fix Withings leaking time zone change in other tests

* Fix spelling error in code doc
2019-12-31 14:30:09 +01:00
Paulus Schoutsen
bb14a083f0 Store capabilities and supported features in entity registry, restore registered entities on startup (#30094)
* Store capabilities and supported features in entity registry

* Restore states at startup

* Restore non-disabled entities on HA start

* Fix test

* Pass device class from entity platform

* Clean up restored entities from state machine

* Fix Z-Wave test?
2019-12-31 14:29:43 +01:00
Maciej Bieniek
2c1a7a54cd Add GIOS integration (#28719)
* Initial commit

* Add gios to requirements

* Add tests

* Update .coveragerc file

* Run gen_requirements_all.py

* Change DEFAULT_SCAN_INTERVAL

* Better strings

* Bump library version

* run script.hassfest

* run isort

* Add icons mapping

* Remove unnecessary f-string

* Remove unnecessary listener

* Refactoring config_flow

* Add unique_id to config entry

* Change AQI states to consts in English

* Remove unused init

* Remove unused exception

* Remove private instance attribute

* Remove overwrite state property

* Fix pylint error

* Add SCAN_INTERVAL for air_quality entity

* Add _abort_if_unique_id_configured()
2019-12-31 13:05:31 +01:00
Phil Bruckner
1ee299b079 Ignore google_maps updates when last_seen goes backwards (#30178) 2019-12-30 19:30:45 -06:00
HomeAssistant Azure
ae51331d49 [ci skip] Translation update 2019-12-31 00:32:20 +00:00
Andrew Sayre
914aea9446 Bump pysmartthings 0.7.0 (#30302) 2019-12-30 14:49:56 -06:00
Robert Svensson
41d2d1f309 Handle wired bug on restart (#30276) 2019-12-30 12:40:52 -06:00
Tais Hedegaard Holland
bad35577cb Bump ihcsdk to 2.4.0 (#30279)
* Update requirements_all.txt

update ihcsdk to version 2.4.0

* Update manifest.json

upgrade to version 2.4.0 of ihcsdk
2019-12-30 12:38:17 -06:00
Andy Grunwald
3b9f48b51d Contributing: Add note about feature suggestions and bug tracking (#30225) 2019-12-30 17:54:16 +01:00
Alan Tse
40e3d6f773 Change default icons for Tesla components (#30288) 2019-12-30 17:52:34 +01:00
Fabian Affolter
d0c9a42b81 Add custom validator for countries (#30280) 2019-12-30 17:51:25 +01:00
Fabian Affolter
33738cc83a Upgrade beautifulsoup4 to 4.8.2 (#30274) 2019-12-30 17:51:11 +01:00
Jc2k
fccb13b762 Add homekit_controller service.sensor.smoke (#30269) 2019-12-30 08:05:49 +00:00
Jc2k
8a22a38353 Accept homekit_controller pairing codes both with and without dashes (#30273)
* Handle MalformedPinError from homekit_python
* Handle both formats of pin codes
2019-12-30 07:36:01 +00:00
HomeAssistant Azure
13116d8d3f [ci skip] Translation update 2019-12-30 00:32:19 +00:00
Ville Skyttä
9892564ab5 Upgrade rflink to 0.0.50, ignore_devices now supports * and ? anywhere (#30268)
https://github.com/aequitas/python-rflink/releases/tag/0.0.50
https://github.com/aequitas/python-rflink/releases/tag/0.0.49
https://github.com/aequitas/python-rflink/releases/tag/0.0.48
https://github.com/aequitas/python-rflink/releases/tag/0.0.47
2019-12-29 21:12:49 +02:00
François
85624e8031 Fix creating smappee sensors when remote is not active (#30270) 2019-12-29 17:18:23 +01:00
LE LAY Olivier
a91b005822 Fix ble_tracker randomly pygatt thrown error (#28671)
* fix(ble_tracker): catch randomly pygatt thrown error

* fix(ble_tracker): merge except errors
2019-12-29 09:26:43 +02:00
HomeAssistant Azure
5d8dda4f68 [ci skip] Translation update 2019-12-29 00:32:14 +00:00
Pascal Vizeli
79b47157b8 Merge pull request #30260 from home-assistant/rc
0.103.5
2019-12-28 22:16:11 +01:00
Alexei Chetroi
36585558a5 Refactor ZHA channel logging (#30259)
Add channel.id property -- id unique for this the device only.
2019-12-28 15:41:55 -05:00
Pascal Vizeli
ae42736235 Bump version 0.103.5 2019-12-28 20:26:06 +00:00
Robert Van Gorkom
08af989658 Fixing timezone issue which caused wrong selection of data to be used. (#30011) 2019-12-28 21:25:37 +01:00
Marcelo Moreira de Mello
fdd090bae0 Bump ring to 0.2.8 to fix Oauth issues (#30245) 2019-12-28 20:24:29 +00:00
Paulus Schoutsen
5a9e543087 Whitelist Android/iOS auth callbacks (#30082)
* Whitelist Android/iOS

* Add iOS alternate flavor URLs

* Update indieauth.py

Co-authored-by: Robbie Trencheny <me@robbiet.us>
2019-12-28 21:20:18 +01:00
Maikel Punie
e1e8d6a562 Bump python-velbus library to 2.0.32 to fix problems with the glaspanels (#30257) 2019-12-28 21:16:52 +01:00
Ville Skyttä
4e50a402c7 Note Huawei LTE notify service change requires restart (#30223)
Refs https://github.com/home-assistant/home-assistant/issues/30222
2019-12-28 16:31:42 +01:00
SukramJ
658ec309aa Add HmIP-MOD_TM to HomematicIP Cloud (#30255) 2019-12-28 16:29:14 +01:00
Ville Skyttä
c5a280c064 Huawei LTE: Fix YAML options overriding ones set from GUI (#30249)
Closes https://github.com/home-assistant/home-assistant/issues/30221
2019-12-28 16:27:49 +01:00
Felix Barbalet
0323b246bd Bump libpurecool to 0.6.0 (#30247)
* bump libpurecool to 0.6.0 - fixes home-assistant/home-assistant#26367

* update manifest too
2019-12-28 16:19:18 +01:00
SukramJ
134dc45b77 Bump dependency for HomematicIp cloud (#30237)
* Bump dependency for HomematicIp cloud

* Update test_data
2019-12-28 13:46:04 +01:00
Ville Skyttä
e4cda9ae0b Fix Huawei LTE error message on service call without URL and routers (#30250) 2019-12-28 12:55:45 +01:00
Marcelo Moreira de Mello
59fee12b45 Bump ring to 0.2.8 to fix Oauth issues (#30245) 2019-12-28 10:15:35 +01:00
springstan
cf7b70dd8c Bump python-qbittorrent to 0.4.1 (#30239) 2019-12-28 10:09:42 +01:00
HomeAssistant Azure
2e07902999 [ci skip] Translation update 2019-12-28 00:32:22 +00:00
Kerwood
9d6f3654ad DECONZ - Added support for Aqara single switch WXKG03LM (#30240) 2019-12-27 21:47:45 +01:00
Franck Nijhof
9159da6583 Bump shodan to 1.21.1 (#30234) 2019-12-27 20:35:25 +01:00
HomeAssistant Azure
39d38923b7 [ci skip] Translation update 2019-12-27 00:32:13 +00:00
David F. Mulcahey
05a0922dc0 Bump ZHA dependencies (#30228)
* bump dependencies
* requirement files
* bump quirks to 0.0.30
2019-12-26 17:08:14 -05:00
Josh Bendavid
d6744fbc4e Fix handling of symlinked device descriptors in keyboard_remote and move remaining sync io to executor thread pool (#30206)
* fix handling of symlinked device decriptors

* make check for symlinked paths more efficient

* make variable names pylint compliant

* move sync io during setup and device connect/disconnect to executor thread pool

* move remaining sync io during setup to executor thread pool

* remove unnecessary lambda functions
2019-12-26 19:06:57 +01:00
Paul Annekov
b2753b7578 bump tuyaha 0.0.5 (#30213) 2019-12-26 13:27:59 +01:00
Alan Tse
e58ef36adc Bump teslajsonpy to 0.2.1 (#30217)
Closes #29922
2019-12-26 13:25:49 +01:00
HomeAssistant Azure
169c4089ff [ci skip] Translation update 2019-12-26 00:32:16 +00:00
Ville Skyttä
50a87bbe18 Add Huawei LTE integration suspend and resume services (#30207)
Useful e.g. if accessing the router web interface from another source
such as a web browser is temporarily required.
2019-12-25 12:43:51 +01:00
Ville Skyttä
a5c4508571 Make Huawei LTE notify service name configurable (#30208)
* Default Huawei LTE notify service name to notify.huawei_lte, make configurable

Closes https://github.com/home-assistant/home-assistant/issues/29409

* Set default notify service name for uninvoked options flow
2019-12-25 13:42:28 +02:00
Kevin McCormack
f56797e413 Update Vivotek camera component (#30191)
- Bump libpyvivotek version to 0.4.0
- Add digest authentication
2019-12-25 11:45:49 +01:00
rhadamantys
89450f405c Add support for enocean window handle FA 10 00 (Hoppe) (#29968)
* Added support for Somfy RTS wireless power socket and
Somfy Temperature Sensore Thermos Wirefree io

* Added code formatting fixes for commit 5faaf9c

* added support for RollerShutterRTSComponent from Somfy

* Added support for RTS roller shutter in set_cover_position

* added support for enocean window handle FA 10 00 (Hoppe)

* removed spaces in empty lines

* removal of rawdata attribute / code style

* isort fix

* PyLint fixes

* Improvements after review suggestions: rename device class to sensor type to avoid ambiguousness

* added import for DEVICE_CLASS_POWER from const.py

* removed window handle unit
2019-12-25 11:41:00 +01:00
Niall Donegan
5e3102b2d6 Pull track position from MPD status (#28579)
* Pull track position from MPD status()

This allows the progress bar to work when using the media-control card in lovelace.

* Actually commit flake8 fix!

* Extra documentation.

Mainly to trigger CI rerun.

* Updated to use self._media_position
2019-12-25 11:09:03 +01:00
Josef Schlehofer
217b974cef Upgrade youtube_dl to 2019.12.25 (#30203) 2019-12-25 10:18:10 +01:00
HomeAssistant Azure
bb35d93fde [ci skip] Translation update 2019-12-25 00:32:06 +00:00
ochlocracy
25f78dd1a9 Implement EqualizerController in Alexa for media_player. (#30159) 2019-12-24 17:06:39 -05:00
springstan
4ea42c2479 Bump datapoint to 0.9.5 (#30185) 2019-12-24 12:00:32 -07:00
springstan
482ff4061e Bump importlib-metadata to 1.3.0 (#30196)
* Bump importlib-metadata to 1.3.0

* Include setup.py and package_constraints.txt
2019-12-24 12:00:05 -07:00
Tim Rightnour
f32eaa2fdd Add onewire devices and owserver remote host support (#29948)
* Add support for HobbyBoards sensors: Hub, Humidity, Moisture, PulseCounter
Add support for an owserver running on a remote host

* Cleanup and fixes for style/etc

* Forgot to convert to f-strings.

* Update with changes requested by @MartinHjelmare

* Pylint

* Fix to None

* Reverse logic for hobbyboard test to eliminate pylint complaint

* Modified manifest to list myself as codeowner

* Move some functions down into OneWireProxy instead of the top OneWire

* Oops, missed some decode()'s

* And another!
2019-12-24 14:41:29 +01:00
Quentame
2113d65c06 Fix AdGuard Home safe search sensor name (#30171)
* Fix AdGuard Home safe search sensor name

* Fix typo
2019-12-24 14:14:58 +01:00
Fabian Affolter
783672d305 Upgrade zeroconf to 0.24.3 (#30187) 2019-12-24 14:11:01 +01:00
HomeAssistant Azure
8add6c5f2e [ci skip] Translation update 2019-12-24 00:32:12 +00:00
David F. Mulcahey
85d2ba047b Protect against bad data stored in ZHA (#30183) 2019-12-23 19:11:35 -05:00
Alan Tse
3aa2ae1700 Enable config flow for Tesla (#28744)
* build: bump teslajsonpy to 0.2.0

* Remove tests

* feat: add config flow

* feat: add async

* perf: convert unnecessary async calls to sync

* feat: add charger voltage and current sensor

* feat: add options flow

* build: bump teslajsonpy to 0.2.0

* Remove icon property

* Revert climate mode change

* Remove charger sensor

* Simplify async_setup_platform

* Update homeassistant/components/tesla/sensor.py

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

* Update homeassistant/components/tesla/binary_sensor.py

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

* Address requested changes

* Fix pylint error

* Address requested changes

* Update codeowners

* Fix pylint error

* Address requested changes

* Address requested change

* Remove unnecessary check for existing config entry

* Load scan_interval in async_setup_entry

* Include coverage of config_flow

* Add tests for full coverage

* Address requested test changes

* Remove unnecessary init lines

* Remove unnecessary init

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2019-12-23 21:54:25 +01:00
Claudio Heckler
edce497a0d New date_time_utc display option added to the time_date sensor platform (#30158) 2019-12-23 21:48:24 +01:00
P-Verbrugge
059e8722b6 Updated formatting of total_blocks value (#30170)
The number of total blocks is always a round number. There can't be .1 or .11 blocks for example. The output is now always formatted with two decimals that are always 00.
2019-12-23 21:42:44 +01:00
Greg
f23cc16660 Upgrade envoy_reader to 0.11.0 (#30179) 2019-12-23 21:35:54 +01:00
Quentame
f72ba0c716 Add icons to Freebox sensors (#30132) 2019-12-23 09:37:41 -07:00
springstan
4c5801ee8c Add cast to state of Dyson Air Quality Sensor (#30100) 2019-12-23 09:34:57 -07:00
Quentame
e3a3964911 Add icon to Plex sensor (#30172) 2019-12-23 09:25:57 -07:00
ochlocracy
a2678b2aff Add support for input_number entities in Alexa integration (#30139)
* Add support for input_number entities

* Update homeassistant/components/alexa/capabilities.py

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

* Removed get methods to directly access required attributes dicts.

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2019-12-23 15:17:37 +01:00
Paulus Schoutsen
7f2921b0e6 Merge remote-tracking branch 'origin/master' into merge-master 2019-12-22 23:42:46 +01:00
Paulus Schoutsen
48d35a4550 Merge pull request #30154 from home-assistant/rc
0.103.4
2019-12-22 23:41:22 +01:00
Robert Svensson
31b17e2b95 Allow battery value of 0 as well as make sure to not create a battery tracker if one already exist (#30155) 2019-12-22 22:58:36 +01:00
Robert Svensson
e9dc404de1 Allow battery value of 0 as well as make sure to not create a battery tracker if one already exist (#30155) 2019-12-22 22:58:22 +01:00
Paulus Schoutsen
720d63f496 Bumped version to 0.103.4 2019-12-22 22:34:57 +01:00
Franck Nijhof
e9b19e0465 Fix deconz SSDP updating Hassio discovery (#30153) 2019-12-22 22:34:14 +01:00
springstan
e74c4c5d99 Move imports into setup function in homekit __init__.py (#30137) 2019-12-22 22:25:27 +01:00
Paulus Schoutsen
697833bc91 Remove requirement from entity integration (#30113) 2019-12-22 22:25:03 +01:00
Franck Nijhof
d101d4449f Fix deconz SSDP updating Hassio discovery (#30153) 2019-12-22 22:24:18 +01:00
Alexei Chetroi
fdaaabf070 ZHA binary_sensor cleanup. (#30149) 2019-12-22 14:07:49 -05:00
cgtobi
d4ff214fce Clean up scaffold (#30135) 2019-12-22 19:53:03 +01:00
Franck Nijhof
b1bb2298e0 Bump sqlalchemy to 1.3.12 (#30142) 2019-12-22 19:52:39 +01:00
Ville Skyttä
868eb3c735 More helpers type improvements (#30145) 2019-12-22 19:51:39 +01:00
Philipp Danner
70f8bfbd4f Update Integration of Keba charging station (#30125)
* fixed parsing of current to float in service set_current

* Added optional name in the config file in order to get a better entety naming (easier to find)

* fix parsing of all parameters to service calls

* addressed code review comments + updated pypi dependency

* config name imported from cont.py + minor naming changes to be more clear about the meaning of a sensor

* removed name in config again, use product name gathered from the charging station instead

* implemented suggested changes

* changed variable naming as requested
2019-12-22 19:46:53 +01:00
Alexei Chetroi
83768be814 Refactor ZHA binary_sensor (#30138)
* Refactor ZHA binary_sensor.

Use ZHA entity class registry for channel specific implementations.

* Remove registries.BINARY_SENSOR_TYPES dict.

* Address PR comments.
2019-12-22 13:24:57 -05:00
Fabian Affolter
ed0ee3100d Upgrade zeroconf to 0.24.2 (#30140) 2019-12-22 12:01:22 +01:00
Paulus Schoutsen
32aae7017e Remove requirement from entity integration (#30113) 2019-12-22 10:32:42 +01:00
Paulus Schoutsen
63a843c19c Fix test 2019-12-22 10:31:23 +01:00
springstan
251808874f Move imports into setup function in homekit __init__.py (#30137) 2019-12-22 10:23:44 +01:00
Alexei Chetroi
9c23c4adf2 Cleanup ZHAEntity class (#30131)
Remove `_domain` attribute since we're not using it anymore.
2019-12-21 18:33:00 -05:00
Alexei Chetroi
8e3dfbd5c9 Refactor ZHA electrical measurement sensor. (#30130) 2019-12-21 17:15:50 -05:00
Paulus Schoutsen
834929a14e Clean up mobile app webhooks (#30123) 2019-12-21 22:45:06 +01:00
Alexei Chetroi
fb3bb8220b Implement ZHA entity classes registry (#30108)
* ZHA Entity registry.
Match a zha_device and channels to a ZHA entity.

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

* Add core config entry tests for new rediscover step

* Add tests for homekit_controller implementation of async_step_rediscover

* Rename rediscover to unignore

* Comment the new ignore/unignore mechanisms
2019-12-21 11:22:07 +01:00
Maikel Punie
3911f24f75 Upgrade python-velbus (#30110) 2019-12-21 11:20:31 +01:00
Vladimír Záhradník
0fc92928a4 Add device class attribute to modbus sensors (#30030) 2019-12-21 10:54:48 +01:00
Ville Skyttä
6604680793 Helpers type hint improvements (#30106) 2019-12-21 09:23:48 +02:00
Ville Skyttä
ecdc1adf90 Upgrade mypy to 0.761 (#30104)
https://mypy-lang.blogspot.com/2019/12/mypy-0760-released.html
https://github.com/python/mypy/releases/tag/v0.761
2019-12-20 22:35:02 +01:00
Bas Nijholt
de94afd090 add --show-diff-on-failure to pre-commit (#30097)
This makes the traceback on a failing CI pipeline much more useful.
2019-12-20 22:00:31 +01:00
Jc2k
4ef04840e9 Don't error on removal of an ignored homekit_controller config entry (#30083)
* Don't error on ignored entries

* Don't ever call async_remove_entry or async_unload_entry for an unignored ignore config entry
2019-12-20 21:49:07 +01:00
Paulus Schoutsen
3e7699b886 Merge pull request #30096 from home-assistant/rc
0.103.3
2019-12-20 21:28:49 +01:00
Paulus Schoutsen
d448ed9f6d Bump ring to 0.2.5 (#30103) 2019-12-20 20:44:46 +01:00
springstan
f229cf2796 Bump starlingbank to 3.2 (#30098) 2019-12-20 20:44:46 +01:00
Paulus Schoutsen
b3098c9f2c Bump ring to 0.2.5 (#30103) 2019-12-20 20:42:13 +01:00
springstan
27f35f86ad Bump starlingbank to 3.2 (#30098) 2019-12-20 20:29:12 +01:00
ochlocracy
0faca57e8b Explicitly include Alexa interface for image_processing entities. (#30101) 2019-12-20 20:28:23 +01:00
gppanayotov
84e1b3d07f Add an open window sensor for heating zones (#30090) 2019-12-20 19:02:46 +01:00
Pascal Vizeli
5def51835e Fix v2 2019-12-20 17:10:04 +00:00
Pascal Vizeli
12f1a322a7 Fix test 2019-12-20 16:20:10 +00:00
Fazli Sapuan
488f26d55b Fix homekit handling of 0 light brightness and fan speed (#29962)
* Fix homekit handling of 0 light brightness and fan speed

* Update homekit tests for new initial brightness/speed value
2019-12-20 16:08:08 +00:00
Wim Haanstra
20a0557be7 Fix failure in transform method (#30023)
* Fix failure in transform method

* Fix formatting issue
2019-12-20 16:07:07 +00:00
omriasta
e58291015c Patch rachio (#30031)
* fix binary sensor offline/online

fixed self._handle_update on line 66 to produce args, kwargs.
Updated the binary sensor to check the correct index in the tuple.

* Fixed Standby switch

Set standby switch to poll in order to get status when homeassistant starts up.
Updated the index for the switch to get the status from the tuple.
2019-12-20 16:05:28 +00:00
Pascal Vizeli
e6a27983d3 Bump version 0.103.3 2019-12-20 14:16:39 +00:00
Franck Nijhof
939ca63cbc Fix update port and api key on deconz discovery config entry u… (#30088)
* Fix update port and api key on discovery config entry update

* Remove coroutine from _update_entry
2019-12-20 14:15:45 +00:00
Michaël Arnauts
04b5d6c697 Rework tado component (#29246)
* Fix imports so it works in custom_components

* Rework tado component

* Code cleanup

* Remove water_heater

* Address pylint warnings

* Remove water_heater from components

* Raise PlatformNotReady when we couldn't connect

* Revert PlatformNotReady since we are not a platform

* Add debugging information

* Add fallback setting

* Import with relative path

* Address race condition

* Cleanup

* Catch 422 Errors and log the real error

* Use async_schedule_update_ha_state to update the entities

* Forgot the True
2019-12-20 13:24:43 +01:00
Fazli Sapuan
92fd3e3ad5 Fix homekit handling of 0 light brightness and fan speed (#29962)
* Fix homekit handling of 0 light brightness and fan speed

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

* Remove coroutine from _update_entry
2019-12-20 10:29:18 +01:00
HomeAssistant Azure
3a610edb78 [ci skip] Translation update 2019-12-20 00:32:22 +00:00
Ville Skyttä
d236a19139 Include all SSDP data in discovery info (#28197)
* Include all SSDP data in discovery info

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

* Clean up attribute names

* Adapt existing SSDP flows to changed attribute names

* Prefix all SSDP UPnP attribute name constants with ATTR_UPNP, tweak a bit
2019-12-19 19:28:03 +02:00
springstan
0cb468d7b0 Make name of nmbs live sensor customizable via unique_id (#29662)
* Make name customizable for nmbs live sensors

* Change order of the live name

* Added unique id to live nmbs sensor

* Revert changing the name of the live sensor
2019-12-19 17:45:52 +01:00
Maciej Bieniek
80be3b74a9 Init entities as unavailable when offline (#29738) 2019-12-19 14:10:27 +01:00
Paulus Schoutsen
52818bdb89 Make Hassfest stricter pt 2 (#30068)
* Make Hassfest stricter

* Fix if-condition

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

* Comment fixes in Tests.

* Reorder imports.

* Added additional tests for more code coverage.

* Added and additional test for more code coverage.

* Explicitly return None for configuration() if not instance of AlexaCapabilityResource.
2019-12-19 12:44:17 +01:00
Yuchen Ying
9804fbb527 Add unit_of_measurement to various Transmission sensors (#30037)
* Add unit_of_measurement to various Transmission sensors 

Without unit_of_measurement, the history graph card will not show those sensors as line chart.

* Change Counts to Torrents.
2019-12-19 11:23:46 +01:00
Paulus Schoutsen
e0d6810134 Remove stream from camera after deps (#30057) 2019-12-19 11:23:19 +01:00
Jc2k
c3144eddbb Set unique id on homekit_controller config entries (#30035)
* Set unique id on config entries

* Changes from review
2019-12-19 09:45:22 +01:00
Aaron Bach
9e5de1a106 Guard against future unknown SimpliSafe entity types (#30059)
* Guard against future unknown SimpliSafe entity types

* Updated log message
2019-12-18 17:52:56 -07:00
HomeAssistant Azure
5ea4ba6a2e [ci skip] Translation update 2019-12-19 00:32:16 +00:00
Paulus Schoutsen
f5c7d23b0f Merge remote-tracking branch 'origin/master' into dev 2019-12-18 22:18:35 +01:00
Wim Haanstra
36f7096f09 Fix failure in transform method (#30023)
* Fix failure in transform method

* Fix formatting issue
2019-12-18 13:18:14 -07:00
Alexei Chetroi
41bef4b919 Add timer reload service. (#30015) 2019-12-18 21:15:11 +01:00
Aaron Bach
0adb88156d Bump simplisafe-python to 5.3.6 (#30055) 2019-12-18 21:06:57 +01:00
omriasta
bdef54de0c Patch rachio (#30031)
* fix binary sensor offline/online

fixed self._handle_update on line 66 to produce args, kwargs.
Updated the binary sensor to check the correct index in the tuple.

* Fixed Standby switch

Set standby switch to poll in order to get status when homeassistant starts up.
Updated the index for the switch to get the status from the tuple.
2019-12-18 21:04:54 +01:00
Erik Kastelec
d16011b849 changed Venstar component temperature to half degree accuracy (#30034) 2019-12-18 08:47:01 -05:00
Paulus Schoutsen
9c7caaa142 Add option to ignore flows (#30008) 2019-12-18 07:41:01 +01:00
Greg
feb39c39a3 Update Envoy sensor to configure credentials and grab Inverter Date from updated API (#28837)
* Update manifest.json

Updated sensor to use the latest version of the API to be able to use the new features.

* Updated sensor to use new API features.  Configurable credentials and Inverter last reported date.

* EnvoyReader is passed to Envoy uses async update()

* Fixed pydocstyle warnings

* Fixed merge issue. Had extra variable.

* Added warning message when authentication for Inverter data fails

* Added continue after exception for loop

* Moved if statement outside of try/except

* Removed unneeded boolean attribute
2019-12-18 01:51:19 +01:00
HomeAssistant Azure
0135b988ff [ci skip] Translation update 2019-12-18 00:32:19 +00:00
Fabian Affolter
876195a8a8 Upgrade zeroconf to 0.24.1 (#30028) 2019-12-17 17:00:00 +01:00
Fabian Affolter
31cd0af47a Upgrade matrix-client to 0.3.2 (#30027) 2019-12-17 16:26:36 +01:00
Andre Richter
115aa2e49c Z-Wave: Fibaro FGR*-222: Add venetian blind support (#29701)
The Fibaro FGR-222/FGRM-2222 ZWave roller shutter devices have a proprietary
command class to support setting the tilt angle of venetian blinds (= type of
window cover). This PR adds the support to HA for this. This allows the user to
set the height of the blinds and the tilt angle separately.

Original patch by @ChristianKuehnel #24405.
2019-12-17 09:26:19 -05:00
Robert Van Gorkom
78e831b08e Make tplink light more responsive (#28652)
* Making tplink light more responsive.

* Adding light platform tests.

* Addressing PR feedback.

* Mocking the module, not the api.

* Using sync method for background update.
2019-12-17 02:24:50 +01:00
HomeAssistant Azure
ad8278c078 [ci skip] Translation update 2019-12-17 00:32:23 +00:00
Franck Nijhof
0439d6964c Fix persistent setup error notification content (#29995)
* Fix persistent setup error notification content

* Use documentation from manifest, enriched error messages

* Fix issue caught by mypy
2019-12-16 20:16:23 +01:00
Vladimír Záhradník
c16fae2c0b Fix modbus service description (#30005) 2019-12-16 20:07:46 +01:00
Paulus Schoutsen
58b5833d64 Convert Hue to use unique ID (#30000)
* Convert Hue to use unique ID

* Fix normalization

* Store/restore unique ID

* Fix tests
2019-12-16 19:45:09 +01:00
zewelor
575eb48feb Show current effect in yeelight device (#28975)
* Show current effect in yeelight device

* Use device_state_attributes instead of state_attributes

* Add early return in set effect

* Make single if elif chain

* Fix if elif

* Fix if elif
2019-12-16 16:23:05 +01:00
Paulus Schoutsen
d851cb6f9e Add unique ID to config entries (#29806)
* Add unique ID to config entries

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

* Remove unused exception

* Fix typing

* silence pylint

* Fix tests

* Add unique ID to Hue

* Address typing comment

* Tweaks to comments

* lint
2019-12-16 12:27:43 +01:00
Franck Nijhof
87ca61ddd7 Add check-json to CI and Pre-commit (#29912)
* Add check-json to CI and Pre-commit

* Add ignore pre-commit hooks to gen_requirements_all
2019-12-16 11:06:16 +01:00
Franck Nijhof
d1e59b20c8 Bump pytest to 5.3.2 (#29990) 2019-12-16 10:59:32 +01:00
Franck Nijhof
dd0f0034f3 Bump shodan to 1.21.0 (#29991) 2019-12-16 10:57:42 +01:00
Emacee
be042f3d91 Update binary_sensor.py (#29977)
Change sensor type for central locking from safety into lock.
2019-12-16 09:42:48 +01:00
Louis-Dominique Dubeau
33cbb398ad Don't use the locals parameter on exec. (#29979)
Using the locals parameter makes it so that the code of a Python script runs as
if it were in the body of a ``class``. One effect of this is that functions
defined as part of a script cannot call one another directly.

Fixes: #24704, #13653
2019-12-16 09:39:20 +01:00
Paulus Schoutsen
b058742404 Fix condition typo (#29989) 2019-12-16 09:33:11 +01:00
Ryan
3f32490ae6 Fixed "condtion_type" to "condition_type" (#29984)
Fixed "condtion_type" to "condition_type"
2019-12-16 08:41:32 +01:00
Paulus Schoutsen
9e51a18845 Make hassfest import detection better (#29932)
* Make hassfest import detection better

* Fix tests
2019-12-16 08:22:20 +01:00
Jeff Irion
8fe17c0933 Remove 'SUPPORT_PLAY_MEDIA' from Volumio (#29969) 2019-12-16 08:21:29 +01:00
Kevin Eifinger
fc01da8933 Migrate to api_key (#29966) 2019-12-16 08:20:41 +01:00
Joakim Plate
039cc98278 Support case of unknown/unavailable temperature/humidity (#29959)
* Support case of unknown/unavailable temperature/humidity

State is never None, just a string.

* Lint suggestion
2019-12-16 08:04:59 +01:00
Ville Skyttä
445fd15f76 Drop Python 3.6 support (#29978) 2019-12-16 07:29:19 +01:00
Andrew Onyshchuk
bfafa77016 Fix support for legacy Z-Wave thermostats (#29955)
This brings back support for Z-Wave thermostats
of SETPOINT_THERMOSTAT specific device class.
Such devices don't have COMMAND_CLASS_THERMOSTAT_MODE
and are now handled separately.
2019-12-15 20:02:18 -05:00
HomeAssistant Azure
95a6a7502a [ci skip] Translation update 2019-12-16 00:32:25 +00:00
Ville Skyttä
d6f317c0a9 Remove deprecated rflink configs (#29972)
They've been deprecated and automatically replaced since July 2017
already, fe6a4b8ae5
2019-12-15 22:57:23 +02:00
Aaron Godfrey
012c09ce00 Fix example value for Todoist service (#29953) 2019-12-15 18:47:11 +01:00
Fabian Affolter
9c0799eb0a Upgrade keyring to 20.0.0 and keyrings.alt to 3.4.0 (#29960) 2019-12-15 17:41:56 +01:00
Chris Caron
09f3362cc6 isort fix on test_media_player (#29965) 2019-12-15 16:07:57 +01:00
Joakim Plate
84a7115435 Start of using hass state for tests rather than direct object (#29377) 2019-12-15 13:14:50 +01:00
Jeff Irion
8a5bce81c8 Bump adb-shell to 0.1.0 and androidtv to 0.0.36 (#29938)
* Bump adb-shell to 0.1.0 and androidtv to 0.0.36

* Add test for setting up two devices

* Add test_setup_same_device_twice

* Fix test_setup_two_devices

* Fix coverage

* Coverage

* Fix flaky 'test_setup_two_devices'

* Another stab at coverage

* Rename 'address' back to 'host'
2019-12-15 11:31:59 +01:00
Tyler
a28545b69b bump venstar 0.12 (#29954)
* bump venstar 0.12

* Update manifest.json
2019-12-15 08:16:20 +01:00
Chris Mandich
6dd496deb4 Fix loading flume integration (#29926)
* Fix https://github.com/home-assistant/home-assistant/issues/29853

* Run script.gen_requirements

* Update to store Token File in config directory

* Update to store Token File in config directory

* Update to store Token File in config directory
2019-12-15 03:45:29 +01:00
Quentame
820780996a Add battery sensor to iCloud (#29818)
* Add battery sensor to iCloud

* Update .coveragerc

* Review: @balloob & @MartinHjelmare

* Review: use f string
2019-12-14 23:06:00 +01:00
Raman Gupta
003658a3f0 Update androidtv version to improve source selection support (#29579)
* Change androidtv module versions and add support for select_source for all device types

* Update and add tests

* Update requirements_test_all.txt

* Update requirements_all.txt

* Consolidate tests

* Fix typo

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

* Removed references to PR #28218 not yet merged into dev.

* Update tests to include Alexa Interface

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

* Fixed Unnecessary "elif" after "return"
2019-12-14 08:47:45 +01:00
DjMoren
3c86825e25 Update Tahoma component's tahoma-api requirement's version (#29918) 2019-12-14 08:00:19 +01:00
Anders Melchiorsen
2cb92c66ef Support entity_id: all in lifx.set_state (#29919) 2019-12-14 07:36:33 +01:00
Justin Bassett
114390c95e Fix mobile app device identifiers (#29920)
Fix identifiers when updating device registration.
2019-12-14 07:36:12 +01:00
HomeAssistant Azure
8f5a00a98b [ci skip] Translation update 2019-12-14 00:32:08 +00:00
Paulus Schoutsen
a470a72ec5 Add integration platform helper (#29914) 2019-12-13 15:38:41 +01:00
springstan
6b3260357f Fix setup error for logbook (#29908)
* Fix setup error by moving an import back into the setup function

* Revert c741664d4d

* Add homekit as after_dependency to logbook manifest.json
2019-12-13 14:08:30 +01:00
Franck Nijhof
c8cc8acc81 Fixes invalid JSON syntax in devcontainer (#29911) 2019-12-13 12:41:56 +01:00
Franck Nijhof
b91a8f510c Fix incorrect file format yr test fixure (#29910) 2019-12-13 12:29:24 +01:00
Fabian Affolter
1301a4fcc6 Upgrade Sphinx to 2.2.2 and sphinx-autodoc-typehintsi to 1.10.3 (#29906) 2019-12-13 11:15:26 +01:00
Ville Skyttä
4d57de335c Make Python deprecation notice easier to maintain (#29900) 2019-12-13 10:39:57 +01:00
springstan
9fbb6d981a Fix setup for tank_utility component (#29902) 2019-12-13 10:31:53 +01:00
Bas Nijholt
c59bf0bff6 genericpath is an internal Python module and shouldn't be imported according to core Python devs. (see [this](https://bugs.python.org/msg358136) comment) (#29903)
For a reason unknown to me, @exxamalte introduced this in https://github.com/home-assistant/home-assistant/pull/14342.

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

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

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

- ca0fad2cbb
- f5d4878992
- 7d68e88d31
- 1fee400dcd

This supersedes https://github.com/home-assistant/home-assistant/pull/29893.
2019-12-13 09:47:09 +01:00
HomeAssistant Azure
5b32ee566c [ci skip] Translation update 2019-12-13 00:32:17 +00:00
Sebastian Muszynski
c051ae0bfb Bump python-miio version to 0.4.8 (#29890) 2019-12-12 22:39:11 +01:00
Alexei Chetroi
7685c76b9b Defer log formatting. (#29888) 2019-12-12 14:16:02 -05:00
randellhodges
9d662d6114 ISY994 Node Filter Update (#28155)
* Adding filters for keypad dimmers and smoke sensor

* ran black --fast as suggested

* Adding filters for keypad dimmers and smoke sensor

* ran black --fast as suggested
2019-12-12 19:47:38 +01:00
John Luetke
7c42f4b45b (Re)Add support for multiple Pi-Holes (#27569)
* Update configuration schema to support multiple Pi-holes

* Construct sensors for each configured Pi-hole

* Ensure each Pi-hole has a unique name

* Update services to handle multiple Pi-holes

* Update tests for multiple configurations

* Refactor tests to support service testing

* Fix else-raise per pyliunt

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

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

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

* Per code review, move name validation to schema

* Remove default name

* Per code review, validate api_key in schema definition

* Per code review, rename variables

* Per code review, use list comprehension

* Ensure unique slug names in config validation

* Per code review, refactor to CoroutineMock

* Fix adding sensor entities

* Per code review, refactor mock function creation

* Per code review, refactor mock function return values
2019-12-12 19:43:49 +01:00
Alexei Chetroi
327b5c3c94 Log ZHA bind/unbind operations status (#29842)
* Log bind/unbind operation result.
* Use ZDO consts.
* Use device logger for bind/unbind results.
* Lint.
2019-12-12 12:16:51 -05:00
Alexei Chetroi
1fee400dcd Revert "Sort import for tests/components/feedreader/test_init.… (#29882)
This reverts commit 7d68e88d31.
2019-12-12 17:10:43 +01:00
Ville Skyttä
130571c478 Remove no longer needed auth.util, use secrets instead (#29861) 2019-12-12 16:46:33 +01:00
Bas Nijholt
c58c10ab7c Add isort to CI and pre-commit (#29739)
* add isort to CI and pre-commit

* disable wrong-import-order in pylintrc

* ✏️ Tweak


Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2019-12-12 15:58:47 +01:00
Bas Nijholt
7d68e88d31 Sort import for tests/components/feedreader/test_init.py (#29878)
This unblocks https://github.com/home-assistant/home-assistant/pull/29739
2019-12-12 15:56:32 +01:00
Franck Nijhof
4b33578757 Fix package import sort on dwd_weather_warnings (#29874) 2019-12-12 14:45:00 +01:00
Aaron Bach
914b49566a Bump aioambient to 1.0.2 (#29850) 2019-12-12 10:24:57 +01:00
Ville Skyttä
7931a0b675 Use Bionic's ffmpeg on Travis, jonathonf/ffmpeg-4 is N/A at the moment (#29860) 2019-12-12 07:15:32 +01:00
Paulus Schoutsen
b9eb831d29 Revert Tahoma removal (#29840)
* Revert "Remove Tahoma component #29744 (#29745)"

This reverts commit df74272ba6.

* Revert "Cleanup removed component (#29788)"

This reverts commit 3a28361beb.
2019-12-12 06:37:55 +01:00
HomeAssistant Azure
7bd98d1082 [ci skip] Translation update 2019-12-12 00:32:15 +00:00
foxy82
a08e3d7352 Update rfxtrx component so it can be run as a custom_component (#29638)
* Updating rfxtrx component so it can be run as a custom_component

* Fix pylint errors

* Fix pylint errors

* Fix pylint error on dict.

* isort
2019-12-11 15:58:49 +01:00
Robert Svensson
856dd63680 Add more logging to help future debug situations (#29800) 2019-12-11 15:45:21 +01:00
springstan
7b8dff2aa9 Add user-agent to fix dwd_weather_warnings setup error (#29596)
* Added dummy user-agent to http request to fix setup error

* Replace dummy user-agent with the user-agent of the global home assistant session

* Adjust comment and rename user-agent constant
2019-12-11 15:43:54 +01:00
Pascal Vizeli
0c796fc3c3 Remove uvloop event policy (#29835)
* Remove uvloop event policy

* Clean tests

* Fix lint

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

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

* Trying to please the linter
2019-12-11 13:27:28 +01:00
Bas Nijholt
004af97699 Sort imports for requirements.py and its test using isort (#29836)
Unblocks https://github.com/home-assistant/home-assistant/pull/29739
2019-12-11 12:12:06 +01:00
HomeAssistant Azure
c2357d843b [ci skip] Translation update 2019-12-11 00:32:21 +00:00
Ville Skyttä
a12cf7211d Upgrade pydocstyle to 5.0.1 (#29830)
* Upgrade pydocstyle to 5.0.1

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

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

* Fixing formatting.

* Sorting imports to get black checks to pass.

* Using lambda for getting latest sleep serie.
2019-12-10 21:54:50 +01:00
Ville Skyttä
899f6cf1a3 Re-authorize Huawei LTE on login required error (#29597)
* Re-authorize Huawei LTE on login required error

Closes https://github.com/home-assistant/home-assistant/issues/29531

* Eliminate one indented "else" block

* Convert get_data from inline to instance method

* Use .get instead of [] for checking subscriptions for clarity
2019-12-10 22:41:29 +02:00
Robert Svensson
99328bd4c1 UniFi - honor detection time when UniFi wire bug happens (#29820) 2019-12-10 20:05:18 +01:00
Robert Svensson
47e5142ddb UniFi - Handle disabled switches (#29824) 2019-12-10 20:04:48 +01:00
proferabg
e28fd16c84 Fix tank utility token (#29801)
* Tank Utility Token Fix

Fix 400 Bad Request on Invalid Token

* Format Fix for Pull Request #29801

* Pylint Annotation Fix for Pull Request #29801
2019-12-10 19:25:21 +01:00
Robert Svensson
db0baab692 Only update disabled_by when enabled default and entity enabled states differ (#29643) 2019-12-10 11:02:26 +01:00
Franck Nijhof
f5d4878992 Fix isort on a small set of misc files (#29803) 2019-12-10 09:25:42 +01:00
Paulus Schoutsen
27244e29c4 Install discovery requirements if used (#29795)
* Install discovery requirements if used

* Update loader.py

* Fix types
2019-12-10 09:24:49 +01:00
Franck Nijhof
0ed6a434f8 Adjusts repository README (#29805) 2019-12-10 09:22:37 +01:00
Ian
4f1f4a1b4f Nextbus: Sort results for upcoming times (#29811)
Sort upcoming times across all direction's for a particular route and
stop.
2019-12-10 09:22:13 +01:00
Brett T. Warden
9049e090f9 Bump Roku to 4.0.0 (#29809) 2019-12-10 09:20:52 +01:00
Alexei Chetroi
315d0064fe Fix zha circular import (#29802)
* Refactor zha.core.helpers.
* Make zha isort-able.
* Const import reorg.
* Keep DATA_ZHA config key on entry unload.
* Cleanup ZHA config flow.
* isort.
* Add test.
2019-12-10 00:00:04 -05:00
HomeAssistant Azure
12f273eb11 [ci skip] Translation update 2019-12-10 00:32:16 +00:00
Franck Nijhof
38a6fffecb Add JSON files validation to hassfest (#29799) 2019-12-09 22:43:38 +01:00
Alexei Chetroi
454cc684e4 Add input_select reload service. (#29647)
* Add input_select reload service.

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

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

* add isort:skip to EVENT_SYNC_RECEIVED
2019-12-09 20:00:14 +01:00
Franck Nijhof
bc3b7ed06b Fix build, invalid JSON file in icloud component (#29798) 2019-12-09 19:18:41 +01:00
Bas Nijholt
e37443f10c Sort imports according to PEP8 for components starting with "U" (#29779)
* use isort to sort imports for components starting with 'u'

* add 'pylint: disable=import-error' to the right place
2019-12-09 19:07:32 +01:00
Bas Nijholt
80c344d3a8 Sort imports according to PEP8 for huawei_lte (#29664) 2019-12-09 19:06:25 +01:00
Bas Nijholt
897522a82d Fix 'pytest.register_assert_rewrite("tests.common")' warning (#29797)
see fea243c035 (r355533273)
2019-12-09 19:04:38 +01:00
Bas Nijholt
080c702d4f Sort imports according to PEP8 for components starting with "C" (#29763) 2019-12-09 18:56:21 +01:00
Bas Nijholt
6cc75fc6f3 Sort imports according to PEP8 for components starting with "Z" (#29784)
* use isort to sort imports for components starting with 'z'

* add skip to end of zha/core/channels/__init__.py

* put 'pylint: disable=import-error' at the right place

* remove the import of config_flow in zha/__init__.py

According to @balloob it is no longer needed.

* revert previous commit

* isort:skip homeassistant/components/zha/__init__.py completely
2019-12-09 18:54:54 +01:00
springstan
6b6570e7ca Move imports to top for ness_alarm (#29518)
* Move imports to top for ness_alarm

* Added patch for the ArminState in alarm_control_panel.py
2019-12-09 18:46:56 +01:00
Bas Nijholt
08f128e9c7 Sort imports according to PEP8 for components starting with "D" (#29764)
* use isort to sort imports for components starting with 'd'

* fix isort mistake
2019-12-09 17:42:00 +01:00
Quentame
c804f8f961 Add config flow to iCloud (#28968)
* iCloud: setup ConfigFlow and prepare for more platforms

- add config flow + tests
- fix existing services
- add play_sound & display_message services
- document services
- can use devices with the same name
- prepare to add sensor platform

* Review : not copy account conf

* Review: Safer test patch

* Review: remove reset_account

* Review: Use executor_job while IO

* Review: Use executor_job while IO 2

* Review: use hass.helpers.storage.Store()

* Review: no IO in tests

* Remove reset from services.yaml

* Review: remove authenticate.return_value = Mock()

* Review: do not initialize the api with the mocked service

* isort

* Review: @MartinHjelmare Test config flow with all steps

* Review: Fix failed tests names

* Codevov: Add one missing test
2019-12-09 17:19:42 +01:00
Bas Nijholt
f60125b5c9 Sort imports according to PEP8 for 'tests' (#29791) 2019-12-09 16:52:24 +01:00
Bas Nijholt
67c56c860d Sort imports according to PEP8 for 'homeassistant' folder (#29789)
Components are already done
2019-12-09 16:42:10 +01:00
Bas Nijholt
29ec17d50d use isort to sort imports for "setup.py" (#29792) 2019-12-09 16:30:16 +01:00
Bas Nijholt
5cb6d1b21f Sort imports according to PEP8 for 'script' folder (#29790) 2019-12-09 16:24:03 +01:00
Pascal Vizeli
3a28361beb Cleanup removed component (#29788) 2019-12-09 16:21:12 +01:00
springstan
72f336a2dd Move imports to top for homekit (#29560)
* Move imports to top for homekit

* Moved back a couple imports, added annotation to disable import-outside-toplevel

* Fix all tests in test_homekit.py
2019-12-09 16:10:02 +01:00
Bram Kragten
bb3fa6990a Updated frontend to 20191204.1 (#29787) 2019-12-09 15:10:03 +01:00
Bas Nijholt
96a6a44411 Sort imports according to PEP8 for components starting with "X" (#29782) 2019-12-09 14:58:51 +01:00
Bas Nijholt
9bcd4653e0 Sort imports according to PEP8 for components starting with "Y" (#29783) 2019-12-09 14:57:42 +01:00
Bas Nijholt
4035fda659 Sort imports according to PEP8 for components starting with "Q" (#29785) 2019-12-09 14:56:20 +01:00
Bas Nijholt
fbf1836997 Sort imports according to PEP8 for components starting with "W" (#29781) 2019-12-09 14:47:53 +01:00
Bas Nijholt
1ab1808307 Sort imports according to PEP8 for components starting with "N" (#29773) 2019-12-09 14:46:24 +01:00
Bas Nijholt
ee1cc3b3dd Sort imports according to PEP8 for components starting with "V" (#29780) 2019-12-09 14:42:53 +01:00
Bas Nijholt
de915e1bf0 Sort imports according to PEP8 for components starting with "T" (#29778) 2019-12-09 14:41:48 +01:00
Bas Nijholt
485761bbaf Sort imports according to PEP8 for components starting with "R" (#29776) 2019-12-09 14:39:51 +01:00
Bas Nijholt
23b92b2a56 Sort imports according to PEP8 for components starting with "S" (#29777) 2019-12-09 14:38:01 +01:00
Bas Nijholt
21816eeed4 Sort imports according to PEP8 for components starting with "P" (#29775) 2019-12-09 14:29:39 +01:00
Bas Nijholt
5cdaff5405 Sort imports according to PEP8 for components starting with "O" (#29774) 2019-12-09 14:26:53 +01:00
Bas Nijholt
c49e423c78 Sort imports according to PEP8 for components starting with "K" (#29770) 2019-12-09 14:25:18 +01:00
Bas Nijholt
1dea0c9e34 Sort imports according to PEP8 for components starting with "L" (#29771) 2019-12-09 14:22:30 +01:00
Bas Nijholt
14779ce3d0 Sort imports according to PEP8 for components starting with "I" (#29769) 2019-12-09 14:21:24 +01:00
Bas Nijholt
710680d604 use isort to sort imports for components starting with 'm' (#29772) 2019-12-09 18:50:40 +05:30
Bas Nijholt
8b39957c56 Sort imports according to PEP8 for components starting with "H" (#29768) 2019-12-09 14:19:48 +01:00
Bas Nijholt
d58e6e924a Sort imports according to PEP8 for components starting with "G" (#29767) 2019-12-09 14:17:36 +01:00
Bas Nijholt
ca0fad2cbb Sort imports according to PEP8 for components starting with "F" (#29766) 2019-12-09 14:14:40 +01:00
Bas Nijholt
f9e06ca2fd Sort imports according to PEP8 for components starting with "E" (#29765) 2019-12-09 14:10:04 +01:00
Bas Nijholt
96961b9bcc Sort imports according to PEP8 for components starting with "A" (#29761) 2019-12-09 13:57:24 +01:00
Bas Nijholt
73de69896b Sort imports according to PEP8 for components starting with "B" (#29762) 2019-12-09 13:52:18 +01:00
tetienne
df74272ba6 Remove Tahoma component #29744 (#29745) 2019-12-09 13:35:14 +01:00
Pascal Vizeli
4bb670cdf7 HomeAssistant-pyozw 0.1.7 (#29743) 2019-12-09 13:33:28 +01:00
Bas Nijholt
9b27e5b86c Sort imports according to PEP8 for vultr (#29760) 2019-12-09 13:33:08 +01:00
Bas Nijholt
c7cf1b820c Sort imports according to PEP8 for hue (#29757) 2019-12-09 13:25:04 +01:00
Bas Nijholt
abfcc18004 Sort imports according to PEP8 for mobile_app (#29758) 2019-12-09 13:22:42 +01:00
Bas Nijholt
53012a548b Sort imports according to PEP8 for sleepiq (#29759) 2019-12-09 13:21:45 +01:00
Bas Nijholt
60e1789557 Sort imports according to PEP8 for emulated_roku (#29756) 2019-12-09 13:20:51 +01:00
Bas Nijholt
991834f337 Sort imports according to PEP8 for shopping_list (#29751) 2019-12-09 13:14:49 +01:00
Bas Nijholt
d1b38c0c79 Sort imports according to PEP8 for plaato (#29747) 2019-12-09 13:14:08 +01:00
Bas Nijholt
f281069c8c Sort imports according to PEP8 for vicare (#29754) 2019-12-09 13:13:33 +01:00
Bas Nijholt
76debf4c88 Sort imports according to PEP8 for scene (#29750) 2019-12-09 13:12:43 +01:00
Bas Nijholt
127d84edd1 Sort imports according to PEP8 for solarlog (#29752) 2019-12-09 13:11:37 +01:00
Bas Nijholt
3f469eac28 Sort imports according to PEP8 for yeelight (#29755) 2019-12-09 13:10:24 +01:00
Bas Nijholt
f81e608cc1 Sort imports according to PEP8 for remote (#29749) 2019-12-09 13:09:16 +01:00
Bas Nijholt
c4a6f265e8 Sort imports according to PEP8 for versasense (#29753) 2019-12-09 13:08:05 +01:00
Bas Nijholt
e9b428781b Sort imports according to PEP8 for pushbullet (#29748) 2019-12-09 13:06:25 +01:00
Bas Nijholt
3df40c7a16 Sort imports according to PEP8 for websocket_api (#29657) 2019-12-09 12:30:23 +01:00
Bas Nijholt
16a7408f23 Sort imports according to PEP8 for zwave (#29658) 2019-12-09 12:29:12 +01:00
Bas Nijholt
41cd678f00 Sort imports according to PEP8 for deconz (#29659) 2019-12-09 12:25:35 +01:00
Bas Nijholt
2da3848f89 Sort imports according to PEP8 for unifi (#29656) 2019-12-09 12:19:33 +01:00
Bas Nijholt
3b0f29fe95 sort imports according to PEP8 for lock (#29663) 2019-12-09 12:19:11 +01:00
Bas Nijholt
eb47c2b148 Sort imports according to PEP8 for media_player (#29665) 2019-12-09 12:17:41 +01:00
Bas Nijholt
01d651c67d Sort imports according to PEP8 for device_tracker (#29666) 2019-12-09 12:14:38 +01:00
Bas Nijholt
27bd6ca1db Sort imports according to PEP8 for emulated_hue (#29667) 2019-12-09 12:12:41 +01:00
Bas Nijholt
05daa817f5 Sort imports according to PEP8 for owntracks (#29672) 2019-12-09 12:11:27 +01:00
Bas Nijholt
d62993c5af Sort imports according to PEP8 for pilight (#29673) 2019-12-09 12:10:38 +01:00
Bas Nijholt
04225ba802 Sort imports according to PEP8 for rest (#29674) 2019-12-09 12:09:49 +01:00
Bas Nijholt
186799794d Sort imports according to PEP8 for nest (#29670) 2019-12-09 12:08:51 +01:00
Bas Nijholt
ad58e607df Sort imports according to PEP8 for somfy (#29675) 2019-12-09 12:07:10 +01:00
Bas Nijholt
69b113c539 Sort imports according to PEP8 for dyson (#29678) 2019-12-09 12:04:39 +01:00
Bas Nijholt
3d10bb3647 Sort imports according to PEP8 for http (#29679) 2019-12-09 11:59:38 +01:00
Bas Nijholt
c7d61279bd Sort imports according to PEP8 for ring (#29680) 2019-12-09 11:58:40 +01:00
Bas Nijholt
df85a50f3b Sort imports according to PEP8 for sensor (#29683) 2019-12-09 11:57:49 +01:00
Bas Nijholt
9cf3ff319e Sort imports according to PEP8 for iaqualink (#29681) 2019-12-09 11:56:51 +01:00
Bas Nijholt
b54c8641b4 Sort imports according to PEP8 for vesync (#29684) 2019-12-09 11:56:02 +01:00
Bas Nijholt
e4e4f78eb0 Sort imports according to PEP8 for utility_meter (#29710) 2019-12-09 11:54:56 +01:00
Bas Nijholt
b6cd6135c2 Sort imports according to PEP8 for wemo (#29685) 2019-12-09 11:53:51 +01:00
Bas Nijholt
776d8cfdc9 Sort imports according to PEP8 for specific_devices (#29687) 2019-12-09 11:51:36 +01:00
Bas Nijholt
c54135486e use isort to sort imports according to PEP8 for netatmo (#29682) 2019-12-09 11:50:59 +01:00
Bas Nijholt
4c5c34919d Sort imports according to PEP8 for camera (#29691) 2019-12-09 11:50:48 +01:00
Bas Nijholt
0b4ca9ecac Sort imports according to PEP8 for ambiclimate (#29689) 2019-12-09 11:49:35 +01:00
Bas Nijholt
bfa58f671a use isort to sort imports according to PEP8 for broadlink (#29690) 2019-12-09 11:48:52 +01:00
Bas Nijholt
9c1236b6de Sort imports according to PEP8 for ffmpeg (#29693) 2019-12-09 11:48:22 +01:00
Bas Nijholt
38657c0055 Sort imports according to PEP8 for counter (#29692) 2019-12-09 11:47:35 +01:00
Bas Nijholt
2261bb60e0 Sort imports according to PEP8 for geofency (#29695) 2019-12-09 11:46:49 +01:00
Bas Nijholt
2511f5edb4 Sort imports according to PEP8 for ifttt (#29696) 2019-12-09 11:46:08 +01:00
Bas Nijholt
fa6b75f2c1 Sort imports according to PEP8 for file (#29694) 2019-12-09 11:45:11 +01:00
Bas Nijholt
a78fe25871 Sort imports according to PEP8 for locative (#29698) 2019-12-09 11:43:46 +01:00
Bas Nijholt
642655b6d7 Sort imports according to PEP8 for met (#29699) 2019-12-09 11:43:00 +01:00
Bas Nijholt
c7b2c09a61 Sort imports according to PEP8 for xiaomi_miio (#29677) 2019-12-09 11:42:18 +01:00
Bas Nijholt
0e71c29e00 Sort imports according to PEP8 for opentherm_gw (#29671) 2019-12-09 11:34:06 +01:00
Bas Nijholt
0fbb450838 Sort imports according to PEP8 for jewish_calendar (#29697)
* use isort to sort imports according to PEP8 for jewish_calendar

* fix order
somehow isort did the wrong thing
2019-12-09 11:30:31 +01:00
springstan
202522fbca Move imports to top for nsw_fuel_station (#29538)
* Move imports to top for nsw_fuel_station

* Correct patch path in test_sensor.py

* Fix tests by removing the unused argument mock_nsw_fuel
2019-12-09 11:29:36 +01:00
Bas Nijholt
425a1814d9 Sort imports according to PEP8 for geonetnz_quakes (#29668) 2019-12-09 11:28:07 +01:00
Bas Nijholt
790881fa7b Sort imports according to PEP8 for almond (#29688) 2019-12-09 11:27:16 +01:00
Bas Nijholt
69f790f6cc Sort imports according to PEP8 for arduino (#29702) 2019-12-09 11:26:03 +01:00
Bas Nijholt
852996700f Sort imports according to PEP8 for arest (#29703) 2019-12-09 11:25:29 +01:00
Bas Nijholt
2cd55bbb87 Sort imports according to PEP8 for device_automation (#29707) 2019-12-09 11:24:49 +01:00
Bas Nijholt
ea39d5b428 Sort imports according to PEP8 for aws (#29704) 2019-12-09 11:23:21 +01:00
Bas Nijholt
f9e9a5e4cb Sort imports according to PEP8 for darksky (#29706) 2019-12-09 11:22:04 +01:00
Bas Nijholt
9228ed7c40 Sort imports according to PEP8 for verisure (#29711) 2019-12-09 11:21:16 +01:00
Bas Nijholt
6a11e6aa72 Sort imports according to PEP8 for soma (#29709) 2019-12-09 11:19:23 +01:00
Bas Nijholt
ebb2722d03 Sort imports according to PEP8 for gpslogger (#29717) 2019-12-09 11:15:02 +01:00
Bas Nijholt
c5316dbc39 Sort imports according to PEP8 for iqvia (#29720) 2019-12-09 11:14:08 +01:00
Bas Nijholt
c3d7ab6a7f Sort imports according to PEP8 for netgear_lte (#29725) 2019-12-09 11:13:37 +01:00
Bas Nijholt
7128396f1a Sort imports according to PEP8 for minio (#29723) 2019-12-09 11:08:29 +01:00
Bas Nijholt
6a67532a2d Sort imports according to PEP8 for linky (#29722) 2019-12-09 11:07:50 +01:00
Bas Nijholt
cbf59fb33d Sort imports according to PEP8 for input_text (#29719) 2019-12-09 11:06:05 +01:00
Bas Nijholt
9df71ecae2 Sort imports according to PEP8 for neato (#29724) 2019-12-09 11:05:22 +01:00
Nikolay Vasilchuk
791dc5809f Fix unit_of_measurement for Starline temperature sensors (#29740) 2019-12-09 10:56:57 +01:00
Santobert
c399fe2837 Change source of device_info (#29570) 2019-12-09 10:46:25 +01:00
Bas Nijholt
d0c7db548f use isort to sort imports according to PEP8 for group (#29713) 2019-12-09 09:39:26 +01:00
Bas Nijholt
1790036767 use isort to sort imports according to PEP8 for zone (#29712) 2019-12-09 09:38:38 +01:00
Bas Nijholt
2abc9005cc use isort to sort imports according to PEP8 for homeassistant (#29718) 2019-12-09 09:38:24 +01:00
Bas Nijholt
236a21c76e Sort imports according to PEP8 for pi_hole (#29726) 2019-12-09 09:38:14 +01:00
Bruno Filipe
942f654d92 Proactively report Alexa Endpoint Health properties (#29736) 2019-12-09 09:37:15 +01:00
Bas Nijholt
8c1a8b502d Sort imports according to PEP8 for velbus (#29676) 2019-12-09 09:36:42 +01:00
gjbadros
6996ad3541 Protect Doorbird platform from failing when individual doorbird fails (#29374)
* Wrap connection attempt by try/except block so an individual downed doorbird does not fail the whole platform

* Fixed lint warning

* Disable too-broad-exception pylint warning since the whole point of this is to catch all exceptions and log them while letting processing continue; I don't disable a lint warning lightly, but this is the entire intent of this PR.

* Fixed name of pylint warning to broad-except

* Use _LOGGER.exception to get the stack trace too, per PEP8 recommendation for a bare Exception being caught.

* per @balloob, switch to just catching OSError on a narrow block; I'm not sure this protects all problems with Doorbird device startup, but it protects against the primary one I experience.
2019-12-09 09:14:55 +01:00
HomeAssistant Azure
8dea7f0f98 [ci skip] Translation update 2019-12-09 00:32:08 +00:00
Bernhard B
d451e54e34 Add Signal Messenger integration (#28537)
* added signalmessenger integration

* allows to send a message (with an attachment) to one or more
  recipients

* added signalmessenger documentation to manifest file

* remove debug logging from signalmessenger integration

* add signalmessenger to .coveragerc

* fixed typo in signalmessenger manifes

* moved service specific code to own pypi library

* updated pysignalclirestapi dependeny in manifest.json

* added pysignalclirestapi requirement for signalmessenger component

* fixed typo in codeowners

* reworked signalmessenger integration based on code review input

* updated requirements for signalmessenger

* small code improvements in signalmessenger integration

* no need to use the get() method to access dict parameters that are
required

* small changes in signalmessenger integration

* re-ordered import statements
* removed empty "requirements" list (not needed)

* changed import order in signalmessenger integration according to PEP 8

* used isort to order includes in signalmessenger integration

* renamed signalmessenger to signal_messenger

* renamed signalmessenger to signal_messenger in CODEOWNERS file

* changed documentation url in signal_messenger integration to new name

* changed signal messenger naming in .coveragerc
2019-12-09 00:27:06 +01:00
Robert Van Gorkom
e577f047f7 Add tests for vera component (#28340)
* Adding tests for vera component.
Fixing update bug in the vera climate platform.

* Updating requrements file.

* Moving vera stop to a job.
Sorting imports.

* Addressing simple PR feedback.

* Splitting tests into platforms.

* Mocking controller instead of using requests_mock.

* Updating pyvera to use version that stops threads quickly.

* Updating requirements files.

* Mocking the pyvera module, not the API.

* Addressing PR feedback.
Handling start/stop of patch in fixture.
Removing unecessary code.

* Using generator
2019-12-09 00:19:38 +01:00
Bas Nijholt
076e0273a2 Sort imports according to PEP8 for kodi (#29721) 2019-12-08 23:42:04 +01:00
Bas Nijholt
39887c46c0 Sort imports according to PEP8 for dialogflow (#29714) 2019-12-08 23:40:06 +01:00
Bas Nijholt
81a482332d Sort imports according to PEP8 for eufy (#29715) 2019-12-08 23:34:18 +01:00
Bas Nijholt
6a1753d6db Sort imports according to PEP8 for geonetnz_volcano (#29716) 2019-12-08 23:33:42 +01:00
Bas Nijholt
cce3077df3 Sort imports according to PEP8 for cert_expiry (#29705) 2019-12-08 23:32:50 +01:00
Bas Nijholt
e6eed4755f Sort imports according to PEP8 for plex (#29708) 2019-12-08 23:31:55 +01:00
Gerald Hansen
3d25ed7994 Change state values for Worx Landroid sensor (#27453)
The obj["state"] contains already several named return states as
following: "grass cutting", "trapped recovery", "searching wire",
           "following wire", "searching home", "home", "idle"
And with the batteryChargerState also the "charging"

Fixes #455
2019-12-08 22:27:18 +01:00
Bas Nijholt
55559f3e30 Sort imports according to PEP8 for starline (#29653) 2019-12-08 21:09:48 +01:00
Bas Nijholt
51ece97e0d Sort imports according to PEP8 for hive (#29669) 2019-12-08 21:06:05 +01:00
Bas Nijholt
415176e350 Sort imports according to PEP8 for template (#29655) 2019-12-08 21:05:08 +01:00
Bas Nijholt
e0b82440ad Sort imports according to PEP8 for switch (#29654) 2019-12-08 18:50:17 +01:00
Bas Nijholt
3d64405896 Sort imports according to PEP8 for recorder (#29652) 2019-12-08 18:48:18 +01:00
Fabian Affolter
b832749e3c Fix file permission (#29660) 2019-12-08 18:41:48 +01:00
Bas Nijholt
0a4979549d use isort to sort imports according to PEP8 for vacuum (#29650) 2019-12-08 22:47:01 +05:30
Bas Nijholt
b731ddabde Sort imports according to PEP8 for homekit (#29645) 2019-12-08 18:16:49 +01:00
Bas Nijholt
aeff27680b use isort to sort imports according to PEP8 for light (#29648) 2019-12-08 22:46:23 +05:30
Bas Nijholt
ce5072fc91 use isort to sort imports according to PEP8 for mqtt (#29649) 2019-12-08 22:45:26 +05:30
Bas Nijholt
d2c1e5d45c Sort imports according to PEP8 for homekit_controller (#29646) 2019-12-08 18:14:26 +01:00
Bas Nijholt
0d5de6a464 use isort to sort imports according to PEP8 for ecobee (#29631) 2019-12-08 22:31:50 +05:30
Bas Nijholt
fbd4cf1089 use isort to sort imports according to PEP8 for cloud (#29626) 2019-12-08 22:31:12 +05:30
Bas Nijholt
e4e9cdce73 use isort to sort imports according to PEP8 for demo (#29630) 2019-12-08 22:29:27 +05:30
Bas Nijholt
a3b605bb7d use isort to sort imports according to PEP8 for cover (#29629) 2019-12-08 22:28:00 +05:30
Bas Nijholt
f355570f17 use isort to sort imports according to PEP8 for config (#29628) 2019-12-08 22:27:28 +05:30
Bas Nijholt
73c373a0f2 use isort to sort imports according to PEP8 for command_line (#29627) 2019-12-08 22:25:57 +05:30
Bas Nijholt
954813b478 use isort to sort imports according to PEP8 for climate (#29625) 2019-12-08 22:25:01 +05:30
springstan
3b5da9c44a Move imports to top for homekit_controller (#29564)
* Move imports to top for homekit_controller

* Fix IpPairing mock in two test files
2019-12-08 16:50:57 +00:00
Bas Nijholt
8f5e8c72c6 use isort to sort imports according to PEP8 for binary_sensor (#29622) 2019-12-08 22:02:08 +05:30
Bas Nijholt
f5288db93c use isort to sort imports according to PEP8 for cast (#29624) 2019-12-08 22:00:57 +05:30
Bas Nijholt
d3f67c3841 use isort to sort imports according to PEP8 for automation (#29620) 2019-12-08 21:59:39 +05:30
Bas Nijholt
a38f3ac9c6 use isort to sort imports according to PEP8 for fan (#29632) 2019-12-08 21:28:47 +05:30
Robert Svensson
57a3f7d5c8 Pass in parameters explicitly to DeconzSession (#29617)
Dont pass in loop to DeconzSession
Services will use new refresh state method
2019-12-08 16:53:34 +01:00
Bas Nijholt
00dc721609 sort imports according to PEP8 for hassio (#29634) 2019-12-08 16:33:22 +01:00
Bas Nijholt
b0d0060643 sort imports according to PEP8 for axis (#29621) 2019-12-08 15:44:03 +01:00
Fabian Affolter
c4794572d4 Fix file permission (#29635) 2019-12-08 15:43:09 +01:00
Sören Beye
94dec483e9 Don't escape command parameters (#29504)
* Don't escape command parameters

Escaping should only be done when using the tcp socket cli interface which we aren't.

* Updated comment to reflect the changes
2019-12-08 15:18:46 +01:00
James Nimmo
c78773970b Add IntesisHome Climate Platform (#25364)
* Add IntesisHome Climate Platform

* Add support for IntesisHome and Airconwithme devices

* Implement requested changes from PR review

* Improve error handling for IntesisHome component

* Fix snake-case naming style

* Update exception logging
2019-12-08 15:09:16 +01:00
Bas Nijholt
663e2eaaff sort imports according to PEP8 for buienradar (#29623) 2019-12-08 14:59:21 +01:00
Bas Nijholt
ba34922b03 sort imports according to PEP8 for alexa (#29618) 2019-12-08 14:56:42 +01:00
Bas Nijholt
6ad3b6426a sort imports according to PEP8 for auth (#29619) 2019-12-08 14:55:23 +01:00
Fabian Affolter
fa00808f6c Upgrade keyring to 19.3.0 and keyrings.alt to 3.2.0 (#29607) 2019-12-08 13:51:54 +01:00
Bas Nijholt
09ff0a5ac6 sort imports according to PEP8 for yweather (#29608) 2019-12-08 13:50:02 +01:00
Bas Nijholt
74c0219d0c sort imports according to PEP8 for components (#29609) 2019-12-08 13:46:04 +01:00
Bas Nijholt
b4bcd477f8 sort imports according to PEP8 for acer_projector (#29611) 2019-12-08 13:45:33 +01:00
Bas Nijholt
cfe68d7e00 sort imports according to PEP8 for actiontec (#29612) 2019-12-08 13:44:44 +01:00
Bas Nijholt
a885670a9a sort imports according to PEP8 for abode (#29610) 2019-12-08 13:44:12 +01:00
Bas Nijholt
f5a1b32be0 sort imports according to PEP8 for ads (#29613) 2019-12-08 13:43:32 +01:00
Bas Nijholt
e510c4ea1d sort imports according to PEP8 for air_quality (#29614) 2019-12-08 13:42:55 +01:00
Bas Nijholt
d020486929 sort imports according to PEP8 for alarm_control_panel (#29616) 2019-12-08 13:42:31 +01:00
Bas Nijholt
700cecc8ef sort imports according to PEP8 for airly (#29615) 2019-12-08 13:41:51 +01:00
Ville Skyttä
ef4515ed70 Add Huawei LTE reboot and clear traffic statistics services (#29594)
* Add clear traffic statistics service

* Add reboot service

* Register services as admin ones

* Make URL optional when there's only one router configured

* Eliminate one if/else indent level

* Remove unnecessary .keys() with sorted()
2019-12-08 12:21:48 +01:00
springstan
d752fe3033 Move imports to top for fido (#29557)
* Move imports to top for fido

* Fix tests for fido by using patch
2019-12-08 12:20:53 +01:00
springstan
6de8072e8a Move imports to top for websocket_api (#29556)
* Move imports to top for websocket_api

* Move back an import because of circular dependency, add annotations
2019-12-08 12:19:15 +01:00
SNoof85
21cf6777bb bump freebox api version (#29527) 2019-12-08 09:49:43 +01:00
Andrew McRae
de0db1601b Add quarterly cycle for utility_meter component (#29534)
* Add quarterly tariff period to utility_meter

Many tariff cycles in Australia are 3 monthly (quarterly).
Add quarterly tariff cycle handling to the utility_meter component.

* Add quarterly tariff period to utility_meter

Many tariff cycles in Australia are 3 monthly (quarterly).
Add quarterly tariff cycle handling to the utility_meter component.

* Change date for test for utility_meter

* Add quarterly tariff period to utility_meter

Many tariff cycles in Australia are 3 monthly (quarterly).
Add quarterly tariff cycle handling to the utility_meter component.
2019-12-08 09:49:18 +01:00
springstan
94b6cbc571 Move imports to top for stream (#29548) 2019-12-08 09:48:28 +01:00
springstan
957a2e99fd Move imports to top for tellduslive (#29550) 2019-12-08 09:48:08 +01:00
springstan
b759d50900 Move imports to top for google_assistant (#29561)
* Move imports to top for google_assistant

* Fix pylint error caused by isorting the imports with noqa: F401

* Move back an import because of circular dependency, add annotations
2019-12-08 09:45:13 +01:00
Franck Nijhof
cc9589cff2 Add Elgato Key Light integration (#29592)
* Add Elgato Key Light integration

* Remove passing in of hass loop

* Tweaks a comment

* Tweaks a function name

* Ensure domain namespace in data exists in entry setup
2019-12-08 09:26:31 +01:00
SukramJ
7f4baab3f6 Add additional Magic Cube Model (#29598) 2019-12-08 09:20:13 +01:00
Marius
0cdc315038 change icon for partly-cloudy-night (#29601)
to the available mdi:weather-night-partly-cloudy
2019-12-08 10:55:39 +05:30
Alexei Chetroi
e360b1265f Add input_number.reload admin service. (#29584)
* Add input_number reload service.

* Add test.

* Allow platform setup without entities.

We can reload and add entities later.
2019-12-07 21:26:06 +01:00
Alexei Chetroi
256056430e Add input_datetime reload service. (#29581)
* Add input_datetime reload service.

* Add reload service test.
2019-12-07 21:24:56 +01:00
Alexei Chetroi
ccb0fd5e32 Register automation.reload service as an admin service. (#29582)
* homeassistant/components/automation/__init__.py

* Register automation.reload as an admin service.
2019-12-07 21:17:30 +01:00
butako
d838a56c1d Improve Tahoma Velux support (#27920)
* Improved Velux support. Added Velux Solar Roller Blind. Fixed Velux Integra Window.

* fix indentation

* black formatting

* added new devices in correct sorted order
2019-12-07 16:14:09 +01:00
SNoof85
ee657f3c2f Add service to reboot the Freebox (#29525) 2019-12-07 12:09:43 +01:00
Fabian Affolter
9d7799c0af Upgrade pyyaml to 5.2.0 (#29586) 2019-12-07 09:06:55 +01:00
Ville Skyttä
977f51a9e4 Update Travis dist to bionic (#29575) 2019-12-07 08:34:46 +02:00
springstan
e2adfc3979 Move imports to top for onboarding (#29542) 2019-12-07 11:55:15 +05:30
HomeAssistant Azure
b4c95421d3 [ci skip] Translation update 2019-12-07 00:32:13 +00:00
springstan
23fb364076 Move imports to top for openuv (#29541)
* Move imports to top for openuv

* Renamed mock_pyopenuv_ to MockClient in test_config_flow
2019-12-06 14:13:43 -07:00
springstan
1ee8057662 Move imports to top for zha (#29555)
* Move imports to top for zha
* Move back some imports, add annotation for disabling import-outside-toplevel
* Move import config_flow before import api
2019-12-06 16:12:46 -05:00
Ville Skyttä
fb66a6cf81 Treat BaseException as over-general (#29573)
To follow pylint's defaults.
2019-12-06 21:58:32 +01:00
Ville Skyttä
31c71989e9 Huawei LTE device tracker fixes (#29551)
* Include MAC address in device state attributes for absent devices too

* Use MAC address as default name whether device is connected or not

* Fix initialization of known entities

Closes https://github.com/home-assistant/home-assistant/issues/29354
2019-12-06 21:53:26 +01:00
springstan
74d86dfff9 Move imports to top for soundtouch (#29546)
* Move imports to top for soundtouch

* Format with black

* Fix pyling error by renaming variable

* Rename entity instances to include entity instead of device
2019-12-06 21:11:02 +01:00
springstan
6af30bc232 Move imports to top for notion (#29539)
* Move imports to top for notion

* Fix mocking library in test_config_flow.py
2019-12-06 12:40:00 -07:00
Fabian Affolter
8afe13e818 Upgrade certifi to >=2019.11.28 (#29571) 2019-12-06 20:09:18 +01:00
Ville Skyttä
d257fff9ce Use "kB" and "s" as UPnP/IGD units (#29552)
For consistency with various existing components, and they're more
commonly used and compact than "kbyte" and "sec".
2019-12-06 23:24:11 +05:30
springstan
c9415ab75d Move imports to top for homematic (#29558) 2019-12-06 17:46:24 +01:00
1v0dev
b8434fdcfd Add service to set netatmo home heating schedule (#29244)
* Add service to set netatmo home heating schedule.

* handle NoDevice exeption; add service argument constant
2019-12-06 17:45:27 +01:00
Martin Rowan
48aba426a9 Bump lightwave to 0.17 (#29566) 2019-12-06 17:40:59 +01:00
springstan
606d310ea3 Move imports to top for spc (#29547)
* Move imports to top for spc

* Fix pylint error by removing duplicate import
2019-12-06 15:40:04 +01:00
springstan
d9b52ef98c Move imports to top for plant (#29543) 2019-12-06 15:00:54 +01:00
springstan
f3717421c0 Move imports to top for heatmiser (#29562) 2019-12-06 14:59:32 +01:00
David K
c5f4872aea Limit available heat/cool modes for HomeKit thermostats (#28586)
* Limit available heat/cool modes for HomeKit thermostats.
The Home app only shows appropriate modes (heat/cool/auto) for the device. Depending on the climate integration, disabling the auto start might be needed.

* Include improved mapping for HVAC modes in tests
2019-12-06 14:07:45 +01:00
springstan
27530be46f Move imports to top for influxdb (#29513) 2019-12-06 17:35:35 +05:30
springstan
ec3ffe309a Move imports to top for toon (#29553) 2019-12-06 10:40:38 +01:00
springstan
d5419b77f9 Move imports to top for sleepiq (#29544) 2019-12-06 09:13:44 +01:00
springstan
1bb499aec2 Move imports to top for smhi (#29545) 2019-12-06 09:11:07 +01:00
springstan
a857148560 Move imports to top for pjlink (#29540) 2019-12-06 09:09:45 +01:00
springstan
0aace1da55 Move imports to top for nx584 (#29537) 2019-12-06 09:08:54 +01:00
Franck Nijhof
e2a9c652ab Bump pytest to 5.3.1 (#29535) 2019-12-06 09:08:06 +01:00
Malte Franken
33542f0e5e Bump georss_generic_client to 0.3 (#29532)
* bump version of georss_generic_client library

* updated requirements
2019-12-06 06:55:42 +01:00
springstan
fcf18aca34 Move imports to top for modbus (#29515)
* Move imports to top for modbus

* Include imports for TCP and UDP ModbusClients
2019-12-06 06:10:29 +01:00
springstan
8def0326dd Move imports to top for izone (#29508)
* Move imports to top for izone

* Isorted all imports, fixed tests for config_flow
2019-12-06 06:08:08 +01:00
Alexei Chetroi
dc911ecc5b Add input_boolean reload service (#29379)
* Add input_boolean reload service.

* Add reload test.

* Address comments.

Register reload service as an admin service
Setup platform even if there're no entities
2019-12-05 20:31:18 -08:00
springstan
3b6bc9067f Move imports to top for mochad (#29514)
* Move imports to top for mochad

* Fix test test_light.py for mochad

* Fix test test_switch.py for mochad

* Make intra package imports relative in switch and light
2019-12-06 02:02:34 +01:00
orrpan
9ba9b3339b Add full state view for emulated_hue (apps using emulated_hue, 'sleep cycle' and 'sleep as android') (#26650)
* Add full state view for emulated_hue

* clean and support updated sleep cycle

* emulated hue add reuasable logic and cleanup code

* emulated hue correct typos

* Update hue_api.py

* correct error message and update test_hue_api.py

* cleanup test_hue_api.py
2019-12-05 15:23:54 -08:00
springstan
173966f459 Move imports to top for switcher_kis (#29530)
* Move imports to top for switcher_kis
* Disabled ungrouped imports if TYPE_CHECKING is true
2019-12-05 18:20:07 -05:00
springstan
20fdcbadff Move imports to top for nextbus (#29520)
* Move imports to top for nextbus

* Fix test_sensor.py failed tests
2019-12-05 21:56:42 +01:00
springstan
42688a6e4a Move imports to top for ign_sismologia (#29523) 2019-12-05 21:55:48 +01:00
tetienne
97cb8a3745 Increase somfy SCAN_INTERVAL (#29524)
- There was too many errors 504
2019-12-05 21:33:56 +01:00
springstan
b4fda5faab Move imports to top for mysensors (#29517) 2019-12-05 19:54:43 +01:00
Paulus Schoutsen
ec8ea02273 Fix recursion 2019-12-05 10:40:05 -08:00
springstan
4e7b9eaed0 Move imports to top for monoprice (#29516)
* Move imports to top for monoprice

* Format test with black
2019-12-05 19:16:15 +01:00
springstan
98d2eadb76 Move imports to top for statistics (#29223)
* Move imports to top for statistics

* Added recorder to manifest.json

* Deleted recorder from manifest.json, moved import back into method, added pylint disable comment

* Moved recorder util imports away from the top

* Move recorder imports to top, add recorder as after_dependency to manifest.json
2019-12-05 18:49:28 +01:00
springstan
5bdb20098e Move imports to top for meteoalarm (#29510) 2019-12-05 16:59:56 +01:00
springstan
1846b45cb5 Move imports to top for mobile_app (#29511) 2019-12-05 16:59:31 +01:00
springstan
19893b8f3c Move imports to top for islamic_prayer_times (#29506)
* Move imports to top for islamic_prayer_times

* Fix test_sensor.py for islamic_prayer_times

* Format test_sensor.py with black

* Fix tests for islamic prayer times sensor
2019-12-05 16:58:14 +01:00
springstan
76f455cea9 Move imports to top for mediaroom (#29509) 2019-12-05 16:56:53 +01:00
springstan
2a92eb1962 Move imports to top for ipma (#29507) 2019-12-05 16:56:01 +01:00
springstan
204ca3f3a6 Move imports to top for frontend (#29487) 2019-12-05 13:44:59 +01:00
springstan
ed5cdb528c Move imports to top for group (#29485)
* Move imports to top for group

* Fix failing test for group
2019-12-05 13:44:11 +01:00
springstan
ed464a75b2 Move imports to top for system_log (#29465) 2019-12-05 13:42:56 +01:00
springstan
04722fdd63 Move imports to top for http (#29500) 2019-12-05 13:42:09 +01:00
springstan
e9917c6a81 Move imports to top for google_translate (#29499) 2019-12-05 13:22:01 +01:00
springstan
009e4df6ef Move imports to top for hue (#29501) 2019-12-05 13:19:50 +01:00
springstan
086d1f432d Move imports to top for google_pubsub (#29498) 2019-12-05 12:59:59 +01:00
springstan
564fed7879 Move imports to top for ambient_station (#29497) 2019-12-05 12:50:53 +01:00
Paulus Schoutsen
a050d54847 Make hassfest stricter (#29494)
* Make hassfest stricter

* Update manifest.json
2019-12-05 10:15:28 +01:00
springstan
f6d1eb97a3 Move imports to top for decora_wifi (#29439) 2019-12-05 09:56:17 +01:00
Paulus Schoutsen
e99184bf68 Install requirements of after_dependencies when loading integrations (#29491)
* Install requirements of after_dependencies when loading integrations

* Fix smartthings test
2019-12-05 09:28:56 +01:00
Paulus Schoutsen
957e5018f4 Version bump to 0.104.0dev0 2019-12-04 22:52:58 -08:00
3329 changed files with 43144 additions and 21133 deletions

View File

@@ -5,7 +5,6 @@ omit =
homeassistant/__main__.py
homeassistant/helpers/signal.py
homeassistant/helpers/typing.py
homeassistant/monkey_patch.py
homeassistant/scripts/*.py
homeassistant/util/async.py
@@ -85,7 +84,6 @@ omit =
homeassistant/components/blockchain/sensor.py
homeassistant/components/bloomsky/*
homeassistant/components/bluesound/*
homeassistant/components/bluetooth_le_tracker/device_tracker.py
homeassistant/components/bluetooth_tracker/*
homeassistant/components/bme280/sensor.py
homeassistant/components/bme680/sensor.py
@@ -97,6 +95,9 @@ omit =
homeassistant/components/broadlink/remote.py
homeassistant/components/broadlink/sensor.py
homeassistant/components/broadlink/switch.py
homeassistant/components/brother/__init__.py
homeassistant/components/brother/sensor.py
homeassistant/components/brother/const.py
homeassistant/components/brottsplatskartan/sensor.py
homeassistant/components/browser/*
homeassistant/components/brunt/cover.py
@@ -259,6 +260,9 @@ omit =
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
@@ -319,7 +323,9 @@ omit =
homeassistant/components/iaqualink/light.py
homeassistant/components/iaqualink/sensor.py
homeassistant/components/iaqualink/switch.py
homeassistant/components/icloud/*
homeassistant/components/icloud/__init__.py
homeassistant/components/icloud/device_tracker.py
homeassistant/components/icloud/sensor.py
homeassistant/components/izone/climate.py
homeassistant/components/izone/discovery.py
homeassistant/components/izone/__init__.py
@@ -332,6 +338,7 @@ omit =
homeassistant/components/influxdb/sensor.py
homeassistant/components/insteon/*
homeassistant/components/incomfort/*
homeassistant/components/intesishome/*
homeassistant/components/ios/*
homeassistant/components/iota/*
homeassistant/components/iperf3/*
@@ -347,6 +354,7 @@ omit =
homeassistant/components/kankun/switch.py
homeassistant/components/keba/*
homeassistant/components/keenetic_ndms2/device_tracker.py
homeassistant/components/kef/*
homeassistant/components/keyboard/*
homeassistant/components/keyboard_remote/*
homeassistant/components/kira/*
@@ -601,6 +609,7 @@ omit =
homeassistant/components/sensehat/light.py
homeassistant/components/sensehat/sensor.py
homeassistant/components/sensibo/climate.py
homeassistant/components/sentry/__init__.py
homeassistant/components/serial/sensor.py
homeassistant/components/serial_pm/sensor.py
homeassistant/components/sesame/lock.py
@@ -610,6 +619,8 @@ omit =
homeassistant/components/shodan/sensor.py
homeassistant/components/sht31/sensor.py
homeassistant/components/sigfox/sensor.py
homeassistant/components/signal_messenger/__init__.py
homeassistant/components/signal_messenger/notify.py
homeassistant/components/simplepush/notify.py
homeassistant/components/simplisafe/__init__.py
homeassistant/components/simplisafe/alarm_control_panel.py
@@ -654,9 +665,11 @@ omit =
homeassistant/components/starlingbank/sensor.py
homeassistant/components/steam_online/sensor.py
homeassistant/components/stiebel_eltron/*
homeassistant/components/stookalert/*
homeassistant/components/streamlabswater/*
homeassistant/components/suez_water/*
homeassistant/components/supervisord/sensor.py
homeassistant/components/surepetcare/*.py
homeassistant/components/swiss_hydrological_data/sensor.py
homeassistant/components/swiss_public_transport/sensor.py
homeassistant/components/swisscom/device_tracker.py
@@ -684,7 +697,14 @@ omit =
homeassistant/components/telnet/switch.py
homeassistant/components/temper/sensor.py
homeassistant/components/tensorflow/image_processing.py
homeassistant/components/tesla/*
homeassistant/components/tesla/__init__.py
homeassistant/components/tesla/binary_sensor.py
homeassistant/components/tesla/climate.py
homeassistant/components/tesla/const.py
homeassistant/components/tesla/device_tracker.py
homeassistant/components/tesla/lock.py
homeassistant/components/tesla/sensor.py
homeassistant/components/tesla/switch.py
homeassistant/components/tfiac/climate.py
homeassistant/components/thermoworks_smoke/sensor.py
homeassistant/components/thethingsnetwork/*
@@ -695,6 +715,7 @@ omit =
homeassistant/components/tikteck/light.py
homeassistant/components/tile/device_tracker.py
homeassistant/components/time_date/sensor.py
homeassistant/components/tmb/sensor.py
homeassistant/components/todoist/calendar.py
homeassistant/components/todoist/const.py
homeassistant/components/tof/sensor.py
@@ -704,7 +725,6 @@ omit =
homeassistant/components/totalconnect/*
homeassistant/components/touchline/climate.py
homeassistant/components/tplink/device_tracker.py
homeassistant/components/tplink/light.py
homeassistant/components/tplink/switch.py
homeassistant/components/tplink_lte/*
homeassistant/components/traccar/device_tracker.py
@@ -745,11 +765,11 @@ omit =
homeassistant/components/velbus/climate.py
homeassistant/components/velbus/const.py
homeassistant/components/velbus/cover.py
homeassistant/components/velbus/light.py
homeassistant/components/velbus/sensor.py
homeassistant/components/velbus/switch.py
homeassistant/components/velux/*
homeassistant/components/venstar/climate.py
homeassistant/components/vera/*
homeassistant/components/verisure/*
homeassistant/components/versasense/*
homeassistant/components/vesync/__init__.py
@@ -759,7 +779,7 @@ omit =
homeassistant/components/viaggiatreno/sensor.py
homeassistant/components/vicare/*
homeassistant/components/vivotek/camera.py
homeassistant/components/vizio/media_player.py
homeassistant/components/vizio/*
homeassistant/components/vlc/media_player.py
homeassistant/components/vlc_telnet/media_player.py
homeassistant/components/volkszaehler/sensor.py

View File

@@ -1,4 +1,3 @@
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
{
"name": "Home Assistant Dev",
"context": "..",

View File

@@ -3,6 +3,7 @@
- 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!

View File

@@ -24,7 +24,7 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==4.0.1
- pydocstyle==5.0.1
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
@@ -35,6 +35,14 @@ repos:
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-json
# Using a local "system" mypy instead of the mypy hook, because its
# results depend on what is installed. And the mypy hook runs in a
# virtualenv of its own, meaning we'd need to install and maintain

View File

@@ -20,14 +20,22 @@ repos:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==4.0.1
- pydocstyle==5.0.1
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
hooks:
- id: bandit
- id: bandit
args:
- --quiet
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-json

View File

@@ -4,7 +4,7 @@ build:
image: latest
python:
version: 3.6
version: 3.7
setup_py_install: true
requirements_file: requirements_docs.txt

View File

@@ -1,9 +1,7 @@
sudo: false
dist: xenial
dist: bionic
addons:
apt:
sources:
- sourceline: "ppa:jonathonf/ffmpeg-4"
packages:
- libudev-dev
- libavformat-dev
@@ -16,15 +14,13 @@ addons:
matrix:
fast_finish: true
include:
- python: "3.6.1"
- python: "3.7.0"
env: TOXENV=lint
- python: "3.6.1"
- python: "3.7.0"
env: TOXENV=pylint PYLINT_ARGS=--jobs=0 TRAVIS_WAIT=30
- python: "3.6.1"
- python: "3.7.0"
env: TOXENV=typing
- python: "3.6.1"
env: TOXENV=py36
- python: "3.7"
- python: "3.7.0"
env: TOXENV=py37
cache:

View File

@@ -51,6 +51,7 @@ homeassistant/components/blink/* @fronzbot
homeassistant/components/bmw_connected_drive/* @gerard33
homeassistant/components/braviatv/* @robbiet480
homeassistant/components/broadlink/* @danielhiversen @felipediel
homeassistant/components/brother/* @bieniu
homeassistant/components/brunt/* @eavanvalkenburg
homeassistant/components/bt_smarthub/* @jxwolstenholme
homeassistant/components/buienradar/* @mjj4791 @ties
@@ -85,6 +86,7 @@ homeassistant/components/ecobee/* @marthoc
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/elgato/* @frenck
homeassistant/components/elv/* @majuss
homeassistant/components/emby/* @mezz64
homeassistant/components/emulated_hue/* @NobleKangaroo
@@ -118,6 +120,7 @@ homeassistant/components/geniushub/* @zxdavb
homeassistant/components/geo_rss_events/* @exxamalte
homeassistant/components/geonetnz_quakes/* @exxamalte
homeassistant/components/geonetnz_volcano/* @exxamalte
homeassistant/components/gios/* @bieniu
homeassistant/components/gitter/* @fabaff
homeassistant/components/glances/* @fabaff @engrbm87
homeassistant/components/gntp/* @robbiet480
@@ -151,6 +154,7 @@ homeassistant/components/huawei_lte/* @scop
homeassistant/components/huawei_router/* @abmantis
homeassistant/components/hue/* @balloob
homeassistant/components/iaqualink/* @flz
homeassistant/components/icloud/* @Quentame
homeassistant/components/ign_sismologia/* @exxamalte
homeassistant/components/incomfort/* @zxdavb
homeassistant/components/influxdb/* @fabaff
@@ -161,6 +165,7 @@ homeassistant/components/input_select/* @home-assistant/core
homeassistant/components/input_text/* @home-assistant/core
homeassistant/components/integration/* @dgomes
homeassistant/components/intent/* @home-assistant/core
homeassistant/components/intesishome/* @jnimmo
homeassistant/components/ios/* @robbiet480
homeassistant/components/iperf3/* @rohankapoorcom
homeassistant/components/ipma/* @dgomes
@@ -172,6 +177,7 @@ homeassistant/components/juicenet/* @jesserockz
homeassistant/components/kaiterra/* @Michsior14
homeassistant/components/keba/* @dannerph
homeassistant/components/keenetic_ndms2/* @foxel
homeassistant/components/kef/* @basnijholt
homeassistant/components/keyboard_remote/* @bendavid
homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/* @armills
@@ -183,6 +189,7 @@ homeassistant/components/life360/* @pnbruckner
homeassistant/components/linky/* @Quentame
homeassistant/components/linux_battery/* @fabaff
homeassistant/components/liveboxplaytv/* @pschmitt
homeassistant/components/local_ip/* @issacg
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/logi_circle/* @evanjd
homeassistant/components/lovelace/* @home-assistant/frontend
@@ -232,6 +239,7 @@ homeassistant/components/obihai/* @dshokouhi
homeassistant/components/ohmconnect/* @robbiet480
homeassistant/components/ombi/* @larssont
homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/onewire/* @garbled1
homeassistant/components/opentherm_gw/* @mvn23
homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/* @fabaff
@@ -244,6 +252,7 @@ homeassistant/components/pcal9535a/* @Shulyaka
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/philips_js/* @elupus
homeassistant/components/pi_hole/* @fabaff @johnluetke
homeassistant/components/pilight/* @trekky12
homeassistant/components/plaato/* @JohNan
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/plex/* @jjlawren
@@ -274,11 +283,13 @@ homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
homeassistant/components/sense/* @kbickar
homeassistant/components/sensibo/* @andrey-git
homeassistant/components/sentry/* @dcramer
homeassistant/components/serial/* @fabaff
homeassistant/components/seventeentrack/* @bachya
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/* @fabaff
homeassistant/components/signal_messenger/* @bbernhard
homeassistant/components/simplisafe/* @bachya
homeassistant/components/sinch/* @bendikrb
homeassistant/components/slide/* @ualex73
@@ -300,11 +311,13 @@ homeassistant/components/sql/* @dgomes
homeassistant/components/starline/* @anonym-tsk
homeassistant/components/statistics/* @fabaff
homeassistant/components/stiebel_eltron/* @fucm
homeassistant/components/stookalert/* @fwestenberg
homeassistant/components/stream/* @hunterjm
homeassistant/components/stt/* @pvizeli
homeassistant/components/suez_water/* @ooii
homeassistant/components/sun/* @Swamp-Ig
homeassistant/components/supla/* @mwegrzynek
homeassistant/components/surepetcare/* @benleb
homeassistant/components/swiss_hydrological_data/* @fabaff
homeassistant/components/swiss_public_transport/* @fabaff
homeassistant/components/switchbot/* @danielhiversen
@@ -317,14 +330,15 @@ homeassistant/components/tado/* @michaelarnauts
homeassistant/components/tahoma/* @philklei
homeassistant/components/tautulli/* @ludeeus
homeassistant/components/tellduslive/* @fredrike
homeassistant/components/template/* @PhracturedBlue
homeassistant/components/tesla/* @zabuldon
homeassistant/components/template/* @PhracturedBlue @tetienne
homeassistant/components/tesla/* @zabuldon @alandtse
homeassistant/components/tfiac/* @fredrike @mellado
homeassistant/components/thethingsnetwork/* @fabaff
homeassistant/components/threshold/* @fabaff
homeassistant/components/tibber/* @danielhiversen
homeassistant/components/tile/* @bachya
homeassistant/components/time_date/* @fabaff
homeassistant/components/tmb/* @alemuro
homeassistant/components/todoist/* @boralyl
homeassistant/components/toon/* @frenck
homeassistant/components/tplink/* @rytilahti
@@ -358,10 +372,12 @@ homeassistant/components/waqi/* @andrey-git
homeassistant/components/watson_tts/* @rutkai
homeassistant/components/weather/* @fabaff
homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/webostv/* @bendavid
homeassistant/components/websocket_api/* @home-assistant/core
homeassistant/components/wemo/* @sqldiablo
homeassistant/components/withings/* @vangorra
homeassistant/components/wled/* @frenck
homeassistant/components/workday/* @fabaff
homeassistant/components/worldclock/* @fabaff
homeassistant/components/wwlln/* @bachya
homeassistant/components/xbox_live/* @MartinHjelmare

View File

@@ -4,7 +4,7 @@ Everybody is invited and welcome to contribute to Home Assistant. There is a lot
The process is straight-forward.
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0)
- Read [How to get faster PR reviews](https://github.com/kubernetes/community/blob/master/contributors/guide/pull-requests.md#best-practices-for-faster-reviews) by Kubernetes (but skip step 0 and 1)
- Fork the Home Assistant [git repository](https://github.com/home-assistant/home-assistant).
- Write the code for your device, notification service, sensor, or IoT thing.
- Ensure tests work.
@@ -12,3 +12,7 @@ The process is straight-forward.
Still interested? Then you should take a peek at the [developer documentation](https://developers.home-assistant.io/) to get more details.
## Feature suggestions
If you want to suggest a new feature for Home Assistant (e.g., new integrations), please open a thread in our [Community Forum: Feature Requests](https://community.home-assistant.io/c/feature-requests).
We use [GitHub for tracking issues](https://github.com/home-assistant/home-assistant/issues), not for tracking feature requests.

View File

@@ -1,14 +1,7 @@
Home Assistant |Chat Status|
=================================================================================
Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.
To get started:
.. code:: bash
python3 -m pip install homeassistant
hass --open-ui
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.
Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,

View File

@@ -14,8 +14,6 @@ pr:
resources:
containers:
- container: 36
image: homeassistant/ci-azure:3.6
- container: 37
image: homeassistant/ci-azure:3.7
repositories:
@@ -25,7 +23,7 @@ resources:
endpoint: 'home-assistant'
variables:
- name: PythonMain
value: '36'
value: '37'
- group: codecov
stages:
@@ -54,6 +52,14 @@ stages:
. venv/bin/activate
pre-commit run bandit --all-files
displayName: 'Run bandit'
- script: |
. venv/bin/activate
pre-commit run isort --all-files --show-diff-on-failure
displayName: 'Run isort'
- script: |
. venv/bin/activate
pre-commit run check-json --all-files
displayName: 'Run check-json'
- job: 'Validate'
pool:
vmImage: 'ubuntu-latest'
@@ -91,7 +97,7 @@ stages:
pre-commit install-hooks --config .pre-commit-config-all.yaml
- script: |
. venv/bin/activate
pre-commit run black --all-files
pre-commit run black --all-files --show-diff-on-failure
displayName: 'Check Black formatting'
- stage: 'Tests'
@@ -104,8 +110,6 @@ stages:
strategy:
maxParallel: 3
matrix:
Python36:
python.container: '36'
Python37:
python.container: '37'
container: $[ variables['python.container'] ]

View File

@@ -14,7 +14,7 @@ schedules:
always: true
variables:
- name: versionBuilder
value: '6.3'
value: '6.9'
- group: docker
- group: github
- group: twine
@@ -94,7 +94,7 @@ stages:
buildMachine: 'raspberrypi2,raspberrypi3,raspberrypi4,odroid-xu,tinker'
aarch64:
buildArch: 'aarch64'
buildMachine: 'qemuarm-64,raspberrypi3-64,raspberrypi4-64,odroid-c2,orangepi-prime'
buildMachine: 'qemuarm-64,raspberrypi3-64,raspberrypi4-64,odroid-c2,odroid-n2'
steps:
- template: templates/azp-step-ha-version.yaml@azure
- script: |

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -8,7 +8,6 @@ Loosely based on https://github.com/astropy/astropy/pull/347
import os
import warnings
__licence__ = 'BSD (3 clause)'

View File

@@ -17,11 +17,11 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import sys
import os
import inspect
import os
import sys
from homeassistant.const import __version__, __short_version__
from homeassistant.const import __short_version__, __version__
PROJECT_NAME = 'Home Assistant'
PROJECT_PACKAGE_NAME = 'homeassistant'

View File

@@ -1,14 +1,14 @@
"""Start Home Assistant."""
import argparse
import asyncio
import os
import platform
import subprocess
import sys
import threading
from typing import List, Dict, Any, TYPE_CHECKING
from typing import TYPE_CHECKING, Any, Dict, List
from homeassistant import monkey_patch
from homeassistant.const import __version__, REQUIRED_PYTHON_VER, RESTART_EXIT_CODE
from homeassistant.const import REQUIRED_PYTHON_VER, RESTART_EXIT_CODE, __version__
if TYPE_CHECKING:
from homeassistant import core
@@ -16,7 +16,6 @@ if TYPE_CHECKING:
def set_loop() -> None:
"""Attempt to use different loop."""
import asyncio
from asyncio.events import BaseDefaultEventLoopPolicy
if sys.platform == "win32":
@@ -56,10 +55,8 @@ def ensure_config_path(config_dir: str) -> None:
if not os.path.isdir(config_dir):
if config_dir != config_util.get_default_config_dir():
print(
(
"Fatal Error: Specified configuration directory does "
"not exist {} "
).format(config_dir)
f"Fatal Error: Specified configuration directory {config_dir} "
"does not exist"
)
sys.exit(1)
@@ -67,10 +64,8 @@ def ensure_config_path(config_dir: str) -> None:
os.mkdir(config_dir)
except OSError:
print(
(
"Fatal Error: Unable to create default configuration "
"directory {} "
).format(config_dir)
"Fatal Error: Unable to create default configuration "
f"directory {config_dir}"
)
sys.exit(1)
@@ -79,11 +74,7 @@ def ensure_config_path(config_dir: str) -> None:
try:
os.mkdir(lib_dir)
except OSError:
print(
("Fatal Error: Unable to create library " "directory {} ").format(
lib_dir
)
)
print(f"Fatal Error: Unable to create library directory {lib_dir}")
sys.exit(1)
@@ -148,7 +139,7 @@ def get_arguments() -> argparse.Namespace:
"--log-file",
type=str,
default=None,
help="Log file to write to. If not set, CONFIG/home-assistant.log " "is used",
help="Log file to write to. If not set, CONFIG/home-assistant.log is used",
)
parser.add_argument(
"--log-no-color", action="store_true", help="Disable color logs"
@@ -217,7 +208,7 @@ def check_pid(pid_file: str) -> None:
except OSError:
# PID does not exist
return
print("Fatal Error: HomeAssistant is already running.")
print("Fatal Error: Home Assistant is already running.")
sys.exit(1)
@@ -261,7 +252,7 @@ def cmdline() -> List[str]:
async def setup_and_run_hass(config_dir: str, args: argparse.Namespace) -> int:
"""Set up HASS and run."""
"""Set up Home Assistant and run."""
from homeassistant import bootstrap, core
hass = core.HomeAssistant()
@@ -345,11 +336,6 @@ def main() -> int:
"""Start Home Assistant."""
validate_python()
monkey_patch_needed = sys.version_info[:3] < (3, 6, 3)
if monkey_patch_needed and os.environ.get("HASS_NO_MONKEY") != "1":
monkey_patch.disable_c_asyncio()
monkey_patch.patch_weakref_tasks()
set_loop()
# Run a simple daemon runner process on Windows to handle restarts
@@ -383,13 +369,11 @@ def main() -> int:
if args.pid_file:
write_pid(args.pid_file)
from homeassistant.util.async_ import asyncio_run
exit_code = asyncio_run(setup_and_run_hass(config_dir, args))
exit_code = asyncio.run(setup_and_run_hass(config_dir, args))
if exit_code == RESTART_EXIT_CODE and not args.runner:
try_to_restart()
return exit_code # type: ignore
return exit_code
if __name__ == "__main__":

View File

@@ -1,21 +1,21 @@
"""Provide an authentication layer for Home Assistant."""
import asyncio
import logging
from collections import OrderedDict
from datetime import timedelta
import logging
from typing import Any, Dict, List, Optional, Tuple, cast
import jwt
from homeassistant import data_entry_flow
from homeassistant.auth.const import ACCESS_TOKEN_EXPIRATION
from homeassistant.core import callback, HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.util import dt as dt_util
from . import auth_store, models
from .const import GROUP_ID_ADMIN
from .mfa_modules import auth_mfa_module_from_config, MultiFactorAuthModule
from .providers import auth_provider_from_config, AuthProvider, LoginFlow
from .mfa_modules import MultiFactorAuthModule, auth_mfa_module_from_config
from .providers import AuthProvider, LoginFlow, auth_provider_from_config
EVENT_USER_ADDED = "user_added"
EVENT_USER_REMOVED = "user_removed"
@@ -67,6 +67,69 @@ async def auth_manager_from_config(
return manager
class AuthManagerFlowManager(data_entry_flow.FlowManager):
"""Manage authentication flows."""
def __init__(self, hass: HomeAssistant, auth_manager: "AuthManager"):
"""Init auth manager flows."""
super().__init__(hass)
self.auth_manager = auth_manager
async def async_create_flow(
self,
handler_key: Any,
*,
context: Optional[Dict[str, Any]] = None,
data: Optional[Dict[str, Any]] = None,
) -> data_entry_flow.FlowHandler:
"""Create a login flow."""
auth_provider = self.auth_manager.get_auth_provider(*handler_key)
if not auth_provider:
raise KeyError(f"Unknown auth provider {handler_key}")
return await auth_provider.async_login_flow(context)
async def async_finish_flow(
self, flow: data_entry_flow.FlowHandler, result: Dict[str, Any]
) -> Dict[str, Any]:
"""Return a user as result of login flow."""
flow = cast(LoginFlow, flow)
if result["type"] != data_entry_flow.RESULT_TYPE_CREATE_ENTRY:
return result
# we got final result
if isinstance(result["data"], models.User):
result["result"] = result["data"]
return result
auth_provider = self.auth_manager.get_auth_provider(*result["handler"])
if not auth_provider:
raise KeyError(f"Unknown auth provider {result['handler']}")
credentials = await auth_provider.async_get_or_create_credentials(
result["data"]
)
if flow.context.get("credential_only"):
result["result"] = credentials
return result
# multi-factor module cannot enabled for new credential
# which has not linked to a user yet
if auth_provider.support_mfa and not credentials.is_new:
user = await self.auth_manager.async_get_user_by_credentials(credentials)
if user is not None:
modules = await self.auth_manager.async_get_enabled_mfa(user)
if modules:
flow.user = user
flow.available_mfa_modules = modules
return await flow.async_step_select_mfa_module()
result["result"] = await self.auth_manager.async_get_or_create_user(credentials)
return result
class AuthManager:
"""Manage the authentication for Home Assistant."""
@@ -82,9 +145,7 @@ class AuthManager:
self._store = store
self._providers = providers
self._mfa_modules = mfa_modules
self.login_flow = data_entry_flow.FlowManager(
hass, self._async_create_login_flow, self._async_finish_login_flow
)
self.login_flow = AuthManagerFlowManager(hass, self)
@property
def auth_providers(self) -> List[AuthProvider]:
@@ -417,50 +478,6 @@ class AuthManager:
return refresh_token
async def _async_create_login_flow(
self, handler: _ProviderKey, *, context: Optional[Dict], data: Optional[Any]
) -> data_entry_flow.FlowHandler:
"""Create a login flow."""
auth_provider = self._providers[handler]
return await auth_provider.async_login_flow(context)
async def _async_finish_login_flow(
self, flow: LoginFlow, result: Dict[str, Any]
) -> Dict[str, Any]:
"""Return a user as result of login flow."""
if result["type"] != data_entry_flow.RESULT_TYPE_CREATE_ENTRY:
return result
# we got final result
if isinstance(result["data"], models.User):
result["result"] = result["data"]
return result
auth_provider = self._providers[result["handler"]]
credentials = await auth_provider.async_get_or_create_credentials(
result["data"]
)
if flow.context.get("credential_only"):
result["result"] = credentials
return result
# multi-factor module cannot enabled for new credential
# which has not linked to a user yet
if auth_provider.support_mfa and not credentials.is_new:
user = await self.async_get_user_by_credentials(credentials)
if user is not None:
modules = await self.async_get_enabled_mfa(user)
if modules:
flow.user = user
flow.available_mfa_modules = modules
return await flow.async_step_select_mfa_module()
result["result"] = await self.async_get_or_create_user(credentials)
return result
@callback
def _async_get_auth_provider(
self, credentials: models.Credentials

View File

@@ -11,7 +11,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.util import dt as dt_util
from . import models
from .const import GROUP_ID_ADMIN, GROUP_ID_USER, GROUP_ID_READ_ONLY
from .const import GROUP_ID_ADMIN, GROUP_ID_READ_ONLY, GROUP_ID_USER
from .permissions import PermissionLookup, system_policies
from .permissions.types import PolicyType

View File

@@ -7,7 +7,7 @@ from typing import Any, Dict, Optional
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import requirements, data_entry_flow
from homeassistant import data_entry_flow, requirements
from homeassistant.const import CONF_ID, CONF_NAME, CONF_TYPE
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError

View File

@@ -7,9 +7,9 @@ import voluptuous as vol
from homeassistant.core import HomeAssistant
from . import (
MultiFactorAuthModule,
MULTI_FACTOR_AUTH_MODULES,
MULTI_FACTOR_AUTH_MODULE_SCHEMA,
MULTI_FACTOR_AUTH_MODULES,
MultiFactorAuthModule,
SetupFlow,
)

View File

@@ -3,9 +3,9 @@
Sending HOTP through notify service
"""
import asyncio
import logging
from collections import OrderedDict
from typing import Any, Dict, Optional, List
import logging
from typing import Any, Dict, List, Optional
import attr
import voluptuous as vol
@@ -16,9 +16,9 @@ from homeassistant.exceptions import ServiceNotFound
from homeassistant.helpers import config_validation as cv
from . import (
MultiFactorAuthModule,
MULTI_FACTOR_AUTH_MODULES,
MULTI_FACTOR_AUTH_MODULE_SCHEMA,
MULTI_FACTOR_AUTH_MODULES,
MultiFactorAuthModule,
SetupFlow,
)

View File

@@ -1,7 +1,7 @@
"""Time-based One Time Password auth module."""
import asyncio
import logging
from io import BytesIO
import logging
from typing import Any, Dict, Optional, Tuple
import voluptuous as vol
@@ -10,9 +10,9 @@ from homeassistant.auth.models import User
from homeassistant.core import HomeAssistant
from . import (
MultiFactorAuthModule,
MULTI_FACTOR_AUTH_MODULES,
MULTI_FACTOR_AUTH_MODULE_SCHEMA,
MULTI_FACTOR_AUTH_MODULES,
MultiFactorAuthModule,
SetupFlow,
)

View File

@@ -1,5 +1,6 @@
"""Auth models."""
from datetime import datetime, timedelta
import secrets
from typing import Dict, List, NamedTuple, Optional
import uuid
@@ -9,7 +10,6 @@ from homeassistant.util import dt as dt_util
from . import permissions as perm_mdl
from .const import GROUP_ID_ADMIN
from .util import generate_secret
TOKEN_TYPE_NORMAL = "normal"
TOKEN_TYPE_SYSTEM = "system"
@@ -96,8 +96,8 @@ class RefreshToken:
)
id = attr.ib(type=str, factory=lambda: uuid.uuid4().hex)
created_at = attr.ib(type=datetime, factory=dt_util.utcnow)
token = attr.ib(type=str, factory=lambda: generate_secret(64))
jwt_key = attr.ib(type=str, factory=lambda: generate_secret(64))
token = attr.ib(type=str, factory=lambda: secrets.token_hex(64))
jwt_key = attr.ib(type=str, factory=lambda: secrets.token_hex(64))
last_used_at = attr.ib(type=Optional[datetime], default=None)
last_used_ip = attr.ib(type=Optional[str], default=None)

View File

@@ -5,13 +5,12 @@ from typing import Any, Callable, Optional
import voluptuous as vol
from .const import CAT_ENTITIES
from .models import PermissionLookup
from .types import PolicyType
from .entities import ENTITY_POLICY_SCHEMA, compile_entities
from .merge import merge_policies # noqa: F401
from .models import PermissionLookup
from .types import PolicyType
from .util import test_all
POLICY_SCHEMA = vol.Schema({vol.Optional(CAT_ENTITIES): ENTITY_POLICY_SCHEMA})
_LOGGER = logging.getLogger(__name__)

View File

@@ -4,11 +4,10 @@ from typing import Callable, Optional
import voluptuous as vol
from .const import SUBCAT_ALL, POLICY_READ, POLICY_CONTROL, POLICY_EDIT
from .const import POLICY_CONTROL, POLICY_EDIT, POLICY_READ, SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
from .util import SubCatLookupType, lookup_all, compile_policy
from .util import SubCatLookupType, compile_policy, lookup_all
SINGLE_ENTITY_SCHEMA = vol.Any(
True,

View File

@@ -1,7 +1,7 @@
"""Merging of policies."""
from typing import cast, Dict, List, Set
from typing import Dict, List, Set, cast
from .types import PolicyType, CategoryType
from .types import CategoryType, PolicyType
def merge_policies(policies: List[PolicyType]) -> PolicyType:

View File

@@ -1,5 +1,5 @@
"""System policies."""
from .const import CAT_ENTITIES, SUBCAT_ALL, POLICY_READ
from .const import CAT_ENTITIES, POLICY_READ, SUBCAT_ALL
ADMIN_POLICY = {CAT_ENTITIES: True}

View File

@@ -1,6 +1,5 @@
"""Helpers to deal with permissions."""
from functools import wraps
from typing import Callable, Dict, List, Optional, cast
from .const import SUBCAT_ALL

View File

@@ -8,8 +8,8 @@ import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import data_entry_flow, requirements
from homeassistant.core import callback, HomeAssistant
from homeassistant.const import CONF_ID, CONF_NAME, CONF_TYPE
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import dt as dt_util
from homeassistant.util.decorator import Registry

View File

@@ -1,20 +1,18 @@
"""Auth provider that validates credentials via an external command."""
from typing import Any, Dict, Optional, cast
import asyncio.subprocess
import collections
import logging
import os
from typing import Any, Dict, Optional, cast
import voluptuous as vol
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from ..models import Credentials, UserMeta
CONF_COMMAND = "command"
CONF_ARGS = "args"
CONF_META = "meta"
@@ -78,7 +76,7 @@ class CommandLineAuthProvider(AuthProvider):
if process.returncode != 0:
_LOGGER.error(
"User %r failed to authenticate, command exited " "with code %d.",
"User %r failed to authenticate, command exited with code %d.",
username,
process.returncode,
)

View File

@@ -3,21 +3,18 @@ import asyncio
import base64
from collections import OrderedDict
import logging
from typing import Any, Dict, List, Optional, Set, cast
import bcrypt
import voluptuous as vol
from homeassistant.const import CONF_ID
from homeassistant.core import callback, HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from ..models import Credentials, UserMeta
STORAGE_VERSION = 1
STORAGE_KEY = "auth_provider.homeassistant"
@@ -203,7 +200,7 @@ class Data:
@AUTH_PROVIDERS.register("homeassistant")
class HassAuthProvider(AuthProvider):
"""Auth provider based on a local storage of users in HASS config dir."""
"""Auth provider based on a local storage of users in Home Assistant config dir."""
DEFAULT_TITLE = "Home Assistant Local"

View File

@@ -5,13 +5,12 @@ from typing import Any, Dict, Optional, cast
import voluptuous as vol
from homeassistant.exceptions import HomeAssistantError
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from ..models import Credentials, UserMeta
USER_SCHEMA = vol.Schema(
{
vol.Required("username"): str,

View File

@@ -12,9 +12,9 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from .. import AuthManager
from ..models import Credentials, UserMeta, User
from ..models import Credentials, User, UserMeta
AUTH_PROVIDER_TYPE = "legacy_api_password"
CONF_API_PASSWORD = "api_password"

View File

@@ -3,15 +3,16 @@
It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from ipaddress import ip_network, IPv4Address, IPv6Address, IPv4Network, IPv6Network
from ipaddress import IPv4Address, IPv4Network, IPv6Address, IPv6Network, ip_network
from typing import Any, Dict, List, Optional, Union, cast
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
import homeassistant.helpers.config_validation as cv
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from ..models import Credentials, UserMeta
IPAddress = Union[IPv4Address, IPv6Address]

View File

@@ -1,13 +0,0 @@
"""Auth utils."""
import binascii
import os
def generate_secret(entropy: int = 32) -> str:
"""Generate a secret.
Backport of secrets.token_hex from Python 3.6
Event loop friendly.
"""
return binascii.hexlify(os.urandom(entropy)).decode("ascii")

View File

@@ -1,22 +1,26 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
from collections import OrderedDict
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict, Set
from typing import Any, Dict, Optional, Set
import voluptuous as vol
from homeassistant import core, config as conf_util, config_entries, loader
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
from homeassistant import config as conf_util, config_entries, core, loader
from homeassistant.const import (
EVENT_HOMEASSISTANT_CLOSE,
REQUIRED_NEXT_PYTHON_DATE,
REQUIRED_NEXT_PYTHON_VER,
)
from homeassistant.exceptions import HomeAssistantError
from homeassistant.setup import async_setup_component
from homeassistant.util.logging import AsyncHandler
from homeassistant.util.package import async_get_user_site, is_virtual_env
from homeassistant.util.yaml import clear_secret_cache
from homeassistant.exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name__)
@@ -27,7 +31,7 @@ DATA_LOGGING = "logging"
DEBUGGER_INTEGRATIONS = {"ptvsd"}
CORE_INTEGRATIONS = ("homeassistant", "persistent_notification")
LOGGING_INTEGRATIONS = {"logger", "system_log"}
LOGGING_INTEGRATIONS = {"logger", "system_log", "sentry"}
STAGE_1_INTEGRATIONS = {
# To record data
"recorder",
@@ -62,7 +66,7 @@ async def async_from_config_dict(
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning(
"Skipping pip installation of required modules. " "This may cause issues"
"Skipping pip installation of required modules. This may cause issues"
)
core_config = config.get(core.DOMAIN, {})
@@ -95,11 +99,14 @@ async def async_from_config_dict(
stop = time()
_LOGGER.info("Home Assistant initialized in %.2fs", stop - start)
if sys.version_info[:3] < (3, 7, 0):
if REQUIRED_NEXT_PYTHON_DATE and sys.version_info[:3] < REQUIRED_NEXT_PYTHON_VER:
msg = (
"Python 3.6 support is deprecated and will "
"be removed in the first release after December 15, 2019. Please "
"upgrade Python to 3.7.0 or higher."
"Support for the running Python version "
f"{'.'.join(str(x) for x in sys.version_info[:3])} is deprecated and will "
f"be removed in the first release after {REQUIRED_NEXT_PYTHON_DATE}. "
"Please upgrade Python to "
f"{'.'.join(str(x) for x in REQUIRED_NEXT_PYTHON_VER)} or "
"higher."
)
_LOGGER.warning(msg)
hass.components.persistent_notification.async_create(
@@ -161,7 +168,7 @@ def async_enable_logging(
This method must be run in the event loop.
"""
fmt = "%(asctime)s %(levelname)s (%(threadName)s) " "[%(name)s] %(message)s"
fmt = "%(asctime)s %(levelname)s (%(threadName)s) [%(name)s] %(message)s"
datefmt = "%Y-%m-%d %H:%M:%S"
if not log_no_color:

View File

@@ -11,7 +11,6 @@ import logging
from homeassistant.core import split_entity_id
# mypy: allow-untyped-defs
_LOGGER = logging.getLogger(__name__)

View File

@@ -12,7 +12,7 @@
"user": {
"data": {
"password": "Adgangskode",
"username": "Email adresse"
"username": "Email-adresse"
},
"title": "Udfyld dine Abode-loginoplysninger"
}

View File

@@ -20,14 +20,14 @@ from homeassistant.const import (
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.entity import Entity
from .const import (
ATTRIBUTION,
DOMAIN,
DEFAULT_CACHEDB,
DOMAIN,
SIGNAL_CAPTURE_IMAGE,
SIGNAL_TRIGGER_QUICK_ACTION,
)
@@ -170,7 +170,7 @@ async def async_unload_entry(hass, config_entry):
def setup_hass_services(hass):
"""Home assistant services."""
"""Home Assistant services."""
def change_setting(call):
"""Change an Abode system setting."""

View File

@@ -10,7 +10,7 @@ from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from .const import DOMAIN, DEFAULT_CACHEDB # pylint: disable=unused-import
from .const import DEFAULT_CACHEDB, DOMAIN # pylint: disable=unused-import
CONF_POLLING = "polling"

View File

@@ -55,7 +55,7 @@ class AbodeLight(AbodeDevice, Light):
self._device.set_color(kwargs[ATTR_HS_COLOR])
if ATTR_BRIGHTNESS in kwargs and self._device.is_dimmable:
# Convert HASS brightness (0-255) to Abode brightness (0-99)
# Convert Home Assistant brightness (0-255) to Abode brightness (0-99)
# If 100 is sent to Abode, response is 99 causing an error
self._device.set_level(ceil(kwargs[ATTR_BRIGHTNESS] * 99 / 255.0))
else:
@@ -78,7 +78,7 @@ class AbodeLight(AbodeDevice, Light):
# Abode returns 100 during device initialization and device refresh
if brightness == 100:
return 255
# Convert Abode brightness (0-99) to HASS brightness (0-255)
# Convert Abode brightness (0-99) to Home Assistant brightness (0-255)
return ceil(brightness * 255 / 99.0)
@property

View File

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

View File

@@ -1,10 +1,8 @@
{
"domain": "acer_projector",
"name": "Acer projector",
"name": "Acer Projector",
"documentation": "https://www.home-assistant.io/integrations/acer_projector",
"requirements": [
"pyserial==3.1.1"
],
"requirements": ["pyserial==3.1.1"],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,17 +1,17 @@
"""Use serial protocol of Acer projector to obtain state of the projector."""
import logging
import re
import serial
import serial
import voluptuous as vol
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import (
STATE_ON,
STATE_OFF,
STATE_UNKNOWN,
CONF_NAME,
CONF_FILENAME,
CONF_NAME,
STATE_OFF,
STATE_ON,
STATE_UNKNOWN,
)
import homeassistant.helpers.config_validation as cv

View File

@@ -1,18 +1,19 @@
"""Support for Actiontec MI424WR (Verizon FIOS) routers."""
from collections import namedtuple
import logging
import re
import telnetlib
from collections import namedtuple
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,16 +1,18 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Denne integration kr\u00e6ver AdGuard Home {minimal_version} eller h\u00f8jere, du har {current_version}. Opdater venligst din Hass.io AdGuard Home-tilf\u00f8jelse.",
"adguard_home_outdated": "Denne integration kr\u00e6ver AdGuard Home {minimal_version} eller h\u00f8jere, du har {current_version}.",
"existing_instance_updated": "Opdaterede eksisterende konfiguration.",
"single_instance_allowed": "Det er kun n\u00f8dvendigt med en ops\u00e6tning af AdGuard Home."
"single_instance_allowed": "Kun en enkelt konfiguration af AdGuard Home er tilladt."
},
"error": {
"connection_error": "Forbindelse mislykkedes."
},
"step": {
"hassio_confirm": {
"description": "Vil du konfigurere Home Assistant til at oprette forbindelse til AdGuard Home, der leveres af Hass.io add-on: {addon}?",
"title": "AdGuard Home via Hass.io add-on"
"description": "Vil du konfigurere Home Assistant til at oprette forbindelse til AdGuard Home leveret af Hass.io-tilf\u00f8jelsen: {addon}?",
"title": "AdGuard Home via Hass.io-tilf\u00f8jelse"
},
"user": {
"data": {
@@ -21,8 +23,8 @@
"username": "Brugernavn",
"verify_ssl": "AdGuard Home bruger et korrekt certifikat"
},
"description": "Konfigurer din AdGuard Home instans for at tillade overv\u00e5gning og kontrol.",
"title": "Link AdGuard Home."
"description": "Konfigurer din AdGuard Home-instans for at tillade overv\u00e5gning og kontrol.",
"title": "Forbind din AdGuard Home."
}
},
"title": "AdGuard Home"

View File

@@ -1,6 +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}.",
"existing_instance_updated": "Bestehende Konfiguration wurde aktualisiert.",
"single_instance_allowed": "Es ist nur eine einzige Konfiguration von AdGuard Home zul\u00e4ssig."
},

View File

@@ -1,7 +1,7 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Questa integrazione richiede AdGuard Home {minimal_version} o versione successiva, si dispone di {current_version}. Aggiorna il componente aggiuntivo Hass.io AdGuard Home.",
"adguard_home_addon_outdated": "Questa integrazione richiede AdGuard Home {minimal_version} o versione successiva, si dispone di {current_version}. Aggiorna il componente aggiuntivo AdGuard Home di Hass.io.",
"adguard_home_outdated": "Questa integrazione richiede AdGuard Home {minimal_version} o versione successiva, si dispone di {current_version}.",
"existing_instance_updated": "Configurazione esistente aggiornata.",
"single_instance_allowed": "\u00c8 consentita solo una singola configurazione di AdGuard Home."
@@ -11,7 +11,7 @@
},
"step": {
"hassio_confirm": {
"description": "Vuoi configurare Home Assistant per connettersi alla AdGuard Home fornita dal componente aggiuntivo di Hass.io: {addon} ?",
"description": "Vuoi configurare Home Assistant per connettersi alla AdGuard Home fornita dal componente aggiuntivo di Hass.io: {addon}?",
"title": "AdGuard Home tramite il componente aggiuntivo di Hass.io"
},
"user": {

View File

@@ -11,7 +11,7 @@
},
"step": {
"hassio_confirm": {
"description": "Hass.io {addon} \uc560\ub4dc\uc628\uc73c\ub85c AdGuard Home \uc5d0 \uc5f0\uacb0\ud558\ub3c4\ub85d Home Assistant \ub97c \uad6c\uc131 \ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?",
"description": "Hass.io {addon} \uc560\ub4dc\uc628\uc73c\ub85c AdGuard Home \uc5d0 \uc5f0\uacb0\ud558\ub3c4\ub85d Home Assistant \ub97c \uad6c\uc131\ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c?",
"title": "Hass.io \uc560\ub4dc\uc628\uc758 AdGuard Home"
},
"user": {

View File

@@ -61,7 +61,6 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
password=entry.data[CONF_PASSWORD],
tls=entry.data[CONF_SSL],
verify_ssl=entry.data[CONF_VERIFY_SSL],
loop=hass.loop,
session=session,
)

View File

@@ -79,7 +79,6 @@ class AdGuardHomeFlowHandler(ConfigFlow):
password=user_input.get(CONF_PASSWORD),
tls=user_input[CONF_SSL],
verify_ssl=user_input[CONF_VERIFY_SSL],
loop=self.hass.loop,
session=session,
)
@@ -161,7 +160,6 @@ class AdGuardHomeFlowHandler(ConfigFlow):
self._hassio_discovery[CONF_HOST],
port=self._hassio_discovery[CONF_PORT],
tls=False,
loop=self.hass.loop,
session=session,
)

View File

@@ -1,13 +1,9 @@
{
"domain": "adguard",
"name": "AdGuard Home",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": [
"adguardhome==0.3.0"
],
"dependencies": [],
"codeowners": [
"@frenck"
]
}
"domain": "adguard",
"name": "AdGuard Home",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": ["adguardhome==0.4.0"],
"dependencies": [],
"codeowners": ["@frenck"]
}

View File

@@ -178,7 +178,7 @@ class AdGuardHomeReplacedSafeSearchSensor(AdGuardHomeSensor):
"""Initialize AdGuard Home sensor."""
super().__init__(
adguard,
"Searches Safe Search Enforced",
"AdGuard Safe Searches Enforced",
"mdi:shield-search",
"enforced_safesearch",
"requests",

View File

@@ -1,14 +1,13 @@
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import asyncio
from collections import namedtuple
import ctypes
import logging
import struct
import threading
import async_timeout
import pyads
import voluptuous as vol
from homeassistant.const import (

View File

@@ -11,7 +11,7 @@ from homeassistant.components.binary_sensor import (
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
from . import CONF_ADS_VAR, DATA_ADS, STATE_KEY_STATE, AdsEntity
_LOGGER = logging.getLogger(__name__)

View File

@@ -4,25 +4,25 @@ import logging
import voluptuous as vol
from homeassistant.components.cover import (
PLATFORM_SCHEMA,
SUPPORT_OPEN,
SUPPORT_CLOSE,
SUPPORT_STOP,
SUPPORT_SET_POSITION,
ATTR_POSITION,
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverDevice,
)
from homeassistant.const import CONF_NAME, CONF_DEVICE_CLASS
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import (
CONF_ADS_VAR,
CONF_ADS_VAR_POSITION,
DATA_ADS,
AdsEntity,
STATE_KEY_STATE,
STATE_KEY_POSITION,
STATE_KEY_STATE,
AdsEntity,
)
_LOGGER = logging.getLogger(__name__)

View File

@@ -16,9 +16,9 @@ from . import (
CONF_ADS_VAR,
CONF_ADS_VAR_BRIGHTNESS,
DATA_ADS,
AdsEntity,
STATE_KEY_BRIGHTNESS,
STATE_KEY_STATE,
AdsEntity,
)
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,10 +1,8 @@
{
"domain": "ads",
"name": "Ads",
"name": "ADS",
"documentation": "https://www.home-assistant.io/integrations/ads",
"requirements": [
"pyads==3.0.7"
],
"requirements": ["pyads==3.0.7"],
"dependencies": [],
"codeowners": []
}

View File

@@ -8,7 +8,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR, AdsEntity, STATE_KEY_STATE
from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR, STATE_KEY_STATE, AdsEntity
_LOGGER = logging.getLogger(__name__)

View File

@@ -3,11 +3,11 @@ import logging
import voluptuous as vol
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS, AdsEntity, STATE_KEY_STATE
from . import CONF_ADS_VAR, DATA_ADS, STATE_KEY_STATE, AdsEntity
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,10 +1,8 @@
{
"domain": "aftership",
"name": "Aftership",
"name": "AfterShip",
"documentation": "https://www.home-assistant.io/integrations/aftership",
"requirements": [
"pyaftership==0.1.2"
],
"requirements": ["pyaftership==0.1.2"],
"dependencies": [],
"codeowners": []
}

View File

@@ -77,7 +77,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async_add_entities([instance], True)
async def handle_add_tracking(call):
"""Call when a user adds a new Aftership tracking from HASS."""
"""Call when a user adds a new Aftership tracking from Home Assistant."""
title = call.data.get(CONF_TITLE)
slug = call.data.get(CONF_SLUG)
tracking_number = call.data[CONF_TRACKING_NUMBER]
@@ -93,7 +93,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
async def handle_remove_tracking(call):
"""Call when a user removes an Aftership tracking from HASS."""
"""Call when a user removes an Aftership tracking from Home Assistant."""
slug = call.data[CONF_SLUG]
tracking_number = call.data[CONF_TRACKING_NUMBER]

View File

@@ -2,12 +2,12 @@
from datetime import timedelta
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.config_validation import ( # noqa: F401
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,6 +1,6 @@
{
"domain": "air_quality",
"name": "Air quality",
"name": "Air Quality",
"documentation": "https://www.home-assistant.io/integrations/air_quality",
"requirements": [],
"dependencies": [],

View File

@@ -3,7 +3,7 @@
"error": {
"auth": "API-n\u00f8glen er ikke korrekt.",
"name_exists": "Navnet findes allerede.",
"wrong_location": "Ingen Airly m\u00e5lestationer i dette omr\u00e5de."
"wrong_location": "Ingen Airly-m\u00e5lestationer i dette omr\u00e5de."
},
"step": {
"user": {
@@ -13,7 +13,7 @@
"longitude": "L\u00e6ngdegrad",
"name": "Integrationens navn"
},
"description": "Konfigurer Airly luftkvalitet integration. For at generere API-n\u00f8gle, g\u00e5 til https://developer.airly.eu/register",
"description": "Konfigurer Airly luftkvalitetsintegration. For at generere API-n\u00f8gle, g\u00e5 til https://developer.airly.eu/register",
"title": "Airly"
}
},

View File

@@ -10,7 +10,6 @@ import async_timeout
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import Throttle
@@ -48,9 +47,6 @@ async def async_setup_entry(hass, config_entry):
await airly.async_update()
if not airly.data:
raise ConfigEntryNotReady()
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = airly
hass.async_create_task(

View File

@@ -1,11 +1,11 @@
"""Support for the Airly air_quality service."""
from homeassistant.components.air_quality import (
AirQualityEntity,
ATTR_AQI,
ATTR_PM_10,
ATTR_PM_2_5,
ATTR_PM_10,
AirQualityEntity,
)
from homeassistant.const import CONF_NAME
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME
from .const import (
ATTR_API_ADVICE,
@@ -35,10 +35,13 @@ 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)], True)
async_add_entities([AirlyAirQuality(data, name, unique_id)], True)
def round_state(func):
@@ -56,11 +59,12 @@ def round_state(func):
class AirlyAirQuality(AirQualityEntity):
"""Define an Airly air quality."""
def __init__(self, airly, name):
def __init__(self, airly, name, unique_id):
"""Initialize."""
self.airly = airly
self.data = airly.data
self._name = name
self._unique_id = unique_id
self._pm_2_5 = None
self._pm_10 = None
self._aqi = None
@@ -108,12 +112,12 @@ class AirlyAirQuality(AirQualityEntity):
@property
def unique_id(self):
"""Return a unique_id for this entity."""
return f"{self.airly.latitude}-{self.airly.longitude}"
return self._unique_id
@property
def available(self):
"""Return True if entity is available."""
return bool(self.airly.data)
return bool(self.data)
@property
def device_state_attributes(self):
@@ -132,7 +136,6 @@ class AirlyAirQuality(AirQualityEntity):
if self.airly.data:
self.data = self.airly.data
self._pm_10 = self.data[ATTR_API_PM10]
self._pm_2_5 = self.data[ATTR_API_PM25]
self._aqi = self.data[ATTR_API_CAQI]
self._pm_10 = self.data[ATTR_API_PM10]
self._pm_2_5 = self.data[ATTR_API_PM25]
self._aqi = self.data[ATTR_API_CAQI]

View File

@@ -1,14 +1,14 @@
"""Adds config flow for Airly."""
import async_timeout
import voluptuous as vol
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
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

View File

@@ -2,6 +2,8 @@
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_PRESSURE,
@@ -60,12 +62,16 @@ 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:
sensors.append(AirlySensor(data, name, sensor))
unique_id = f"{latitude}-{longitude}-{sensor.lower()}"
sensors.append(AirlySensor(data, name, sensor, unique_id))
async_add_entities(sensors, True)
@@ -84,11 +90,12 @@ def round_state(func):
class AirlySensor(Entity):
"""Define an Airly sensor."""
def __init__(self, airly, name, kind):
def __init__(self, airly, name, kind, unique_id):
"""Initialize."""
self.airly = airly
self.data = airly.data
self._name = name
self._unique_id = unique_id
self.kind = kind
self._device_class = None
self._state = None
@@ -130,7 +137,7 @@ class AirlySensor(Entity):
@property
def unique_id(self):
"""Return a unique_id for this entity."""
return f"{self.airly.latitude}-{self.airly.longitude}-{self.kind.lower()}"
return self._unique_id
@property
def unit_of_measurement(self):
@@ -140,7 +147,7 @@ class AirlySensor(Entity):
@property
def available(self):
"""Return True if entity is available."""
return bool(self.airly.data)
return bool(self.data)
async def async_update(self):
"""Update the sensor."""

View File

@@ -1,12 +1,8 @@
{
"domain": "airvisual",
"name": "Airvisual",
"name": "AirVisual",
"documentation": "https://www.home-assistant.io/integrations/airvisual",
"requirements": [
"pyairvisual==3.0.1"
],
"requirements": ["pyairvisual==3.0.1"],
"dependencies": [],
"codeowners": [
"@bachya"
]
"codeowners": ["@bachya"]
}

View File

@@ -194,7 +194,7 @@ class AirVisualSensor(Entity):
@property
def unique_id(self):
"""Return a unique, HASS-friendly identifier for this entity."""
"""Return a unique, Home Assistant friendly identifier for this entity."""
return f"{self._location_id}_{self._locale}_{self._type}"
@property

View File

@@ -1,10 +1,8 @@
{
"domain": "aladdin_connect",
"name": "Aladdin connect",
"name": "Aladdin Connect",
"documentation": "https://www.home-assistant.io/integrations/aladdin_connect",
"requirements": [
"aladdin_connect==0.3"
],
"requirements": ["aladdin_connect==0.3"],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,7 +1,18 @@
{
"device_automation": {
"action_type": {
"arm_away": "Tilkobl {entity_name} ude",
"arm_home": "Tilkobl {entity_name} hjemme",
"arm_night": "Tilkobl {entity_name} nat",
"disarm": "Frakobl {entity_name}",
"trigger": "Udl\u00f8s {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} tilkoblet ude",
"armed_home": "{entity_name} tilkoblet hjemme",
"armed_night": "{entity_name} tilkoblet nat",
"disarmed": "{entity_name} frakoblet",
"triggered": "{entity_name} udl\u00f8st"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"trigger_type": {
"armed_away": "{entity_name} Unterwegs",
"armed_home": "{entity_name} Zuhause",
"armed_night": "{entity_name} Nacht-Modus",
"disarmed": "{entity_name} deaktiviert",
"triggered": "{entity_name} ausgel\u00f6st"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Armar {entity_name} por la noche",
"disarm": "Desarmar {entity_name}",
"trigger": "Lanzar {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} armado fuera",
"armed_home": "{entity_name} armado en casa",
"armed_night": "{entity_name} armado modo noche",
"disarmed": "{entity_name} desarmado",
"triggered": "{entity_name} activado"
}
}
}

View File

@@ -1,11 +1,18 @@
{
"device_automation": {
"action_type": {
"arm_away": "Armer {entity_name} mode sortie",
"arm_home": "Armer {entity_name} mode \u00e0 la maison",
"arm_night": "Armer {entity_name} mode nuit",
"arm_away": "Armer {entity_name} en mode \"sortie\"",
"arm_home": "Armer {entity_name} en mode \"maison\"",
"arm_night": "Armer {entity_name} en mode \"nuit\"",
"disarm": "D\u00e9sarmer {entity_name}",
"trigger": "D\u00e9clencheur {entity_name}"
},
"trigger_type": {
"armed_away": "Armer {entity_name} en mode \"sortie\"",
"armed_home": "Armer {entity_name} en mode \"maison\"",
"armed_night": "Armer {entity_name} en mode \"nuit\"",
"disarmed": "{entity_name} d\u00e9sarm\u00e9",
"triggered": "{entity_name} d\u00e9clench\u00e9"
}
}
}

View File

@@ -0,0 +1,18 @@
{
"device_automation": {
"action_type": {
"arm_away": "{entity_name} \u00e9les\u00edt\u00e9se t\u00e1voz\u00f3 m\u00f3dban",
"arm_home": "{entity_name} \u00e9les\u00edt\u00e9se otthon marad\u00f3 m\u00f3dban",
"arm_night": "{entity_name} \u00e9les\u00edt\u00e9se \u00e9jszakai m\u00f3dban",
"disarm": "{entity_name} hat\u00e1stalan\u00edt\u00e1sa",
"trigger": "{entity_name} riaszt\u00e1si esem\u00e9ny ind\u00edt\u00e1sa"
},
"trigger_type": {
"armed_away": "{entity_name} t\u00e1voz\u00f3 m\u00f3dban lett \u00e9les\u00edtve",
"armed_home": "{entity_name} otthon marad\u00f3 m\u00f3dban lett \u00e9les\u00edtve",
"armed_night": "{entity_name} \u00e9jszakai m\u00f3dban lett \u00e9les\u00edtve",
"disarmed": "{entity_name} hat\u00e1stalan\u00edtva lett",
"triggered": "{entity_name} riaszt\u00e1sba ker\u00fclt"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "{entity_name} \uc57c\uac04\uacbd\ube44",
"disarm": "{entity_name} \uacbd\ube44\ud574\uc81c",
"trigger": "{entity_name} \ud2b8\ub9ac\uac70"
},
"trigger_type": {
"armed_away": "{entity_name} \uc774(\uac00) \uc678\ucd9c \uacbd\ube44\ubaa8\ub4dc\ub85c \uc124\uc815\ub420 \ub54c",
"armed_home": "{entity_name} \uc774(\uac00) \uc7ac\uc2e4 \uacbd\ube44\ubaa8\ub4dc\ub85c \uc124\uc815\ub420 \ub54c",
"armed_night": "{entity_name} \uc774(\uac00) \uc57c\uac04 \uacbd\ube44\ubaa8\ub4dc\ub85c \uc124\uc815\ub420 \ub54c",
"disarmed": "{entity_name} \uc774(\uac00) \ud574\uc81c\ub420 \ub54c",
"triggered": "{entity_name} \uc774(\uac00) \ud2b8\ub9ac\uac70\ub420 \ub54c"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Inschakelen {entity_name} nacht",
"disarm": "Uitschakelen {entity_name}",
"trigger": "Trigger {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} afwezig ingeschakeld",
"armed_home": "{entity_name} thuis ingeschakeld",
"armed_night": "{entity_name} nachtstand ingeschakeld",
"disarmed": "{entity_name} uitgeschakeld",
"triggered": "{entity_name} geactiveerd"
}
}
}

View File

@@ -8,9 +8,9 @@
"trigger": "Utl\u00f8ser {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} borte sikkring ",
"armed_home": "{entity_name} hjemme sikkring",
"armed_night": "{entity_name} natt sikkring",
"armed_away": "{entity_name} aktivert borte",
"armed_home": "{entity_name} aktivert hjemme",
"armed_night": "{entity_name} aktivert natt",
"disarmed": "{entity_name} deaktivert",
"triggered": "{entity_name} utl\u00f8st"
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Armar {entity_name} noite",
"disarm": "Desarmar {entity_name}",
"trigger": "Disparar {entidade_nome}"
},
"trigger_type": {
"armed_away": "{entity_name} armado modo longe",
"armed_home": "{entity_name} armadado modo casa",
"armed_night": "{entity_name} armadado para noite",
"disarmed": "{entity_name} desarmado",
"triggered": "{entity_name} acionado"
}
}
}

View File

@@ -17,9 +17,9 @@ from homeassistant.const import (
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ( # noqa: F401
make_entity_service_schema,
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
make_entity_service_schema,
)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent

View File

@@ -1,8 +1,9 @@
{
"domain": "alarm_control_panel",
"name": "Alarm control panel",
"name": "Alarm Control Panel",
"documentation": "https://www.home-assistant.io/integrations/alarm_control_panel",
"requirements": [],
"dependencies": [],
"codeowners": []
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -24,6 +24,7 @@ CONF_DEVICE_BAUD = "baudrate"
CONF_DEVICE_PATH = "path"
CONF_DEVICE_PORT = "port"
CONF_DEVICE_TYPE = "type"
CONF_AUTO_BYPASS = "autobypass"
CONF_PANEL_DISPLAY = "panel_display"
CONF_ZONE_NAME = "name"
CONF_ZONE_TYPE = "type"
@@ -39,6 +40,7 @@ DEFAULT_DEVICE_PORT = 10000
DEFAULT_DEVICE_PATH = "/dev/ttyUSB0"
DEFAULT_DEVICE_BAUD = 115200
DEFAULT_AUTO_BYPASS = False
DEFAULT_PANEL_DISPLAY = False
DEFAULT_ZONE_TYPE = "opening"
@@ -102,6 +104,7 @@ CONFIG_SCHEMA = vol.Schema(
vol.Optional(
CONF_PANEL_DISPLAY, default=DEFAULT_PANEL_DISPLAY
): cv.boolean,
vol.Optional(CONF_AUTO_BYPASS, default=DEFAULT_AUTO_BYPASS): cv.boolean,
vol.Optional(CONF_ZONES): {vol.Coerce(int): ZONE_SCHEMA},
}
)

View File

@@ -4,8 +4,8 @@ import logging
import voluptuous as vol
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel,
FORMAT_NUMBER,
AlarmControlPanel,
)
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
@@ -35,7 +35,7 @@ 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()
device = AlarmDecoderAlarmPanel(discovery_info["autobypass"])
add_entities([device])
def alarm_toggle_chime_handler(service):
@@ -66,7 +66,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class AlarmDecoderAlarmPanel(AlarmControlPanel):
"""Representation of an AlarmDecoder-based alarm panel."""
def __init__(self):
def __init__(self, auto_bypass):
"""Initialize the alarm panel."""
self._display = ""
self._name = "Alarm Panel"
@@ -80,6 +80,7 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
self._programming_mode = None
self._ready = None
self._zone_bypassed = None
self._auto_bypass = auto_bypass
async def async_added_to_hass(self):
"""Register callbacks."""
@@ -158,11 +159,15 @@ class AlarmDecoderAlarmPanel(AlarmControlPanel):
def alarm_arm_away(self, code=None):
"""Send arm away command."""
if code:
if self._auto_bypass:
self.hass.data[DATA_AD].send(f"{code!s}6#")
self.hass.data[DATA_AD].send(f"{code!s}2")
def alarm_arm_home(self, code=None):
"""Send arm home command."""
if code:
if self._auto_bypass:
self.hass.data[DATA_AD].send(f"{code!s}6#")
self.hass.data[DATA_AD].send(f"{code!s}3")
def alarm_arm_night(self, code=None):

View File

@@ -1,10 +1,8 @@
{
"domain": "alarmdecoder",
"name": "Alarmdecoder",
"name": "AlarmDecoder",
"documentation": "https://www.home-assistant.io/integrations/alarmdecoder",
"requirements": [
"alarmdecoder==1.13.2"
],
"requirements": ["alarmdecoder==1.13.9"],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,10 +1,8 @@
{
"domain": "alarmdotcom",
"name": "Alarmdotcom",
"name": "Alarm.com",
"documentation": "https://www.home-assistant.io/integrations/alarmdotcom",
"requirements": [
"pyalarmdotcom==0.3.2"
],
"requirements": ["pyalarmdotcom==0.3.2"],
"dependencies": [],
"codeowners": []
}

View File

@@ -1,30 +1,30 @@
"""Support for repeating alerts when conditions are met."""
import asyncio
import logging
from datetime import timedelta
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_MESSAGE,
ATTR_TITLE,
ATTR_DATA,
DOMAIN as DOMAIN_NOTIFY,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_ENTITY_ID,
STATE_IDLE,
CONF_NAME,
CONF_STATE,
STATE_ON,
STATE_OFF,
SERVICE_TURN_ON,
SERVICE_TURN_OFF,
SERVICE_TOGGLE,
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_IDLE,
STATE_OFF,
STATE_ON,
)
from homeassistant.helpers import service, event
from homeassistant.helpers import event, service
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.util.dt import now
@@ -213,7 +213,7 @@ class Alert(ToggleEntity):
@property
def should_poll(self):
"""HASS need not poll these entities."""
"""Home Assistant need not poll these entities."""
return False
@property

View File

@@ -4,8 +4,7 @@
"documentation": "https://www.home-assistant.io/integrations/alert",
"requirements": [],
"dependencies": [],
"after_dependencies": [
"notify"
],
"codeowners": []
"after_dependencies": ["notify"],
"codeowners": [],
"quality_scale": "internal"
}

View File

@@ -3,31 +3,33 @@ import logging
import voluptuous as vol
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import entityfilter
from homeassistant.const import CONF_NAME
from homeassistant.helpers import config_validation as cv, entityfilter
from . import flash_briefings, intent, smart_home_http
from .const import (
CONF_AUDIO,
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_DESCRIPTION,
CONF_DISPLAY_CATEGORIES,
CONF_DISPLAY_URL,
CONF_ENDPOINT,
CONF_ENTITY_CONFIG,
CONF_FILTER,
CONF_LOCALE,
CONF_SUPPORTED_LOCALES,
CONF_TEXT,
CONF_TITLE,
CONF_UID,
DOMAIN,
CONF_FILTER,
CONF_ENTITY_CONFIG,
CONF_DESCRIPTION,
CONF_DISPLAY_CATEGORIES,
)
_LOGGER = logging.getLogger(__name__)
CONF_FLASH_BRIEFINGS = "flash_briefings"
CONF_SMART_HOME = "smart_home"
DEFAULT_LOCALE = "en-US"
ALEXA_ENTITY_SCHEMA = vol.Schema(
{
@@ -42,6 +44,9 @@ SMART_HOME_SCHEMA = vol.Schema(
vol.Optional(CONF_ENDPOINT): cv.string,
vol.Optional(CONF_CLIENT_ID): cv.string,
vol.Optional(CONF_CLIENT_SECRET): cv.string,
vol.Optional(CONF_LOCALE, default=DEFAULT_LOCALE): vol.In(
CONF_SUPPORTED_LOCALES
),
vol.Optional(CONF_FILTER, default={}): entityfilter.FILTER_SCHEMA,
vol.Optional(CONF_ENTITY_CONFIG): {cv.entity_id: ALEXA_ENTITY_SCHEMA},
}

View File

@@ -1,8 +1,9 @@
"""Support for Alexa skill auth."""
import asyncio
from datetime import timedelta
import json
import logging
from datetime import timedelta
import aiohttp
import async_timeout
@@ -50,7 +51,7 @@ class Auth:
"client_secret": self.client_secret,
}
_LOGGER.debug(
"Calling LWA to get the access token (first time), " "with: %s",
"Calling LWA to get the access token (first time), with: %s",
json.dumps(lwa_params),
)

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,11 @@ class AbstractConfig:
"""Endpoint for report state."""
return None
@property
def locale(self):
"""Return config locale."""
return None
@property
def entity_config(self):
"""Return entity config."""

View File

@@ -1,9 +1,9 @@
"""Constants for the Alexa integration."""
from collections import OrderedDict
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.components.climate import const as climate
from homeassistant.components import fan
from homeassistant.components.climate import const as climate
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
DOMAIN = "alexa"
@@ -19,6 +19,7 @@ CONF_ENTITY_CONFIG = "entity_config"
CONF_ENDPOINT = "endpoint"
CONF_CLIENT_ID = "client_id"
CONF_CLIENT_SECRET = "client_secret"
CONF_LOCALE = "locale"
ATTR_UID = "uid"
ATTR_UPDATE_DATE = "updateDate"
@@ -42,6 +43,20 @@ API_CHANGE = "change"
CONF_DESCRIPTION = "description"
CONF_DISPLAY_CATEGORIES = "display_categories"
CONF_SUPPORTED_LOCALES = (
"de-DE",
"en-AU",
"en-CA",
"en-GB",
"en-IN",
"en-US",
"es-ES",
"es-MX",
"fr-CA",
"fr-FR",
"it-IT",
"ja-JP",
)
API_TEMP_UNITS = {TEMP_FAHRENHEIT: "FAHRENHEIT", TEMP_CELSIUS: "CELSIUS"}
@@ -117,163 +132,6 @@ class Cause:
VOICE_INTERACTION = "VOICE_INTERACTION"
class Catalog:
"""The Global Alexa catalog.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog
You can use the global Alexa catalog for pre-defined names of devices, settings, values, and units.
This catalog is localized into all the languages that Alexa supports.
You can reference the following catalog of pre-defined friendly names.
Each item in the following list is an asset identifier followed by its supported friendly names.
The first friendly name for each identifier is the one displayed in the Alexa mobile app.
"""
LABEL_ASSET = "asset"
LABEL_TEXT = "text"
# Shower
DEVICENAME_SHOWER = "Alexa.DeviceName.Shower"
# Washer, Washing Machine
DEVICENAME_WASHER = "Alexa.DeviceName.Washer"
# Router, Internet Router, Network Router, Wifi Router, Net Router
DEVICENAME_ROUTER = "Alexa.DeviceName.Router"
# Fan, Blower
DEVICENAME_FAN = "Alexa.DeviceName.Fan"
# Air Purifier, Air Cleaner,Clean Air Machine
DEVICENAME_AIRPURIFIER = "Alexa.DeviceName.AirPurifier"
# Space Heater, Portable Heater
DEVICENAME_SPACEHEATER = "Alexa.DeviceName.SpaceHeater"
# Rain Head, Overhead shower, Rain Shower, Rain Spout, Rain Faucet
SHOWER_RAINHEAD = "Alexa.Shower.RainHead"
# Handheld Shower, Shower Wand, Hand Shower
SHOWER_HANDHELD = "Alexa.Shower.HandHeld"
# Water Temperature, Water Temp, Water Heat
SETTING_WATERTEMPERATURE = "Alexa.Setting.WaterTemperature"
# Temperature, Temp
SETTING_TEMPERATURE = "Alexa.Setting.Temperature"
# Wash Cycle, Wash Preset, Wash setting
SETTING_WASHCYCLE = "Alexa.Setting.WashCycle"
# 2.4G Guest Wi-Fi, 2.4G Guest Network, Guest Network 2.4G, 2G Guest Wifi
SETTING_2GGUESTWIFI = "Alexa.Setting.2GGuestWiFi"
# 5G Guest Wi-Fi, 5G Guest Network, Guest Network 5G, 5G Guest Wifi
SETTING_5GGUESTWIFI = "Alexa.Setting.5GGuestWiFi"
# Guest Wi-fi, Guest Network, Guest Net
SETTING_GUESTWIFI = "Alexa.Setting.GuestWiFi"
# Auto, Automatic, Automatic Mode, Auto Mode
SETTING_AUTO = "Alexa.Setting.Auto"
# #Night, Night Mode
SETTING_NIGHT = "Alexa.Setting.Night"
# Quiet, Quiet Mode, Noiseless, Silent
SETTING_QUIET = "Alexa.Setting.Quiet"
# Oscillate, Swivel, Oscillation, Spin, Back and forth
SETTING_OSCILLATE = "Alexa.Setting.Oscillate"
# Fan Speed, Airflow speed, Wind Speed, Air speed, Air velocity
SETTING_FANSPEED = "Alexa.Setting.FanSpeed"
# Preset, Setting
SETTING_PRESET = "Alexa.Setting.Preset"
# Mode
SETTING_MODE = "Alexa.Setting.Mode"
# Direction
SETTING_DIRECTION = "Alexa.Setting.Direction"
# Delicates, Delicate
VALUE_DELICATE = "Alexa.Value.Delicate"
# Quick Wash, Fast Wash, Wash Quickly, Speed Wash
VALUE_QUICKWASH = "Alexa.Value.QuickWash"
# Maximum, Max
VALUE_MAXIMUM = "Alexa.Value.Maximum"
# Minimum, Min
VALUE_MINIMUM = "Alexa.Value.Minimum"
# High
VALUE_HIGH = "Alexa.Value.High"
# Low
VALUE_LOW = "Alexa.Value.Low"
# Medium, Mid
VALUE_MEDIUM = "Alexa.Value.Medium"
class Unit:
"""Alexa Units of Measure.
https://developer.amazon.com/docs/device-apis/alexa-property-schemas.html#units-of-measure
"""
ANGLE_DEGREES = "Alexa.Unit.Angle.Degrees"
ANGLE_RADIANS = "Alexa.Unit.Angle.Radians"
DISTANCE_FEET = "Alexa.Unit.Distance.Feet"
DISTANCE_INCHES = "Alexa.Unit.Distance.Inches"
DISTANCE_KILOMETERS = "Alexa.Unit.Distance.Kilometers"
DISTANCE_METERS = "Alexa.Unit.Distance.Meters"
DISTANCE_MILES = "Alexa.Unit.Distance.Miles"
DISTANCE_YARDS = "Alexa.Unit.Distance.Yards"
MASS_GRAMS = "Alexa.Unit.Mass.Grams"
MASS_KILOGRAMS = "Alexa.Unit.Mass.Kilograms"
PERCENT = "Alexa.Unit.Percent"
TEMPERATURE_CELSIUS = "Alexa.Unit.Temperature.Celsius"
TEMPERATURE_DEGREES = "Alexa.Unit.Temperature.Degrees"
TEMPERATURE_FAHRENHEIT = "Alexa.Unit.Temperature.Fahrenheit"
TEMPERATURE_KELVIN = "Alexa.Unit.Temperature.Kelvin"
VOLUME_CUBICFEET = "Alexa.Unit.Volume.CubicFeet"
VOLUME_CUBICMETERS = "Alexa.Unit.Volume.CubicMeters"
VOLUME_GALLONS = "Alexa.Unit.Volume.Gallons"
VOLUME_LITERS = "Alexa.Unit.Volume.Liters"
VOLUME_PINTS = "Alexa.Unit.Volume.Pints"
VOLUME_QUARTS = "Alexa.Unit.Volume.Quarts"
WEIGHT_OUNCES = "Alexa.Unit.Weight.Ounces"
WEIGHT_POUNDS = "Alexa.Unit.Weight.Pounds"
class Inputs:
"""Valid names for the InputController.
@@ -353,3 +211,11 @@ class Inputs:
"video3": "VIDEO 3",
"xbox": "XBOX",
}
VALID_SOUND_MODE_MAP = {
"movie": "MOVIE",
"music": "MUSIC",
"night": "NIGHT",
"sport": "SPORT",
"tv": "TV",
}

View File

@@ -1,7 +1,26 @@
"""Alexa entity adapters."""
from typing import List
from homeassistant.core import callback
from homeassistant.components import (
alarm_control_panel,
alert,
automation,
binary_sensor,
cover,
fan,
group,
image_processing,
input_boolean,
input_number,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
)
from homeassistant.components.climate import const as climate
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_SUPPORTED_FEATURES,
@@ -11,27 +30,9 @@ from homeassistant.const import (
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
from homeassistant.core import callback
from homeassistant.util.decorator import Registry
from homeassistant.components.climate import const as climate
from homeassistant.components import (
alarm_control_panel,
alert,
automation,
binary_sensor,
cover,
fan,
group,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
)
from .const import CONF_DESCRIPTION, CONF_DISPLAY_CATEGORIES
from .capabilities import (
Alexa,
AlexaBrightnessController,
@@ -41,6 +42,8 @@ from .capabilities import (
AlexaContactSensor,
AlexaDoorbellEventSource,
AlexaEndpointHealth,
AlexaEqualizerController,
AlexaEventDetectionSensor,
AlexaInputController,
AlexaLockController,
AlexaModeController,
@@ -60,6 +63,7 @@ from .capabilities import (
AlexaThermostatController,
AlexaToggleController,
)
from .const import CONF_DESCRIPTION, CONF_DISPLAY_CATEGORIES
ENTITY_ADAPTERS = Registry()
@@ -81,6 +85,9 @@ class DisplayCategory:
# Indicates media devices with video or photo capabilities.
CAMERA = "CAMERA"
# Indicates a non-mobile computer, such as a desktop computer.
COMPUTER = "COMPUTER"
# Indicates an endpoint that detects and reports contact.
CONTACT_SENSOR = "CONTACT_SENSOR"
@@ -90,27 +97,60 @@ class DisplayCategory:
# Indicates a doorbell.
DOORBELL = "DOORBELL"
# Indicates a window covering on the outside of a structure.
EXTERIOR_BLIND = "EXTERIOR_BLIND"
# Indicates a fan.
FAN = "FAN"
# Indicates a game console, such as Microsoft Xbox or Nintendo Switch
GAME_CONSOLE = "GAME_CONSOLE"
# Indicates a garage door. Garage doors must implement the ModeController interface to open and close the door.
GARAGE_DOOR = "GARAGE_DOOR"
# Indicates a window covering on the inside of a structure.
INTERIOR_BLIND = "INTERIOR_BLIND"
# Indicates a laptop or other mobile computer.
LAPTOP = "LAPTOP"
# Indicates light sources or fixtures.
LIGHT = "LIGHT"
# Indicates a microwave oven.
MICROWAVE = "MICROWAVE"
# Indicates a mobile phone.
MOBILE_PHONE = "MOBILE_PHONE"
# Indicates an endpoint that detects and reports motion.
MOTION_SENSOR = "MOTION_SENSOR"
# Indicates a network-connected music system.
MUSIC_SYSTEM = "MUSIC_SYSTEM"
# An endpoint that cannot be described in on of the other categories.
OTHER = "OTHER"
# Indicates a network router.
NETWORK_HARDWARE = "NETWORK_HARDWARE"
# Indicates an oven cooking appliance.
OVEN = "OVEN"
# Indicates a non-mobile phone, such as landline or an IP phone.
PHONE = "PHONE"
# Describes a combination of devices set to a specific state, when the
# order of the state change is not important. For example a bedtime scene
# might include turning off lights and lowering the thermostat, but the
# order is unimportant. Applies to Scenes
SCENE_TRIGGER = "SCENE_TRIGGER"
# Indicates a projector screen.
SCREEN = "SCREEN"
# Indicates a security panel.
SECURITY_PANEL = "SECURITY_PANEL"
@@ -124,10 +164,16 @@ class DisplayCategory:
# Indicates the endpoint is a speaker or speaker system.
SPEAKER = "SPEAKER"
# Indicates a streaming device such as Apple TV, Chromecast, or Roku.
STREAMING_DEVICE = "STREAMING_DEVICE"
# Indicates in-wall switches wired to the electrical system. Can control a
# variety of devices.
SWITCH = "SWITCH"
# Indicates a tablet computer.
TABLET = "TABLET"
# Indicates endpoints that report the temperature only.
TEMPERATURE_SENSOR = "TEMPERATURE_SENSOR"
@@ -138,6 +184,9 @@ class DisplayCategory:
# Indicates the endpoint is a television.
TV = "TV"
# Indicates a network-connected wearable device, such as an Apple Watch, Fitbit, or Samsung Gear.
WEARABLE = "WEARABLE"
class AlexaEntity:
"""An adaptation of an entity, expressed in Alexa's terms.
@@ -211,16 +260,24 @@ class AlexaEntity:
def serialize_discovery(self):
"""Serialize the entity for discovery."""
return {
result = {
"displayCategories": self.display_categories(),
"cookie": {},
"endpointId": self.alexa_id(),
"friendlyName": self.friendly_name(),
"description": self.description(),
"manufacturerName": "Home Assistant",
"capabilities": [i.serialize_discovery() for i in self.interfaces()],
}
locale = self.config.locale
capabilities = []
for i in self.interfaces():
if locale in i.supported_locales:
capabilities.append(i.serialize_discovery())
result["capabilities"] = capabilities
return result
@callback
def async_get_entities(hass, config) -> List[AlexaEntity]:
@@ -316,20 +373,40 @@ class CoverCapabilities(AlexaEntity):
def default_display_categories(self):
"""Return the display categories for this entity."""
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
if device_class in (cover.DEVICE_CLASS_GARAGE, cover.DEVICE_CLASS_DOOR):
if device_class == cover.DEVICE_CLASS_GARAGE:
return [DisplayCategory.GARAGE_DOOR]
if device_class == cover.DEVICE_CLASS_DOOR:
return [DisplayCategory.DOOR]
if device_class in (
cover.DEVICE_CLASS_BLIND,
cover.DEVICE_CLASS_SHADE,
cover.DEVICE_CLASS_CURTAIN,
):
return [DisplayCategory.INTERIOR_BLIND]
if device_class in (
cover.DEVICE_CLASS_WINDOW,
cover.DEVICE_CLASS_AWNING,
cover.DEVICE_CLASS_SHUTTER,
):
return [DisplayCategory.EXTERIOR_BLIND]
return [DisplayCategory.OTHER]
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 AlexaPercentageController(self.entity)
if supported & (cover.SUPPORT_CLOSE | cover.SUPPORT_OPEN):
yield AlexaRangeController(
self.entity, instance=f"{cover.DOMAIN}.{cover.ATTR_POSITION}"
)
elif supported & (cover.SUPPORT_CLOSE | cover.SUPPORT_OPEN):
yield AlexaModeController(
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 AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@@ -353,6 +430,7 @@ class LightCapabilities(AlexaEntity):
yield AlexaColorController(self.entity)
if supported & light.SUPPORT_COLOR_TEMP:
yield AlexaColorTemperatureController(self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@@ -368,6 +446,7 @@ class FanCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaPowerController(self.entity)
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & fan.SUPPORT_SET_SPEED:
yield AlexaPercentageController(self.entity)
@@ -375,7 +454,6 @@ class FanCapabilities(AlexaEntity):
yield AlexaRangeController(
self.entity, instance=f"{fan.DOMAIN}.{fan.ATTR_SPEED}"
)
if supported & fan.SUPPORT_OSCILLATE:
yield AlexaToggleController(
self.entity, instance=f"{fan.DOMAIN}.{fan.ATTR_OSCILLATING}"
@@ -453,6 +531,9 @@ class MediaPlayerCapabilities(AlexaEntity):
if supported & media_player.const.SUPPORT_PLAY_MEDIA:
yield AlexaChannelController(self.entity)
if supported & media_player.const.SUPPORT_SELECT_SOUND_MODE:
yield AlexaEqualizerController(self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@@ -522,6 +603,7 @@ class BinarySensorCapabilities(AlexaEntity):
TYPE_CONTACT = "contact"
TYPE_MOTION = "motion"
TYPE_PRESENCE = "presence"
def default_display_categories(self):
"""Return the display categories for this entity."""
@@ -530,6 +612,8 @@ class BinarySensorCapabilities(AlexaEntity):
return [DisplayCategory.CONTACT_SENSOR]
if sensor_type is self.TYPE_MOTION:
return [DisplayCategory.MOTION_SENSOR]
if sensor_type is self.TYPE_PRESENCE:
return [DisplayCategory.CAMERA]
def interfaces(self):
"""Yield the supported interfaces."""
@@ -538,7 +622,10 @@ class BinarySensorCapabilities(AlexaEntity):
yield AlexaContactSensor(self.hass, self.entity)
elif sensor_type is self.TYPE_MOTION:
yield AlexaMotionSensor(self.hass, self.entity)
elif sensor_type is self.TYPE_PRESENCE:
yield AlexaEventDetectionSensor(self.hass, self.entity)
# yield additional interfaces based on specified display category in config.
entity_conf = self.config.entity_config.get(self.entity.entity_id, {})
if CONF_DISPLAY_CATEGORIES in entity_conf:
if entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.DOORBELL:
@@ -547,6 +634,8 @@ class BinarySensorCapabilities(AlexaEntity):
yield AlexaContactSensor(self.hass, self.entity)
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.MOTION_SENSOR:
yield AlexaMotionSensor(self.hass, self.entity)
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.CAMERA:
yield AlexaEventDetectionSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@@ -554,11 +643,20 @@ class BinarySensorCapabilities(AlexaEntity):
def get_type(self):
"""Return the type of binary sensor."""
attrs = self.entity.attributes
if attrs.get(ATTR_DEVICE_CLASS) in ("door", "garage_door", "opening", "window"):
if attrs.get(ATTR_DEVICE_CLASS) in (
binary_sensor.DEVICE_CLASS_DOOR,
binary_sensor.DEVICE_CLASS_GARAGE_DOOR,
binary_sensor.DEVICE_CLASS_OPENING,
binary_sensor.DEVICE_CLASS_WINDOW,
):
return self.TYPE_CONTACT
if attrs.get(ATTR_DEVICE_CLASS) == "motion":
if attrs.get(ATTR_DEVICE_CLASS) == binary_sensor.DEVICE_CLASS_MOTION:
return self.TYPE_MOTION
if attrs.get(ATTR_DEVICE_CLASS) == binary_sensor.DEVICE_CLASS_PRESENCE:
return self.TYPE_PRESENCE
@ENTITY_ADAPTERS.register(alarm_control_panel.DOMAIN)
class AlarmControlPanelCapabilities(AlexaEntity):
@@ -574,3 +672,36 @@ class AlarmControlPanelCapabilities(AlexaEntity):
yield AlexaSecurityPanelController(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(image_processing.DOMAIN)
class ImageProcessingCapabilities(AlexaEntity):
"""Class to represent image_processing capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.CAMERA]
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaEventDetectionSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(input_number.DOMAIN)
class InputNumberCapabilities(AlexaEntity):
"""Class to represent input_number capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.OTHER]
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaRangeController(
self.entity, instance=f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}"
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)

View File

@@ -3,10 +3,10 @@ import copy
import logging
import uuid
import homeassistant.util.dt as dt_util
from homeassistant.components import http
from homeassistant.core import callback
from homeassistant.helpers import template
import homeassistant.util.dt as dt_util
from .const import (
ATTR_MAIN_TEXT,

View File

@@ -3,7 +3,14 @@ import logging
import math
from homeassistant import core as ha
from homeassistant.components import cover, fan, group, light, media_player
from homeassistant.components import (
cover,
fan,
group,
input_number,
light,
media_player,
)
from homeassistant.components.climate import const as climate
from homeassistant.const import (
ATTR_ENTITY_ID,
@@ -20,6 +27,7 @@ from homeassistant.const import (
SERVICE_MEDIA_PREVIOUS_TRACK,
SERVICE_MEDIA_STOP,
SERVICE_SET_COVER_POSITION,
SERVICE_SET_COVER_TILT_POSITION,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
SERVICE_UNLOCK,
@@ -28,26 +36,24 @@ from homeassistant.const import (
SERVICE_VOLUME_SET,
SERVICE_VOLUME_UP,
STATE_ALARM_DISARMED,
STATE_CLOSED,
STATE_OPEN,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
import homeassistant.util.color as color_util
import homeassistant.util.dt as dt_util
from homeassistant.util.decorator import Registry
import homeassistant.util.dt as dt_util
from homeassistant.util.temperature import convert as convert_temperature
from .const import (
API_TEMP_UNITS,
API_THERMOSTAT_MODES_CUSTOM,
API_THERMOSTAT_MODES,
API_THERMOSTAT_MODES_CUSTOM,
API_THERMOSTAT_PRESETS,
Cause,
Inputs,
PERCENTAGE_FAN_MAP,
RANGE_FAN_MAP,
SPEED_FAN_MAP,
Cause,
Inputs,
)
from .entities import async_get_entities
from .errors import (
@@ -113,9 +119,7 @@ async def async_api_turn_on(hass, config, directive, context):
domain = ha.DOMAIN
service = SERVICE_TURN_ON
if domain == cover.DOMAIN:
service = cover.SERVICE_OPEN_COVER
elif domain == media_player.DOMAIN:
if 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:
@@ -141,9 +145,7 @@ async def async_api_turn_off(hass, config, directive, context):
domain = ha.DOMAIN
service = SERVICE_TURN_OFF
if entity.domain == cover.DOMAIN:
service = cover.SERVICE_CLOSE_COVER
elif domain == media_player.DOMAIN:
if 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:
@@ -348,10 +350,6 @@ async def async_api_set_percentage(hass, config, directive, context):
speed = "high"
data[fan.ATTR_SPEED] = speed
elif entity.domain == cover.DOMAIN:
service = SERVICE_SET_COVER_POSITION
data[cover.ATTR_POSITION] = percentage
await hass.services.async_call(
entity.domain, service, data, blocking=False, context=context
)
@@ -385,13 +383,6 @@ async def async_api_adjust_percentage(hass, config, directive, context):
data[fan.ATTR_SPEED] = speed
elif entity.domain == cover.DOMAIN:
service = SERVICE_SET_COVER_POSITION
current = entity.attributes.get(cover.ATTR_POSITION)
data[cover.ATTR_POSITION] = max(0, percentage_delta + current)
await hass.services.async_call(
entity.domain, service, data, blocking=False, context=context
)
@@ -421,6 +412,10 @@ async def async_api_lock(hass, config, directive, context):
@HANDLERS.register(("Alexa.LockController", "Unlock"))
async def async_api_unlock(hass, config, directive, context):
"""Process an unlock request."""
if config.locale not in {"de-DE", "en-US", "ja-JP"}:
msg = f"The unlock directive is not supported for the following locales: {config.locale}"
raise AlexaInvalidDirectiveError(msg)
entity = directive.entity
await hass.services.async_call(
entity.domain,
@@ -960,32 +955,35 @@ async def async_api_disarm(hass, config, directive, context):
@HANDLERS.register(("Alexa.ModeController", "SetMode"))
async def async_api_set_mode(hass, config, directive, context):
"""Process a next request."""
"""Process a SetMode directive."""
entity = directive.entity
instance = directive.instance
domain = entity.domain
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
capability_mode = directive.payload["mode"]
if domain not in (fan.DOMAIN, cover.DOMAIN):
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
mode = directive.payload["mode"]
# Fan Direction
if instance == f"{fan.DOMAIN}.{fan.ATTR_DIRECTION}":
_, direction = capability_mode.split(".")
_, direction = mode.split(".")
if direction in (fan.DIRECTION_REVERSE, fan.DIRECTION_FORWARD):
service = fan.SERVICE_SET_DIRECTION
data[fan.ATTR_DIRECTION] = direction
if instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
_, position = capability_mode.split(".")
# Cover Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
_, position = mode.split(".")
if position == STATE_CLOSED:
if position == cover.STATE_CLOSED:
service = cover.SERVICE_CLOSE_COVER
if position == STATE_OPEN:
elif position == cover.STATE_OPEN:
service = cover.SERVICE_OPEN_COVER
elif position == "custom":
service = cover.SERVICE_STOP_COVER
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
domain, service, data, blocking=False, context=context
@@ -997,7 +995,7 @@ async def async_api_set_mode(hass, config, directive, context):
"namespace": "Alexa.ModeController",
"instance": instance,
"name": "mode",
"value": capability_mode,
"value": mode,
}
)
@@ -1008,24 +1006,13 @@ async def async_api_set_mode(hass, config, directive, context):
async def async_api_adjust_mode(hass, config, directive, context):
"""Process a AdjustMode request.
Requires modeResources to be ordered.
Only modes that are ordered support the adjustMode directive.
Requires capabilityResources supportedModes to be ordered.
Only supportedModes with ordered=True support the adjustMode directive.
"""
entity = directive.entity
instance = directive.instance
domain = entity.domain
if domain != fan.DOMAIN:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
if instance is None:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
# No modeResources are currently ordered to support this request.
return directive.response()
# Currently no supportedModes are configured with ordered=True to support this request.
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
@HANDLERS.register(("Alexa.ToggleController", "TurnOn"))
@@ -1037,19 +1024,29 @@ async def async_api_toggle_on(hass, config, directive, context):
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
if domain != fan.DOMAIN:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
# Fan Oscillating
if instance == f"{fan.DOMAIN}.{fan.ATTR_OSCILLATING}":
service = fan.SERVICE_OSCILLATE
data[fan.ATTR_OSCILLATING] = True
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
domain, service, data, blocking=False, context=context
)
return directive.response()
response = directive.response()
response.add_context_property(
{
"namespace": "Alexa.ToggleController",
"instance": instance,
"name": "toggleState",
"value": "ON",
}
)
return response
@HANDLERS.register(("Alexa.ToggleController", "TurnOff"))
@@ -1061,19 +1058,29 @@ async def async_api_toggle_off(hass, config, directive, context):
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
if domain != fan.DOMAIN:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
# Fan Oscillating
if instance == f"{fan.DOMAIN}.{fan.ATTR_OSCILLATING}":
service = fan.SERVICE_OSCILLATE
data[fan.ATTR_OSCILLATING] = False
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
domain, service, data, blocking=False, context=context
)
return directive.response()
response = directive.response()
response.add_context_property(
{
"namespace": "Alexa.ToggleController",
"instance": instance,
"name": "toggleState",
"value": "OFF",
}
)
return response
@HANDLERS.register(("Alexa.RangeController", "SetRangeValue"))
@@ -1084,15 +1091,12 @@ async def async_api_set_range(hass, config, directive, context):
domain = entity.domain
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
range_value = int(directive.payload["rangeValue"])
if domain != fan.DOMAIN:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
range_value = directive.payload["rangeValue"]
# Fan Speed
if instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
service = fan.SERVICE_SET_SPEED
speed = SPEED_FAN_MAP.get(range_value, None)
speed = SPEED_FAN_MAP.get(int(range_value))
if not speed:
msg = "Entity does not support value"
@@ -1103,11 +1107,55 @@ async def async_api_set_range(hass, config, directive, context):
data[fan.ATTR_SPEED] = speed
# Cover Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
range_value = int(range_value)
if range_value == 0:
service = cover.SERVICE_CLOSE_COVER
elif range_value == 100:
service = cover.SERVICE_OPEN_COVER
else:
service = cover.SERVICE_SET_COVER_POSITION
data[cover.ATTR_POSITION] = range_value
# Cover Tilt Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
range_value = int(range_value)
if range_value == 0:
service = cover.SERVICE_CLOSE_COVER_TILT
elif range_value == 100:
service = cover.SERVICE_OPEN_COVER_TILT
else:
service = cover.SERVICE_SET_COVER_TILT_POSITION
data[cover.ATTR_POSITION] = range_value
# Input Number Value
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
range_value = float(range_value)
service = input_number.SERVICE_SET_VALUE
min_value = float(entity.attributes[input_number.ATTR_MIN])
max_value = float(entity.attributes[input_number.ATTR_MAX])
data[input_number.ATTR_VALUE] = min(max_value, max(min_value, range_value))
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
domain, service, data, blocking=False, context=context
)
return directive.response()
response = directive.response()
response.add_context_property(
{
"namespace": "Alexa.RangeController",
"instance": instance,
"name": "rangeValue",
"value": range_value,
}
)
return response
@HANDLERS.register(("Alexa.RangeController", "AdjustRangeValue"))
@@ -1118,25 +1166,71 @@ async def async_api_adjust_range(hass, config, directive, context):
domain = entity.domain
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
range_delta = int(directive.payload["rangeValueDelta"])
range_delta = directive.payload["rangeValueDelta"]
response_value = 0
# Fan Speed
if instance == f"{fan.DOMAIN}.{fan.ATTR_SPEED}":
range_delta = int(range_delta)
service = fan.SERVICE_SET_SPEED
# adjust range
current_range = RANGE_FAN_MAP.get(entity.attributes.get(fan.ATTR_SPEED), 0)
speed = SPEED_FAN_MAP.get(max(0, range_delta + current_range), fan.SPEED_OFF)
speed = SPEED_FAN_MAP.get(
min(3, max(0, range_delta + current_range)), fan.SPEED_OFF
)
if speed == fan.SPEED_OFF:
service = fan.SERVICE_TURN_OFF
data[fan.ATTR_SPEED] = speed
data[fan.ATTR_SPEED] = response_value = speed
# Cover Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
range_delta = 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)
)
# Cover Tilt Position
elif instance == f"{cover.DOMAIN}.{cover.ATTR_TILT_POSITION}":
range_delta = 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)
)
# Input Number Value
elif instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
range_delta = float(range_delta)
service = input_number.SERVICE_SET_VALUE
min_value = float(entity.attributes[input_number.ATTR_MIN])
max_value = float(entity.attributes[input_number.ATTR_MAX])
current = float(entity.state)
data[input_number.ATTR_VALUE] = response_value = min(
max_value, max(min_value, range_delta + current)
)
else:
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
await hass.services.async_call(
domain, service, data, blocking=False, context=context
)
return directive.response()
response = directive.response()
response.add_context_property(
{
"namespace": "Alexa.RangeController",
"instance": instance,
"name": "rangeValue",
"value": response_value,
}
)
return response
@HANDLERS.register(("Alexa.ChannelController", "ChangeChannel"))
@@ -1262,3 +1356,43 @@ async def async_api_seek(hass, config, directive, context):
return directive.response(
name="StateReport", namespace="Alexa.SeekController", payload=payload
)
@HANDLERS.register(("Alexa.EqualizerController", "SetMode"))
async def async_api_set_eq_mode(hass, config, directive, context):
"""Process a SetMode request for EqualizerController."""
mode = directive.payload["mode"]
entity = directive.entity
data = {ATTR_ENTITY_ID: entity.entity_id}
sound_mode_list = entity.attributes.get(media_player.const.ATTR_SOUND_MODE_LIST)
if sound_mode_list and mode.lower() in sound_mode_list:
data[media_player.const.ATTR_SOUND_MODE] = mode.lower()
else:
msg = "failed to map sound mode {} to a mode on {}".format(
mode, entity.entity_id
)
raise AlexaInvalidValueError(msg)
await hass.services.async_call(
entity.domain,
media_player.SERVICE_SELECT_SOUND_MODE,
data,
blocking=False,
context=context,
)
return directive.response()
@HANDLERS.register(("Alexa.EqualizerController", "AdjustBands"))
@HANDLERS.register(("Alexa.EqualizerController", "ResetBands"))
@HANDLERS.register(("Alexa.EqualizerController", "SetBands"))
async def async_api_bands_directive(hass, config, directive, context):
"""Handle an AdjustBands, ResetBands, SetBands request.
Only mode directives are currently supported for the EqualizerController.
"""
# Currently bands directives are not supported.
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)

View File

@@ -1,11 +1,8 @@
{
"domain": "alexa",
"name": "Alexa",
"name": "Amazon Alexa",
"documentation": "https://www.home-assistant.io/integrations/alexa",
"requirements": [],
"dependencies": ["http"],
"codeowners": [
"@home-assistant/cloud",
"@ochlocracy"
]
"codeowners": ["@home-assistant/cloud", "@ochlocracy"]
}

View File

@@ -0,0 +1,387 @@
"""Alexa Resources and Assets."""
class AlexaGlobalCatalog:
"""The Global Alexa catalog.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog
You can use the global Alexa catalog for pre-defined names of devices, settings, values, and units.
This catalog is localized into all the languages that Alexa supports.
You can reference the following catalog of pre-defined friendly names.
Each item in the following list is an asset identifier followed by its supported friendly names.
The first friendly name for each identifier is the one displayed in the Alexa mobile app.
"""
# Air Purifier, Air Cleaner,Clean Air Machine
DEVICE_NAME_AIR_PURIFIER = "Alexa.DeviceName.AirPurifier"
# Fan, Blower
DEVICE_NAME_FAN = "Alexa.DeviceName.Fan"
# Router, Internet Router, Network Router, Wifi Router, Net Router
DEVICE_NAME_ROUTER = "Alexa.DeviceName.Router"
# Shade, Blind, Curtain, Roller, Shutter, Drape, Awning, Window shade, Interior blind
DEVICE_NAME_SHADE = "Alexa.DeviceName.Shade"
# Shower
DEVICE_NAME_SHOWER = "Alexa.DeviceName.Shower"
# Space Heater, Portable Heater
DEVICE_NAME_SPACE_HEATER = "Alexa.DeviceName.SpaceHeater"
# Washer, Washing Machine
DEVICE_NAME_WASHER = "Alexa.DeviceName.Washer"
# 2.4G Guest Wi-Fi, 2.4G Guest Network, Guest Network 2.4G, 2G Guest Wifi
SETTING_2G_GUEST_WIFI = "Alexa.Setting.2GGuestWiFi"
# 5G Guest Wi-Fi, 5G Guest Network, Guest Network 5G, 5G Guest Wifi
SETTING_5G_GUEST_WIFI = "Alexa.Setting.5GGuestWiFi"
# Auto, Automatic, Automatic Mode, Auto Mode
SETTING_AUTO = "Alexa.Setting.Auto"
# Direction
SETTING_DIRECTION = "Alexa.Setting.Direction"
# Dry Cycle, Dry Preset, Dry Setting, Dryer Cycle, Dryer Preset, Dryer Setting
SETTING_DRY_CYCLE = "Alexa.Setting.DryCycle"
# Fan Speed, Airflow speed, Wind Speed, Air speed, Air velocity
SETTING_FAN_SPEED = "Alexa.Setting.FanSpeed"
# Guest Wi-fi, Guest Network, Guest Net
SETTING_GUEST_WIFI = "Alexa.Setting.GuestWiFi"
# Heat
SETTING_HEAT = "Alexa.Setting.Heat"
# Mode
SETTING_MODE = "Alexa.Setting.Mode"
# Night, Night Mode
SETTING_NIGHT = "Alexa.Setting.Night"
# Opening, Height, Lift, Width
SETTING_OPENING = "Alexa.Setting.Opening"
# Oscillate, Swivel, Oscillation, Spin, Back and forth
SETTING_OSCILLATE = "Alexa.Setting.Oscillate"
# Preset, Setting
SETTING_PRESET = "Alexa.Setting.Preset"
# Quiet, Quiet Mode, Noiseless, Silent
SETTING_QUIET = "Alexa.Setting.Quiet"
# Temperature, Temp
SETTING_TEMPERATURE = "Alexa.Setting.Temperature"
# Wash Cycle, Wash Preset, Wash setting
SETTING_WASH_CYCLE = "Alexa.Setting.WashCycle"
# Water Temperature, Water Temp, Water Heat
SETTING_WATER_TEMPERATURE = "Alexa.Setting.WaterTemperature"
# Handheld Shower, Shower Wand, Hand Shower
SHOWER_HAND_HELD = "Alexa.Shower.HandHeld"
# Rain Head, Overhead shower, Rain Shower, Rain Spout, Rain Faucet
SHOWER_RAIN_HEAD = "Alexa.Shower.RainHead"
# Degrees, Degree
UNIT_ANGLE_DEGREES = "Alexa.Unit.Angle.Degrees"
# Radians, Radian
UNIT_ANGLE_RADIANS = "Alexa.Unit.Angle.Radians"
# Feet, Foot
UNIT_DISTANCE_FEET = "Alexa.Unit.Distance.Feet"
# Inches, Inch
UNIT_DISTANCE_INCHES = "Alexa.Unit.Distance.Inches"
# Kilometers
UNIT_DISTANCE_KILOMETERS = "Alexa.Unit.Distance.Kilometers"
# Meters, Meter, m
UNIT_DISTANCE_METERS = "Alexa.Unit.Distance.Meters"
# Miles, Mile
UNIT_DISTANCE_MILES = "Alexa.Unit.Distance.Miles"
# Yards, Yard
UNIT_DISTANCE_YARDS = "Alexa.Unit.Distance.Yards"
# Grams, Gram, g
UNIT_MASS_GRAMS = "Alexa.Unit.Mass.Grams"
# Kilograms, Kilogram, kg
UNIT_MASS_KILOGRAMS = "Alexa.Unit.Mass.Kilograms"
# Percent
UNIT_PERCENT = "Alexa.Unit.Percent"
# Celsius, Degrees Celsius, Degrees, C, Centigrade, Degrees Centigrade
UNIT_TEMPERATURE_CELSIUS = "Alexa.Unit.Temperature.Celsius"
# Degrees, Degree
UNIT_TEMPERATURE_DEGREES = "Alexa.Unit.Temperature.Degrees"
# Fahrenheit, Degrees Fahrenheit, Degrees F, Degrees, F
UNIT_TEMPERATURE_FAHRENHEIT = "Alexa.Unit.Temperature.Fahrenheit"
# Kelvin, Degrees Kelvin, Degrees K, Degrees, K
UNIT_TEMPERATURE_KELVIN = "Alexa.Unit.Temperature.Kelvin"
# Cubic Feet, Cubic Foot
UNIT_VOLUME_CUBIC_FEET = "Alexa.Unit.Volume.CubicFeet"
# Cubic Meters, Cubic Meter, Meters Cubed
UNIT_VOLUME_CUBIC_METERS = "Alexa.Unit.Volume.CubicMeters"
# Gallons, Gallon
UNIT_VOLUME_GALLONS = "Alexa.Unit.Volume.Gallons"
# Liters, Liter, L
UNIT_VOLUME_LITERS = "Alexa.Unit.Volume.Liters"
# Pints, Pint
UNIT_VOLUME_PINTS = "Alexa.Unit.Volume.Pints"
# Quarts, Quart
UNIT_VOLUME_QUARTS = "Alexa.Unit.Volume.Quarts"
# Ounces, Ounce, oz
UNIT_WEIGHT_OUNCES = "Alexa.Unit.Weight.Ounces"
# Pounds, Pound, lbs
UNIT_WEIGHT_POUNDS = "Alexa.Unit.Weight.Pounds"
# Close
VALUE_CLOSE = "Alexa.Value.Close"
# Delicates, Delicate
VALUE_DELICATE = "Alexa.Value.Delicate"
# High
VALUE_HIGH = "Alexa.Value.High"
# Low
VALUE_LOW = "Alexa.Value.Low"
# Maximum, Max
VALUE_MAXIMUM = "Alexa.Value.Maximum"
# Medium, Mid
VALUE_MEDIUM = "Alexa.Value.Medium"
# Minimum, Min
VALUE_MINIMUM = "Alexa.Value.Minimum"
# Open
VALUE_OPEN = "Alexa.Value.Open"
# Quick Wash, Fast Wash, Wash Quickly, Speed Wash
VALUE_QUICK_WASH = "Alexa.Value.QuickWash"
class AlexaCapabilityResource:
"""Base class for Alexa capabilityResources, ModeResources, and presetResources objects.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#capability-resources
"""
def __init__(self, labels):
"""Initialize an Alexa resource."""
self._resource_labels = []
for label in labels:
self._resource_labels.append(label)
def serialize_capability_resources(self):
"""Return capabilityResources object serialized for an API response."""
return self.serialize_labels(self._resource_labels)
@staticmethod
def serialize_configuration():
"""Return ModeResources, PresetResources friendlyNames serialized for an API response."""
return []
@staticmethod
def serialize_labels(resources):
"""Return resource label objects for friendlyNames serialized for an API response."""
labels = []
for label in resources:
if label in AlexaGlobalCatalog.__dict__.values():
label = {"@type": "asset", "value": {"assetId": label}}
else:
label = {"@type": "text", "value": {"text": label, "locale": "en-US"}}
labels.append(label)
return {"friendlyNames": labels}
class AlexaModeResource(AlexaCapabilityResource):
"""Implements Alexa ModeResources.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#capability-resources
"""
def __init__(self, labels, ordered=False):
"""Initialize an Alexa modeResource."""
super().__init__(labels)
self._supported_modes = []
self._mode_ordered = ordered
def add_mode(self, value, labels):
"""Add mode to the supportedModes object."""
self._supported_modes.append({"value": value, "labels": labels})
def serialize_configuration(self):
"""Return configuration for ModeResources friendlyNames serialized for an API response."""
mode_resources = []
for mode in self._supported_modes:
result = {
"value": mode["value"],
"modeResources": self.serialize_labels(mode["labels"]),
}
mode_resources.append(result)
return {"ordered": self._mode_ordered, "supportedModes": mode_resources}
class AlexaPresetResource(AlexaCapabilityResource):
"""Implements Alexa PresetResources.
Use presetResources with RangeController to provide a set of friendlyNames for each RangeController preset.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#presetresources
"""
def __init__(self, labels, min_value, max_value, precision, unit=None):
"""Initialize an Alexa presetResource."""
super().__init__(labels)
self._presets = []
self._minimum_value = min_value
self._maximum_value = max_value
self._precision = precision
self._unit_of_measure = None
if unit in AlexaGlobalCatalog.__dict__.values():
self._unit_of_measure = unit
def add_preset(self, value, labels):
"""Add preset to configuration presets array."""
self._presets.append({"value": value, "labels": labels})
def serialize_configuration(self):
"""Return configuration for PresetResources friendlyNames serialized for an API response."""
configuration = {
"supportedRange": {
"minimumValue": self._minimum_value,
"maximumValue": self._maximum_value,
"precision": self._precision,
}
}
if self._unit_of_measure:
configuration["unitOfMeasure"] = self._unit_of_measure
if self._presets:
preset_resources = []
for preset in self._presets:
preset_resources.append(
{
"rangeValue": preset["value"],
"presetResources": self.serialize_labels(preset["labels"]),
}
)
configuration["presets"] = preset_resources
return configuration
class AlexaSemantics:
"""Class for Alexa Semantics Object.
You can optionally enable additional utterances by using semantics. When you use semantics,
you manually map the phrases "open", "close", "raise", and "lower" to directives.
Semantics is supported for the following interfaces only: ModeController, RangeController, and ToggleController.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#semantics-object
"""
MAPPINGS_ACTION = "actionMappings"
MAPPINGS_STATE = "stateMappings"
ACTIONS_TO_DIRECTIVE = "ActionsToDirective"
STATES_TO_VALUE = "StatesToValue"
STATES_TO_RANGE = "StatesToRange"
ACTION_CLOSE = "Alexa.Actions.Close"
ACTION_LOWER = "Alexa.Actions.Lower"
ACTION_OPEN = "Alexa.Actions.Open"
ACTION_RAISE = "Alexa.Actions.Raise"
STATES_OPEN = "Alexa.States.Open"
STATES_CLOSED = "Alexa.States.Closed"
DIRECTIVE_RANGE_SET_VALUE = "SetRangeValue"
DIRECTIVE_RANGE_ADJUST_VALUE = "AdjustRangeValue"
DIRECTIVE_TOGGLE_TURN_ON = "TurnOn"
DIRECTIVE_TOGGLE_TURN_OFF = "TurnOff"
DIRECTIVE_MODE_SET_MODE = "SetMode"
DIRECTIVE_MODE_ADJUST_MODE = "AdjustMode"
def __init__(self):
"""Initialize an Alexa modeResource."""
self._action_mappings = []
self._state_mappings = []
def _add_action_mapping(self, semantics):
"""Add action mapping between actions and interface directives."""
self._action_mappings.append(semantics)
def _add_state_mapping(self, semantics):
"""Add state mapping between states and interface directives."""
self._state_mappings.append(semantics)
def add_states_to_value(self, states, value):
"""Add StatesToValue stateMappings."""
self._add_state_mapping(
{"@type": self.STATES_TO_VALUE, "states": states, "value": value}
)
def add_states_to_range(self, states, min_value, max_value):
"""Add StatesToRange stateMappings."""
self._add_state_mapping(
{
"@type": self.STATES_TO_RANGE,
"states": states,
"range": {"minimumValue": min_value, "maximumValue": max_value},
}
)
def add_action_to_directive(self, actions, directive, payload):
"""Add ActionsToDirective actionMappings."""
self._add_action_mapping(
{
"@type": self.ACTIONS_TO_DIRECTIVE,
"actions": actions,
"directive": {"name": directive, "payload": payload},
}
)
def serialize_semantics(self):
"""Return semantics object serialized for an API response."""
semantics = {}
if self._action_mappings:
semantics[self.MAPPINGS_ACTION] = self._action_mappings
if self._state_mappings:
semantics[self.MAPPINGS_STATE] = self._state_mappings
return semantics

View File

@@ -4,7 +4,7 @@ import logging
import homeassistant.core as ha
from .const import API_DIRECTIVE, API_HEADER
from .errors import AlexaError, AlexaBridgeUnreachableError
from .errors import AlexaBridgeUnreachableError, AlexaError
from .handlers import HANDLERS
from .messages import AlexaDirective

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