Compare commits

...

665 Commits

Author SHA1 Message Date
Pascal Vizeli
2d7208470e Merge pull request #28354 from home-assistant/rc
0.101.0
2019-10-30 21:20:32 +01:00
Pascal Vizeli
7eceedea10 Bump version 0.101.0 2019-10-30 19:50:48 +00:00
springstan
8aee92347f Fix KeyError in decora setup (#28279)
* Imported homeassistant.util and slugified address if no name is specified

* Added a custom validator function in case name is not set in config

* Removed logger.debug line only used for testing
2019-10-30 19:47:14 +00:00
Paulus Schoutsen
cf6d11db8d Bumped version to 0.101.0b4 2019-10-29 16:17:34 -07:00
Bram Kragten
c104efc18d Updated frontend to 20191025.1 (#28327) 2019-10-29 16:16:41 -07:00
Pascal Vizeli
f021e5832a Cleanup not needed websocket flags for ingress (#28295) 2019-10-29 16:16:10 -07:00
Paulus Schoutsen
070790ccc9 Bumped version to 0.101.0b3 2019-10-28 11:28:45 -07:00
jjlawren
0e2b55e60e Bump library to 0.0.3 (#28294) 2019-10-28 11:28:40 -07:00
Erik Montnemery
4a25bab1b3 Fix broken deconz trigger (#28211) 2019-10-28 11:28:39 -07:00
Erik Montnemery
3cedee3fea Add above and below to sensor condition extra_fields (#27364)
* Add above and below to sensor condition extra_fields

* Change unit_of_measurement to suffix in extra_fields

* Check if sensor has unit when getting capabilities

* Improve tests
2019-10-28 11:28:39 -07:00
michaeldavie
82ed84ba43 Bump env_canada to 0.0.27 (#28239) 2019-10-26 22:27:21 +02:00
Paulus Schoutsen
c456b725fd Bumped version to 0.101.0b2 2019-10-25 10:49:42 -07:00
Bram Kragten
524f5a7264 Updated frontend to 20191025.0 (#28208) 2019-10-25 10:49:36 -07:00
gngj
637a16799f Fix microsoft tts (#28199)
* Update pycsspeechtts

From 1.0.2 to 1.0.3 as the old one is using an api that doesn't work

* Give a option to choose region

Api is now region dependent, so gave it a config
2019-10-25 10:49:35 -07:00
SukramJ
4df6b3c76a Partially revert tensorflow import move (#28184)
* Revert "Refactor imports for tensorflow (#27617)"

This reverts commit 5a83a92390.

* move only some imports to top

* fix lint

* add comments
2019-10-25 10:49:35 -07:00
jjlawren
05ee15c28c Update Plex via websockets (#28158)
* Save client identifier from auth for future use

* Use websocket events to update Plex

* Handle websocket disconnections

* Use aiohttp, shut down socket cleanly

* Bad rebase fix

* Don't connect websocket during config_flow validation, fix tests

* Move websocket handling to external library

* Close websocket session on HA stop

* Use external library, revert unnecessary test change

* Async & lint fixes

* Clean up websocket stopper on entry unload

* Setup websocket in component, pass actual needed object to library
2019-10-25 10:49:34 -07:00
Paulus Schoutsen
0a5cde7ac3 Bumped version to 0.101.0b1 2019-10-24 13:53:30 -07:00
Otto Winter
c64fe19260 Fix ESPHome stacktraces when removing entity and shutting down (#28185) 2019-10-24 13:53:17 -07:00
Otto Winter
8f232f3c69 Bump aioesphomeapi to 2.4.1 (#28170)
* Bump aioesphomeapi to 2.4.1

* Update requirements

* Bump to 2.4.2
2019-10-24 13:53:16 -07:00
Alexei Chetroi
059d2572a2 Fixes/zha ieee tail (#28160)
* Fix ZHA entity_id assignment.

* Update tests.
2019-10-24 13:53:16 -07:00
Paulus Schoutsen
3b934166a5 Bumped version to 0.101.0b0 2019-10-23 13:37:01 -07:00
Paulus Schoutsen
23289459ca Update translations 2019-10-23 13:36:38 -07:00
Bram Kragten
2b36fe421c Updated frontend to 20191023.0 (#28150) 2019-10-23 13:22:07 -07:00
Ville Skyttä
6a731a68cd Parallelize pylint everywhere (#28149)
* Run 2 pylint jobs by default

* Run pylint with autodetected number of jobs in Travis

Gives a ~25% speedup there at the moment.
2019-10-23 13:18:41 -07:00
Rami Mosleh
7cb6607b1f Allow multiple Transmission clients and add unique_id to entities (#28136)
* Allow multiple clients + improvements

* remove commented code

* fixed test_init.py
2019-10-23 13:09:11 -07:00
Villhellm
062ec8a7c2 changed STATE_OFF to STATE_STANDBY (#28148) 2019-10-23 13:03:52 -07:00
On Freund
1412862f2a Config entry and device for Coolmaster integration (#27925)
* Config entry and device for Coolmaster integration

* Lint/isort/flake/etc...

* Black formatting

* Code review fixes

* Config flow tests for coolmaster

* Add pycoolmaster requirement to test

* Remove port selection from Coolmaster config flow

* Update config_flow.py

* More idoimatic hash concat
2019-10-23 12:47:00 -07:00
fredericvl
b6fd191dc4 Add support for SAJ inverters connected via WiFi (#27742)
* Add support for SAJ inverters connected via WiFi

* Changes after review for saj
2019-10-23 12:11:04 -07:00
ochlocracy
65d8c70377 Rebase Implement Alexa.DoorbellEventSource Interface Controller (#27726) 2019-10-23 11:41:26 -07:00
Pascal Vizeli
0771dc3a37 Downgrade aioHTTP 3.6.2 to 3.6.1 (#28143) 2019-10-23 11:37:37 -07:00
Adrien Foulon
85eefe41da Fix supported_features in mqtt cover (#28120)
* Correctly compute the supported_features in cover.mqtt

* Update homeassistant/components/mqtt/cover.py

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

* Correctly compute the supported_features in cover.mqtt

* Format
2019-10-23 10:44:47 -07:00
libots
b8d2c58c60 Support for additional Abode timeline events (#28124)
* Support for additional timeline events

* Update __init__.py

* Expose details on user

These lines expose apptype and event_by, which can be used to give information on events initiated by keypad users (vs. users on the mobile app, web app, or those initiated from HA through abodepy).
2019-10-23 10:41:58 -07:00
Jon Gilmore
a3f3ea4e25 Fix Lutron Pico (#27059)
* removed a nesting level

* Lutron Pico fix

* Reverted logging change

Was unaware that f-strings aren't used in logging commands, reverted the usage

* Reverted logging change

Was unaware that f-strings aren't used in logging commands, reverted the usage

* fixed logic
2019-10-23 18:29:30 +02:00
Marius Flage
86700ec1ac Avoid query operations on a pjlink powered off projector (#28132) 2019-10-23 18:25:00 +02:00
SukramJ
efae75103a Cleanup typing and asserts for HomematicIP Cloud (#28144)
* Cleanup assert in Homematic IP Cloud Tests

* Cleanup typing
2019-10-23 18:21:49 +02:00
Ville Skyttä
7431e26752 Round system monitor load averages to 2 decimal digits (#27558)
On a Raspberry Pi 3, Python 3.7.4:

  # python3 -c "import os; print(os.getloadavg())"
  (0.2724609375, 0.3505859375, 0.3515625)
2019-10-23 08:57:51 -07:00
Diefferson Koderer Môro
4d8539e151 Move imports in raspihats component (#28088)
* Move imports in raspihats component

* Comment require

* Disable pylint for import-error

* Revert move imports

* Remove unnecessary pylint disable error

* Update homeassistant/components/raspihats/__init__.py

Co-Authored-By: cgtobi <cgtobi@users.noreply.github.com>

* Apply suggestions from code review

Co-Authored-By: cgtobi <cgtobi@users.noreply.github.com>
2019-10-23 08:53:05 -07:00
Diefferson Koderer Môro
14be60e5bf Move imports in nuheat component (#28038)
* Move imports in nuheat component

* Fix tox tests

* Fix tox tests

* Update tests/components/nuheat/test_init.py

@Balloob suggested the change because direct replacement, the mock would never be reverted and impact the other tests.

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2019-10-23 08:30:38 -07:00
Alain Turbide
b1a374062b Add Alexa.ChannelController functions for media players (#27671)
* Added missing Alexa.ChannelController functions. Specifically ChangeChannel
and SkipChannel commands. These functions will call the play_media function
 in a media_player app if it has the capability published and pass on the
  channel# or channel name. The selected media player can then use this to
   select the channel on the device it is associated to.
Modified the existing Alexa.StepSpeaker Setvolume function to actually do
a stepped volume change using the steps sent by Alexa. The Alexa default
 step of 10 for a simple volume up/down can be changed via an exposed
 media_player attribute called volume_step_default.
 The default is set to 1. Any other value then default will be sent
 as sequential volume up /down to the media_player.

* The test code has some weird behaviour with passed boolean values.  Had to surround them in quotes for the tests to pass properly.

* Reverted test_smart_home.py change. Issue was not the boolean value but the behavior in the handler. The test suite does not like multiple await calls in a loop. Will investigate further.  The handler code works though.

* Added ChannelController/SkipChannels test in test_smart_home.py
Added test for callSign payload attribute.

* Modified smart home test to allow more than one call to services

* Added more tests for ChannelChange functions for various payload options.
Removed name options from metadata payload section. not needed.

* Reverted assert call change in alexa test __init__.py back to ==1. Not sure if it was the cause of the pytest's failing on github

* Corrected a comment.  First commit after a rebase.

* Comment line change.  Also wanted to force a code check on github.

* Added a loop delay in StepSpeaker and SkipChannel functions for safety

* Removed uneeded sleep from for loops.  Let remote handle delays
Moved service type decision out of for loops in ChannelController and StepSpeaker
Used constants instead of numeric values for support options in test module

* Change media_player const import to be more specific in source

* Modifed test_smart_home to use media_play constants instead of hardcode valu

* Removed unecessary test volume_step_default attribute from test_smart_home

* Removed uneeded comment in StepSpeaker function.
Re-ordered constants in test_smart_home.py

* Modified call to media_player play_media service to use media_player constant instead of hard coded value.

* Changed constant use to be consistant with rest of function.

* Correct merge conflicts in handlers.py and capablities.py
2019-10-23 08:28:23 -07:00
rolfberkenbosch
09b322b8a4 Fix issues with new tile 2020 devices (#28133)
* Update meteoalertapi to version 0.1.6

* Fix tile to supporting 2020 tile devices
2019-10-23 07:49:47 -06:00
Per-Øyvind Bruun
852cbad965 New platform for Microsoft Teams (#27981)
* New Microsoft Teams notification service

* Updated codeowners

* Updated requirements_all

* Changed from WEBHOOK_ID to URL

* Moved try/except block
2019-10-23 09:32:14 +02:00
jjlawren
44bf9e9ddc Additional SSL validation checks for cert_expiry (#28047)
* Additional SSL validation checks

* Add validity attribute, log errors on import

* Don't log from sensor
2019-10-22 23:34:12 -07:00
jjlawren
a644182b5e Save client identifier from Plex auth for future use (#27951)
* Save client identifier from auth for future use

* Bump requirements

* Stick with version 1
2019-10-22 23:32:57 -07:00
Ernst Klamer
acc3646ef3 Add Solar-Log platform (#27036)
* Add Solar-Log sensor

* Codeowners update

* Update homeassistant/components/solarlog/manifest.json

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

* remove sunwatcher from gen_requirements_all.py

* remove sunwatcher from requirements_test_all.txt

* Remove scan_interval as configuration variable

I've set it to a fixed scan_interval of 1 minute. Removed the configuration option.

* Fix black format

* Config flow added (__init__.py)

* Config flow added (manifest.json)

* Config flow added (const.py)

* Config flow added (config_flow.py)

* Config flow added (strings.json)

* Config flow added (en.json translation)

* Config flow added (sensor.py rewritten)

* Config flow added (sensor.py)

* Config flow added (config_flows.py)

* resolve conflict config_flows.py

* Add tests

* add tests

* add tests

* Update .coverage to include all files for solarlog

* Fix await the unload

* Adjust icons, add http:// to default host

* Change icons

* Add http:// to host if not provided, fix await

* Add http:// to host if not provided, fix await

* Adjust tests for http:// added to host

* remove line

* Remove without http:// requirement

* Remove without http;// requirement
2019-10-22 23:31:43 -07:00
Paulus Schoutsen
b27dc5bd39 Merge remote-tracking branch 'origin/master' into dev 2019-10-22 23:22:24 -07:00
Diefferson Koderer Môro
6025630772 Move imports in melissa component (#28021)
* Move imports in melissa component

* Fix tox tests
2019-10-22 23:19:00 -07:00
Nikolay Vasilchuk
734704c1f7 Squeezebox LMS reconnect (#27378)
* Fix

* Review
2019-10-22 23:18:00 -07:00
Nikolay Vasilchuk
62a3dc1a94 Open Hardware Monitor Sensor reconnect (#28052)
* raise PlatformNotReady

* Don't show errors on reconnect
2019-10-22 23:17:34 -07:00
Diefferson Koderer Môro
b4054add61 Move imports in wake_on_lan component (#28100)
* Move imports in wake_on_lan component

* Fix tox tests
2019-10-22 23:14:52 -07:00
Ville Skyttä
c8b2860167 Fix bootstrap dev dependencies message (#28114)
https://github.com/home-assistant/home-assistant/pull/28060#discussion_r337701541
2019-10-22 23:12:57 -07:00
Santobert
50e9a9df4f Timer reproduce state (#28117) 2019-10-22 23:12:17 -07:00
Matt Schmitt
f67813e145 Fix service descriptions (#28122) 2019-10-22 23:09:28 -07:00
Lukas
65263bdef9 Fix #28104 - CalDav support for floating datetimes (#28123)
* Fix #28104 - CalDav support for floating datetimes

Timzones are optional in CalDav

It is possible that an entry contains neither a TZID, nor is an UTC time.
When this is the case, it should be treated as a floating date-time value,
which represent the same hour, minute, and second value regardless of which
time zone is currently being observed.

For Home-Assistant the correct timezone therefore is whatever is configured
as local time in the settings.

See https://www.kanzaki.com/docs/ical/dateTime.html

* Revert "Fix #28104 - CalDav support for floating datetimes"

This reverts commit cf32a6e390.

* add test case: floating events fail with error without patch

* Fix #28104 - CalDav support for floating datetimes

Timzones are optional in CalDav

It is possible that an entry contains neither a TZID, nor is an UTC time.
When this is the case, it should be treated as a floating date-time value,
which represent the same hour, minute, and second value regardless of which
time zone is currently being observed.

For Home-Assistant the correct timezone therefore is whatever is configured
as local time in the settings.

See https://www.kanzaki.com/docs/ical/dateTime.html

* style fix
2019-10-22 23:08:38 -07:00
Santobert
703cd96186 Add improved scene support to the input_datetime integration (#28105)
* input_datetime reproduce state

* simplify service decision
2019-10-22 23:03:38 -07:00
javicalle
8bdec13bad Move imports in hue component (#28121) 2019-10-22 22:58:57 -07:00
SteveDinn
25fd930d67 Add template filters to convert objects to and from JSON strings (#27909)
* Added filters to convert objects to and from JSON strings.

* Added extra spacing.

* Removed try/catch to get native exceptions

* Added tests.
2019-10-22 22:51:29 -07:00
Matt Kasa
ab22c61764 Support SmartStrip type devices (HS300, HS107) in tplink component (#26220)
* Add support for SmartStrip type devices (HS300, HS107) to tplink component

* Incorporate feedback from @MartinHjelmare using changes suggested by @shbatm

- Setting `_state` now uses a list comprehension
- `_alias` will use aliases from the Kasa app
- `_device_id` will be set to `_mac` for single plugs to retain backwards compatibility
2019-10-22 22:46:18 -07:00
Fredrik Erlandsson
09d8a4204a Add support for resource_template for rest sensor (#27869)
* add support for resource_template

* fix tests

* updated tests and xor(CONF_RESOURCE_TEMPLATE, CONF_RESOURCE)
2019-10-22 22:43:28 -07:00
Raman Gupta
4cb984842a Support custom source type for MQTT device tracker (#27838)
* support custom source type for MQTT device tracker

* fix typo

* add abbreviation
2019-10-22 22:26:29 -07:00
Marc Hörsken
e3f0c904b0 Add option to specify mDNS advertised IP address for HomeKit Bridge (#26791)
* Add options to specify advertised IP and MAC for HomeKit Bridge

This makes use of HAP-python's new feature in version 2.6.0
that allows to specify the mDNS advertised IP and MAC address.

This is a requirement for the following use cases:
- Running Home Assistant behind a NAT, e.g. inside Docker.
- Running it on a system with multiple interfaces there
  the default IP address, DNS entry and hostname diverge.

The forwarding of the required mDNS packets can be done with
an avahi-daemon based gateway, e.g. by using enable-reflector=yes.

Specifying the MAC address makes it possible to identify an
accessory in case HA is run inside a ephemeral docker container.

Whitespace changes were performed due to black and flake8.

* Update tests for HomeKit Bridge due to IP and MAC advertising

Whitespace changes were performed due to black and flake8.

* Remove the possibility to set the MAC address of the HomeKit Bridge

Since the MAC address is a random device ID, there is no need
for the user to be able to set a custom MAC address value for it.

Whitespace changes were performed due to black and flake8.
2019-10-22 22:06:21 -07:00
ochlocracy
da094e09fa Implement ToggleController, RangeController, and ModeController in alexa (#27302)
* Implement AlexaToggleController, AlexaRangeController, and AlexaModeController interfaces.

* Implement AlexaToggleController, AlexaRangeController, and AlexaModeController interfaces.

* Unkerfuffled comments to please the pydocstyle gods.

* Unkerfuffled comments in Tests to please the pydocstyle gods.

* Added additional test for more coverage.

* Removed OSCILLATING property check from from ModeController.

* Added capability report tests for ModeController, ToggleController, RangeController, PowerLevelController.

* Update homeassistant/components/alexa/capabilities.py

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

* Update homeassistant/components/alexa/capabilities.py

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

* Corrected mis-spelling of AlexaCapability class.

* Changed instance from method to property in AlexaCapability class.

* Refactored to add {entity.domain}.{entity.attribute} to the instance name.

* Improved type handling for configuration object.
Added additional test for configuration object.

* Added Tests for unsupported domains for ModeController and RangeController

* Made changes to improve future scaling for other domains.

* Split fan range to speed maps into multiple constants.
2019-10-22 22:01:03 -07:00
HomeAssistant Azure
dc3aa43f73 [ci skip] Translation update 2019-10-23 00:32:15 +00:00
Franck Nijhof
adb15286b4 Fix test coverage, reverting top level import ptvsd (#28118) 2019-10-22 16:13:34 -07:00
Erik Montnemery
4700d647b0 Minor tweaks for sensor device automations (#27829)
* Minor tweaks for sensor device automations

* Change unit_of_measurement to suffix in extra_fields

* Address review comment
2019-10-22 11:40:07 -07:00
Diefferson Koderer Môro
04dbe5bc84 Move imports in dsmr component (#27974)
* Move imports in dsmr component

* Review

* Fix tests
2019-10-22 18:50:49 +02:00
bastshoes
0226b76e0a Add support SQL VACUUM for PostgeSQL (#28106)
* Add support SQL VACUUM for PostgeSQL

VACUUM PostgreSQL DB if repack is true

* Update tests
2019-10-22 08:39:26 -07:00
Santobert
c2c9213e9b Add improved scene support to the counter integration (#28103)
* Add improved scene support to the counter integration

* Remove comment
2019-10-22 08:28:06 -07:00
Pascal Roeleven
37bf577284 Add support for more Orange Pi devices (#28109)
* Bump OPi.GPIO to 0.4.0

* Move imports to top-level
2019-10-22 08:23:39 -07:00
Mark Coombes
09b4f65515 Add modelnumber for ecobee4 (#28107) 2019-10-22 08:22:42 -07:00
Fabian Affolter
acee87bef6 Support to use Whatsapp numbers (fixes ##28065) (#28078) 2019-10-22 09:00:58 +02:00
Diefferson Koderer Môro
77d55a3b15 Move imports in isy994 component (#28004) 2019-10-21 22:40:49 -07:00
Diefferson Koderer Môro
4a54b130cb Move imports in ptvsd component (#28087) 2019-10-21 22:39:36 -07:00
Diefferson Koderer Môro
3692c7496e Move imports in gtfs component (#27999)
* Move imports in gtfs component

* Fix pylint
2019-10-21 22:38:33 -07:00
Diefferson Koderer Môro
ff17bb4a56 Move imports in knx component (#28008)
* Move imports in knx component

* Fix pylint
2019-10-21 22:38:21 -07:00
Diefferson Koderer Môro
6c18bbcf04 Move imports in lastfm component (#28010)
* Move imports in lastfm component

* Fix pylint
2019-10-21 22:38:01 -07:00
Diefferson Koderer Môro
5d317dc096 Move imports in miflora component (#28025)
* Move imports in miflora component

* Fix pylint
2019-10-21 22:37:48 -07:00
Diefferson Koderer Môro
1a48c347a4 Move imports in mitemp_bt component (#28026)
* Move imports in mitemp_bt component

* Fix pylint
2019-10-21 22:37:31 -07:00
Diefferson Koderer Môro
a8c6b04906 Move imports in opencv component (#28042)
* Move imports in opencv component

* Fix pylint
2019-10-21 22:37:09 -07:00
Diefferson Koderer Môro
87cc661087 Move imports in pocketcasts component (#28084) 2019-10-21 22:36:46 -07:00
Diefferson Koderer Môro
1313ec4ec8 Move imports in proliphix component (#28085) 2019-10-21 22:36:35 -07:00
Diefferson Koderer Môro
2d36e9c08e Move imports in prometheus component (#28086) 2019-10-21 22:35:43 -07:00
Diefferson Koderer Môro
0193207b5c Move imports in recollect_waste component (#28089) 2019-10-21 22:35:25 -07:00
Diefferson Koderer Môro
40fbfe7a93 Move imports in rejseplanen component (#28091) 2019-10-21 22:35:05 -07:00
Diefferson Koderer Môro
3e8f2bf2fc Move imports in remember_the_milk component (#28092) 2019-10-21 22:34:51 -07:00
Diefferson Koderer Môro
d9b890a402 Move imports in repetier component (#28093) 2019-10-21 22:34:35 -07:00
Diefferson Koderer Môro
4a3d6208ae Move imports in rpi_pfio component (#28094) 2019-10-21 22:33:23 -07:00
Diefferson Koderer Môro
828bf1b400 Move imports in sesame component (#28095) 2019-10-21 22:33:02 -07:00
Diefferson Koderer Môro
f440259edc Move imports in seven_segments component (#28096) 2019-10-21 22:32:53 -07:00
Diefferson Koderer Môro
953f31dd55 Move imports in shiftr component (#28097) 2019-10-21 22:32:37 -07:00
Diefferson Koderer Môro
d9cb9601aa Move imports in skybeacon component (#28099) 2019-10-21 22:31:58 -07:00
Diefferson Koderer Môro
1111e150f4 Move imports in shodan component (#28098) 2019-10-21 22:31:41 -07:00
HomeAssistant Azure
2cc039dbc4 [ci skip] Translation update 2019-10-22 00:32:10 +00:00
Alexei Chetroi
fe7c45b363 Move remaining of ZHA imports to top level. (#28071)
* Move ZHA import to top level.
* ZHA tests: move imports to top level.
2019-10-21 19:30:56 -04:00
jjlawren
fc8920646b Fix Plex test timeouts (#28077)
* Ensure mocked calls are inside patch

* Avoid filesytem I/O
2019-10-21 16:29:04 -07:00
Paulus Schoutsen
cd00d556d4 Merge pull request #28073 from home-assistant/rc
0.100.3
2019-10-21 16:28:27 -07:00
Santobert
92508af253 Counter configure with value (#28066) 2019-10-21 15:01:35 -07:00
Pascal Vizeli
0d16e025df New cache on Azure (#27739)
* New cache on Azure

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml
2019-10-21 14:59:51 -07:00
Paulus Schoutsen
60846183f0 Bumped version to 0.100.3 2019-10-21 14:57:02 -07:00
Aaron Bach
e8b2d7d248 Update pymyq to 2.0.0 (#28069)
* Update pymyq to 2.0.0

* Removed unnecessary update

* Restore `type` parameter (as optional)
2019-10-21 14:56:58 -07:00
jjlawren
b79716ab93 Use URI provided by Plex for local connections (#27515)
* Use provided URI for local connections

* Use provided plexapi connection method

* Remove unused mock from tests

* Handle potential edge case(s)
2019-10-21 14:56:43 -07:00
jjlawren
b0d246d6a7 Rewrite Plex tests (#27624) 2019-10-21 14:56:37 -07:00
Diefferson Koderer Môro
4935ef5233 Move imports in piglow component (#28046)
* Move imports in piglow component

* Fix  pylint
2019-10-21 23:30:17 +02:00
Josef Schlehofer
6c39d77e23 Upgrade youtube_dl to version 2019.10.22 (#28070) 2019-10-21 23:06:50 +02:00
Otto Winter
ef194d1b82 Fix mypy missing from dev install script (#28060)
* Fix mypy missing

* Update bootstrap

* Update script/bootstrap

Co-Authored-By: cgtobi <cgtobi@users.noreply.github.com>
2019-10-21 13:56:02 -07:00
Aaron Bach
86b204df0e Update pymyq to 2.0.0 (#28069)
* Update pymyq to 2.0.0

* Removed unnecessary update

* Restore `type` parameter (as optional)
2019-10-21 14:46:39 -06:00
Patrik
86347a3d5f Refactor Tradfri light group (#27714)
* Set same manufacturer name of gateway as of devices

* Refactor Tradfri light group

* Restore should_poll and async_update
2019-10-21 21:42:17 +02:00
Alexei Chetroi
a0c50f4794 Leverage zigpy for IEEE address conversions (#27972)
* Refactor EUI64 conversions.

* Update ZHA dependencies.

* Update tests.
2019-10-21 13:14:17 -04:00
Erik Montnemery
643257d911 Include subscriber information when MQTT message can't be decoded (#28062) 2019-10-21 17:34:58 +02:00
Ville Skyttä
70ddab2f3c Helpers type hint additions and improvements (#27986)
* Helpers type hint additions and improvements

* Fix async setup dump callback signature
2019-10-21 17:54:59 +03:00
Otto Winter
ba10d5d604 Add ESPHome sensor force_update option (#28059)
* Add ESPHome sensor force_update option

* Update aioesphomeapi to 2.4.0
2019-10-21 16:06:57 +02:00
David Bonnes
269c8f1d14 Add hvac_action to geniushub (#28056)
* add hvac_action() to climate zones
2019-10-21 14:04:56 +01:00
Quentame
ac467d0b3f Not slugify cert_expiry name (#28055) 2019-10-21 14:30:49 +02:00
Pascal Roeleven
6ba437d83a Code cleanup for orangepi_gpio (#27958)
* Code cleanup for orangepi_gpio

* Move constants to const.py

* Use async wherever possible

* Remove obsolute functions

* Use relative package integration imports

* Move callbacks to async_added_to_hass

* Avoid side effects in init

* Prevent blocking I/O in coroutines

* Make sure entity is setup before added
2019-10-21 13:56:03 +02:00
Ties de Kock
a05144bb8b Fix buienradar component and add smoke tests (#27965)
* Fixes the buienradar component and add smoke tests

  * Fix errors due to circular imports after imports were moved.
  * Add smoke test so this situation will be caught in the future.

* Add buienradar.util to coveragerc

* Refactor tests to standalone pytest test function style

* Add __init__ to buienradar tests
2019-10-21 13:52:25 +02:00
Fabian Affolter
ea1401d0b6 Upgrade discord.py to 1.2.4 (#28054) 2019-10-21 13:48:07 +02:00
Matthew Turney
6c48abcaa5 rest_command component should support PATCH method (#27989)
Without PATCH the rest_command component lacks full RESTful API
support.
2019-10-21 11:20:18 +02:00
Alan Tse
1e832dc9ec Bump teslajsonpy and add update switch (#27957)
* bump teslajsonpy to 0.0.26
breaking change

* add update switch to tesla

* bump requirements_all.txt for teslajsonpy

* address requested style changes

* fix bug where update switch not loaded
2019-10-21 10:59:58 +02:00
jjlawren
d1fcc5762b Make dispatch signals unique per server (#28029) 2019-10-21 10:44:07 +02:00
Diefferson Koderer Môro
6844d203a1 Move imports in gpsd component (#27997) 2019-10-21 10:41:20 +02:00
Diefferson Koderer Môro
5fb3f6038b Move imports in itach component (#28005) 2019-10-21 10:24:26 +02:00
Diefferson Koderer Môro
322399c0af Move imports in kira component (#28007) 2019-10-21 10:24:06 +02:00
Diefferson Koderer Môro
36ff790a39 Move imports in greenwave component (#27998) 2019-10-21 10:22:52 +02:00
Diefferson Koderer Môro
d5799d020a Move imports in insteon component (#28001) 2019-10-21 10:22:34 +02:00
Diefferson Koderer Môro
1a68591fe6 Move imports in juicenet component (#28006) 2019-10-21 10:22:13 +02:00
Diefferson Koderer Môro
9fa99eaea9 Move imports in konnected component (#28009) 2019-10-21 10:21:40 +02:00
Rami Mosleh
09f9875ccf Glances config flow (#27221)
* Glances Integration with config flow

* Glances Integration with config flow

* fix description texts

* Glances Integration with config flow

* Glances Integration with config flow

* fix description texts

* update .coverage.py

* add codeowner

* add test_options

* Fixed typos, Added import, fixed tests

* sort imports

* remove commented code
2019-10-21 10:17:21 +02:00
Diefferson Koderer Môro
09acbc211c Move imports in lg_soundbar component (#28011) 2019-10-21 10:09:38 +02:00
Diefferson Koderer Môro
9a9cd1d0b2 Move imports in lifx component (#28012) 2019-10-21 10:09:14 +02:00
Diefferson Koderer Môro
6742b36a3d Move imports in lifx_legacy component (#28013) 2019-10-21 10:08:04 +02:00
Diefferson Koderer Môro
90731555f8 Move imports in loopenergy component (#28017) 2019-10-21 10:07:35 +02:00
Diefferson Koderer Môro
8922d702ae Move imports in lupusec component (#28018) 2019-10-21 10:07:09 +02:00
Diefferson Koderer Môro
4db761e6f2 Move imports in metoffice component (#28023) 2019-10-21 10:06:38 +02:00
Kevin McCormack
936dac2270 Add Vivotek camera component code owner (#28024) 2019-10-21 10:06:16 +02:00
Diefferson Koderer Môro
3e9d28f28a Move imports in mobile_app component (#28027) 2019-10-21 10:05:41 +02:00
Diefferson Koderer Môro
206f8cef5c Move imports in mychevy component (#28032) 2019-10-21 10:05:05 +02:00
Diefferson Koderer Môro
38db4b0a23 Move imports in mythicbeastsdns component (#28033) 2019-10-21 10:04:33 +02:00
Diefferson Koderer Môro
92ed8362ce Move imports in niko_home_control component (#28036) 2019-10-21 10:04:10 +02:00
Diefferson Koderer Môro
e9674374a4 Move imports in norway_air component (#28037) 2019-10-21 10:03:49 +02:00
Diefferson Koderer Môro
56a7233e0f Move imports in ohmconnect component (#28041) 2019-10-21 10:03:24 +02:00
Diefferson Koderer Môro
2f96691938 Move imports in otp component (#28044) 2019-10-21 10:02:59 +02:00
Diefferson Koderer Môro
bbc71441a1 Move imports in pandora component (#28045) 2019-10-21 10:02:22 +02:00
Diefferson Koderer Môro
fb79c45645 Move imports in iperf3 component (#28002) 2019-10-21 09:59:50 +02:00
Diefferson Koderer Môro
cf2ee1a09f Move imports in iss component (#28003) 2019-10-21 09:59:26 +02:00
Diefferson Koderer Môro
96509c0c0b Move imports in oasa_telematics component (#28039) 2019-10-21 09:58:59 +02:00
Diefferson Koderer Môro
67f7146cab Move imports in linode component (#28014) 2019-10-21 09:58:46 +02:00
Diefferson Koderer Môro
e19663f172 Move imports in lirc component (#28015) 2019-10-21 09:58:22 +02:00
Diefferson Koderer Môro
6de95995aa Move imports in logbook component (#28016) 2019-10-21 09:57:31 +02:00
Diefferson Koderer Môro
ff385d5e2b Move imports in lw12wifi component (#28019) 2019-10-21 09:56:19 +02:00
Diefferson Koderer Môro
c1fccee83a Move imports in magicseaweed component (#28020) 2019-10-21 09:55:53 +02:00
Diefferson Koderer Môro
1342fe2b3c Move imports in openevse component (#28043) 2019-10-21 09:55:29 +02:00
Diefferson Koderer Môro
265a1f1fb6 Move imports in neurio_energy component (#28035) 2019-10-21 09:54:51 +02:00
Diefferson Koderer Môro
cc3173e3ce Move imports in namecheapdns component (#28034) 2019-10-21 09:54:27 +02:00
Diefferson Koderer Môro
6a392e13dd Move imports in mpd component (#28030) 2019-10-21 09:53:59 +02:00
Diefferson Koderer Môro
1e27e2827d Move imports in mvglive component (#28031) 2019-10-21 09:53:28 +02:00
Diefferson Koderer Môro
ad39b957d6 Move imports in mopar component (#28028) 2019-10-21 09:52:49 +02:00
Diefferson Koderer Môro
4bb82fa8ad Move imports in message_bird component (#28022) 2019-10-21 09:48:25 +02:00
HomeAssistant Azure
ff3c0e5697 [ci skip] Translation update 2019-10-21 00:32:17 +00:00
Diefferson Koderer Môro
a13f8a1781 Move imports in frontend component (#27988) 2019-10-21 00:04:56 +02:00
Diefferson Koderer Môro
bb381d6060 Move imports in eliqonline component (#27980) 2019-10-20 23:39:24 +02:00
javicalle
87c0207163 Move imports in osramlightify component (#27985) 2019-10-20 23:38:45 +02:00
Diefferson Koderer Môro
ce00d06cbd Move imports in elkm1 component (#27982) 2019-10-20 23:37:52 +02:00
Diefferson Koderer Môro
ef8f88e25a Move imports in everlights component (#27983) 2019-10-20 23:36:43 +02:00
Diefferson Koderer Môro
bf6a30d1bb Move imports in goalfeed component (#27995) 2019-10-20 23:35:42 +02:00
Diefferson Koderer Môro
92ed89969c Move imports in gntp component (#27994) 2019-10-20 23:28:23 +02:00
Diefferson Koderer Môro
ab2d1ee134 Move imports in gc100 component (#27993) 2019-10-20 23:23:14 +02:00
Diefferson Koderer Môro
dd4075d495 Move imports in frontier_silicon component (#27990) 2019-10-20 23:22:50 +02:00
Diefferson Koderer Môro
5fa8c02e64 Move imports in futurenow component (#27991) 2019-10-20 23:21:17 +02:00
David Bonnes
bce9f14751 isort the evohome code (#27977) 2019-10-20 20:20:53 +01:00
David Bonnes
5d94c82175 isort the geniushub code (#27978) 2019-10-20 20:17:27 +01:00
Diefferson Koderer Môro
ca0a4a8750 Move imports for ebusd component (#27979) 2019-10-20 21:16:04 +02:00
David Bonnes
8356d92f04 Refactor entity_ids, tweak names and consolidate classes (#27921)
* refactor entity_ids, and consolidate classes

* isort the code
2019-10-20 19:48:52 +01:00
Diefferson Koderer Môro
54a711ca6a Move imports in dweet component (#27976) 2019-10-20 20:47:39 +02:00
Diefferson Koderer Môro
9db07b2a41 Move imports in onvif component (#27969) 2019-10-20 20:46:51 +02:00
David Bonnes
6951d78874 move imports in serial component (#27971) 2019-10-20 20:46:24 +02:00
Diefferson Koderer Môro
57b6c2c6b0 Move imports in crimereports component (#27973) 2019-10-20 20:41:11 +02:00
Diefferson Koderer Môro
c44163548d Move imports in dte_energy_bridge component (#27975) 2019-10-20 20:40:13 +02:00
David Bonnes
425e7fd1a7 bugfix evohome and bump client (#27968)
* bump client to 0.3.4b1

* handle bad schedules that cause issue #27768
2019-10-20 17:51:08 +01:00
Miroslav Ždrale
22b29a8005 Add option to disable HTTPS verification in Luci component (#27946)
* Add option to disable HTTPS verification in Luci component

* Update code owners

* Update code owners
2019-10-20 09:43:44 -07:00
Teemu R
ac5ce4136e Remove tplink device tracker (#27936)
* Remove tplink device tracker

Version 0.94 added a distress signal and since then nothing has happened.
This commit removes the device tracker which should have never been
a part of tplink integration in the first place as it does not share
anything with this pyhs100-based integration / kasa smarthome.

* add updated requirements_test_all that was forgotten

* remove unit tests
2019-10-20 18:11:48 +02:00
Michał Mrozek
5a592f1291 move imports in sma component (#27945) 2019-10-20 14:33:58 +02:00
Quentame
5ce437dc30 Fixing config_entries.async_forward_entry_unload calls (step 1) (#27857) 2019-10-20 12:15:46 +02:00
Michał Mrozek
c42ca94a86 move imports in smarthab component (#27942) 2019-10-20 12:14:07 +02:00
Michał Mrozek
ed46834a30 Move imports in sql component (#27713)
* move imports in sql component

* fix: variable redeclaration

* fix: close test db session on platform setup
2019-10-20 10:10:27 +02:00
Jacob Mansfield
9571f869d1 Fix whois error, check expiration_date for list and pick first (#27930) 2019-10-20 10:07:34 +02:00
Michał Mrozek
e01562ceea Move imports in snmp component (#27939)
* move imports in snmp component

* fix: move hlapi import top level
2019-10-20 10:06:32 +02:00
Michał Mrozek
a5ec5b567e move imports in snapcast component (#27940) 2019-10-20 10:05:37 +02:00
Michał Mrozek
2706e3289d Move imports in smappee component (#27943)
* move imports in smappee component

* fix: unneeded object inheritance
2019-10-20 10:05:11 +02:00
HomeAssistant Azure
2c00ff7e52 [ci skip] Translation update 2019-10-20 00:32:18 +00:00
Michał Mrozek
bfba46d64a move imports in sonos component (#27938) 2019-10-19 23:52:42 +02:00
jjlawren
eeb1bfc6f5 Central update for Plex platforms (#27764)
* Update Plex platforms together

* Remove unnecessary methods

* Overhaul of Plex update logic

* Apply suggestions from code review

Use set instead of list

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

* Review suggestions and cleanup

* Fixes, remove sensor throttle

* Guarantee entity name, use common scheme

* Keep name stable once set
2019-10-19 23:31:15 +02:00
Santobert
5c50fa3405 Bump pybotvac (#27933) 2019-10-19 22:56:57 +02:00
Tim McCormick
2a269fb9eb Update pysonos to 0.0.24 (#27937) 2019-10-19 22:54:36 +02:00
Paulus Schoutsen
bb5da77f2c Import shuffle (#27935)
* Simplify persistent_notification ws command

* Move cors import inside setup

* Fix stream imports
2019-10-19 12:44:51 -07:00
Hmmbob
febc48c84b Remove stride (#27934)
* Remove stride

* Remove Stride

* Remove stride

* Remove stride

* Remove stride
2019-10-19 21:40:45 +02:00
David Bonnes
efae9a24d5 remove duplicate unique_id, add unique_id for issues (#27916) 2019-10-19 12:27:15 -07:00
Franck Nijhof
cb061e57d2 Add support for AdGuard Home v0.99.0 (#27926)
* Bump adguardhome to 0.3.0

* Add a more user friendly version handling and added logs

* ✏️ Fixes spelling error in abort messages

* ✏️ Error messages improvements, suggested by cgtobi
2019-10-19 12:11:09 -07:00
shred86
48e5655379 Bump abodepy version (#27931) 2019-10-19 12:10:35 -07:00
Santobert
5fa4632c12 Add improved scene support to the cover integration (#27914) 2019-10-19 11:39:31 -07:00
Ville Skyttä
381d423fec Upgrade mypy to 0.740 (#27913)
* Upgrade mypy to 0.740

http://mypy-lang.blogspot.com/2019/10/mypy-0740-released.html

* Type hint additions

* Type fixes

* Remove no longer needed type ignores and casts

* Disable untyped definition checks in bunch of files
2019-10-19 11:35:57 -07:00
Paulus Schoutsen
758fcc9b00 Remove helper imports relying on installed requirements (#27898) 2019-10-19 11:33:21 -07:00
bouni
9ec0602986 Move imports in cpuspeed component (#27890) 2019-10-19 20:33:05 +02:00
Greg Rapp
840001e168 Added night arm mode support to Envisalink component (#27087) 2019-10-19 11:26:07 -07:00
SukramJ
de1477f00b Bump version of homematicip to 0.10.13 (#27928)
The Home websocket can now automatically reopen a lost connection (default)
2019-10-19 18:24:28 +02:00
Quentame
8c0deeb176 Move imports in luftdaten component (#27929) 2019-10-19 18:22:32 +02:00
SukramJ
eb48898687 Add climate profiles to Homematic IP Cloud (#27772)
* Add climate service to Homematic IP Cloud to select the active profile

* Add  profiles ass presets

* fix spelling

* Re-Add PRESET_NONE for selection

* Boost is a manual mode

* Fixes based on review

* Fixes after review
2019-10-19 17:44:40 +02:00
guillempages
f2617fd74a Split homematic color and effect support (#27299)
* [homematic] Split color and effect support

There are homematic devices (like HmIP-BSL) that support color but
do not support effects.
Split the support, so that color can be supported even if effects are not.

* Make effect fully independent of color

If a device supports effects for e.g. just brightness, it shouldn't be coupled to the color
2019-10-19 14:40:42 +02:00
Pascal Vizeli
1c0814d6f6 Run pylint parallel (#27919) 2019-10-19 13:42:49 +02:00
Pascal Vizeli
1f96a7becf Update azure-pipelines-ci.yml 2019-10-19 12:31:40 +02:00
Ville Skyttä
1ec01b5e6c Upgrade pylint to 2.4.3 and astroid to 2.3.2 (#27912)
https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-3
2019-10-19 12:03:52 +02:00
Joakim Plate
2bd9f5680d Report state (#27759)
* Add report state config

* Add initial steps for local report state

* Use owner of system as user_id

* First working prototype

* Only report state if requested

* Add some good logging and adjust constant name

* Move jwt generation out to non member

* Move cache out to caller

* Remove todo about cache

* Move getting token out of class

* Add timeout on calls

* Validate config dependency

* Support using service key to do sync call when api_key is not set

* Make sure timezone is fixed for datetime dummy

* Use exact expire_in time

* Support renewing token on 401

* Test retry on 401

* No need to declare dummy key twice

* Correct some docs on functions

* Add test for token expiry
2019-10-18 22:37:44 -07:00
Paulus Schoutsen
6303117354 Dont create coroutine until acting on it (#27907) 2019-10-18 20:58:43 -07:00
Brig Lamoreaux
37b23e9205 Move imports to top for harman_kardon_avr (#27903) 2019-10-18 20:58:15 -07:00
Brig Lamoreaux
1e727f339f Move imports in harmony component (#27904) 2019-10-18 20:58:07 -07:00
Paulus Schoutsen
00521b5e80 Fix flaky integration test (#27905) 2019-10-18 20:57:54 -07:00
Brig Lamoreaux
0cd55d6716 Move imports for hp_ilo components (#27906) 2019-10-18 20:57:47 -07:00
Brig Lamoreaux
2110fea02b Move import for htu21d component (#27908) 2019-10-18 20:57:36 -07:00
Pascal Vizeli
435cbb7f7e Azure pytest parallel (#27864)
* Azure pytest parallel

* Update azure-pipelines-ci.yml

* Remove test that does nothing
2019-10-18 20:51:53 -07:00
Santobert
7ed659151c Vacuum reproduce state (#27868)
* Vacuum reproduce state

* Add missing states

* Improved process

* Fix tests
2019-10-18 19:49:08 -07:00
Paulus Schoutsen
6391a68fd5 Better header check for OAuth2 helper (#27897) 2019-10-18 20:11:54 -05:00
foreign-sub
914ceea72d Bump keyring to 19.2.0 (#27899) 2019-10-18 20:09:41 -05:00
Paulus Schoutsen
d98114d2ab Guard cloud check (#27901)
* Guard cloud check

* Fix pos args
2019-10-18 20:08:53 -05:00
HomeAssistant Azure
9e8c391c81 [ci skip] Translation update 2019-10-19 00:32:15 +00:00
Heine Furubotten
065c6f4c9c Move imports for nilu component (#27896) 2019-10-19 01:05:36 +02:00
bouni
6df34a0128 Move imports in channels component (#27876) 2019-10-19 01:04:10 +02:00
bouni
422885b7fd Move imports in buienradar component (#27873) 2019-10-19 01:02:54 +02:00
bouni
d78f14b20a Move imports in canary component (#27874) 2019-10-19 01:01:59 +02:00
bouni
dc5d38128c Move imports in cast component (#27875) 2019-10-19 00:59:58 +02:00
bouni
8cf443110a Move imports in cisco_mobility_express component (#27877) 2019-10-19 00:59:07 +02:00
bouni
29ef49fdd9 Move imports in coolmaster component (#27888) 2019-10-19 00:57:59 +02:00
Brig Lamoreaux
535da96d4d Move imports to top for hikvisioncam (#27895) 2019-10-19 00:56:59 +02:00
Bram Kragten
8e3d210818 Add remove function to hue sensors (#27652)
* Add remove function to sensors

* Fix + comments

* Update light.py
2019-10-18 15:41:11 -07:00
bouni
1d8e366278 Move imports in cloud component (#27881) 2019-10-18 15:39:37 -07:00
bouni
b2b140e8d0 Move imports in cmus component (#27883) 2019-10-19 00:26:58 +02:00
bouni
7ed5616faa Move imports in cisco_webex_teams component (#27878) 2019-10-19 00:23:16 +02:00
bouni
d7a8a635ba Move imports in ciscospark component (#27879) 2019-10-19 00:14:49 +02:00
bouni
2e416168cf Move imports in coinbase component (#27884) 2019-10-19 00:05:42 +02:00
bouni
b11dc0f50f Move imports in coinmarketcap component (#27885) 2019-10-19 00:04:37 +02:00
bouni
93db814b15 Move imports in comfoconnect component (#27886) 2019-10-19 00:01:03 +02:00
bouni
dc30119d20 Move imports in concord232 component (#27887) 2019-10-19 00:00:00 +02:00
bouni
c333daab10 Move imports in cppm_tracker component (#27889) 2019-10-18 23:58:00 +02:00
springstan
2a95180d3b Move imports in fritzbox, fritz device tracker, fritzdect, fritzbox netmonitor (#27746)
* Moved imports to top-level in fritzbox_netmonitor component

* Moved imports to top-level in fritz, fritzbox and fritzdect
2019-10-18 14:54:56 -07:00
Paulus Schoutsen
b6c26cb363 Introduce new OAuth2 config flow helper (#27727)
* Refactor the Somfy auth implementation

* Typing

* Migrate Somfy to OAuth2 flow helper

* Add tests

* Add more tests

* Fix tests

* Fix type error

* More tests

* Remove side effect from constructor

* implementation -> auth_implementation

* Make get_implementation async

* Minor cleanup + Allow picking implementations.

* Add support for extra authorize data
2019-10-18 13:06:33 -07:00
bouni
6157be23dc Move imports in cloudflare integration(#27882) 2019-10-18 21:32:14 +02:00
Ville Skyttä
103ffacea7 Use pre-commit in CI and tox (#27743) 2019-10-18 12:20:26 -07:00
Paulus Schoutsen
a119932ee5 Refactor the conversation integration (#27839)
* Refactor the conversation integration

* Lint
2019-10-18 11:46:45 -07:00
Malte Franken
83a709b768 Move imports in recorder component (#27859)
* move imports to top-level in recorder init

* move imports to top-level in recorder migration

* move imports to top-level in recorder models

* move imports to top-level in recorder purge

* move imports to top-level in recorder util

* fix pylint
2019-10-18 10:14:54 -07:00
bouni
e95b8035ed Move imports in blinksticklight component (#27851) 2019-10-18 17:15:20 +02:00
bouni
bb76678b36 Move imports in blink component (#27850) 2019-10-18 17:14:50 +02:00
bouni
56dde68c5b Move imports in bmw_connected_drive component (#27853) 2019-10-18 17:14:01 +02:00
bouni
03cc7f377b Move imports in bom component (#27854) 2019-10-18 17:12:42 +02:00
Pascal Vizeli
9392cbff03 cryptography + numpy for python 3.8 (#27861) 2019-10-18 16:11:40 +02:00
bouni
3bb46d5080 Move blackbird imports (#27849)
* Move imports in blackbird component

* fixed tests after import move to top level
2019-10-18 15:12:36 +02:00
bouni
c0d084fb04 Move imports in blockchain component (#27852) 2019-10-18 15:12:00 +02:00
bouni
58d2d858cd Move imports in brunt component (#27856) 2019-10-18 15:08:40 +02:00
Tomasz Jagusz
675c91b436 Move imports in yweather (#27842)
Changes checked with pylint.
Formatted with black
Imports sorted with isort
2019-10-18 10:11:53 +02:00
bouni
511766cb06 Move imports in apns component (#27804)
* Move imports in apns component

* fixed apns tests
2019-10-17 22:13:29 -07:00
Quentame
5cb145f588 Move imports in openweathermap component (#27779) 2019-10-17 22:12:32 -07:00
Tobias Efinger
7ec8384fa6 Add service description for route53 integration (#27774) 2019-10-17 22:11:51 -07:00
Bendik Brenne
9625e0463b Add sinch integration (notify component) (#26502)
* Added sinch integration (notify component)

* Updated requirements

* Fixes according to lint

* Update homeassistant/components/sinch/notify.py

Co-Authored-By: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/sinch/notify.py

Co-Authored-By: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>

* Update homeassistant/components/sinch/notify.py

Co-Authored-By: Andrew Sayre <6730289+andrewsayre@users.noreply.github.com>

* Adds @bendikrb as codeowner

* Imports to the top. Catching specific exceptions. Logic fixes

* Updated CODEOWNERS

* Reformatting (black)

* Added sinch component to .coveragerc

* Conform to pylintrc

* Okay, Mr. Black

* Fixed: Catching too general exception Exception
2019-10-17 21:44:09 -07:00
Tsvi Mostovicz
2bc6b59e79 Move holiday info into a single sensor with multiple attributess (#27654)
* Move holiday onfo into a single sensor with multiple attributess

* Add tests for holiday attributes
2019-10-17 20:32:24 -07:00
Raman Gupta
4e25807b7d Add ability for MQTT device tracker to map non-default topic payloads to zones/states (#27143)
* add ability for MQTT device tracker to map nondefault topic payloads to zones

* update new parameter name and add abbreviation

* support for payload_home, payload_not_home, and payload_custom

* use constants STATE_NOT_HOME and STATE_HOME as defaults

* reference state constants directly

* add empty dict as default for payload_custom

* change parameter name for custom mapping of payloads to non-home zones to be more descriptive

* removed 'payload_other_zones' per ballobs review

* remove abbreviation for 'payload_other_zones'

* add tests for feature
2019-10-17 17:51:27 -07:00
mvn23
489340160b Add opentherm_gw options flow. (#27316) 2019-10-17 17:36:34 -07:00
jjlawren
0888098718 Use URI provided by Plex for local connections (#27515)
* Use provided URI for local connections

* Use provided plexapi connection method

* Remove unused mock from tests

* Handle potential edge case(s)
2019-10-17 17:31:53 -07:00
SukramJ
564789470e Add device_info to HomematicIP climate and acp (#27771) 2019-10-17 17:25:16 -07:00
Tiit Rätsep
81178661ae Added handling for connection errors in state update, added available property (#27794) 2019-10-17 17:23:11 -07:00
Maciej Bieniek
86a4be1636 Fix attribution (#27815) 2019-10-17 17:22:40 -07:00
Quentame
dcdcfdd376 Unload linky config entry (#27831) 2019-10-17 17:22:16 -07:00
scheric
3e7fcc7575 Add grid sensors to SolarEdge_local (#27247)
* Add grid sensors

* Formatting

* Add possibility to add attributes

* Add optimizer attribute

* Remove bare 'except'

* add proper exception

* Remove return attribution 0

* Ad inverter attribution

* Style change

* Add attribute name to sensors constants

* SENSOR_TYPES  alphabetical and snake_case lower

* Formatting

* forgot snake_case lower

* Add extra meter sensors

* add critical error for debugging

* Update sensor.py

* swam meter sensors

* Add suitable icons to meter reading

* Fix for pointless-statement

homeassistant/components/solaredge_local/sensor.py:173:8: W0104: Statement seems to have no effect (pointless-statement)
homeassistant/components/solaredge_local/sensor.py:192:8: W0104: Statement seems to have no effect (pointless-statement)
homeassistant/components/solaredge_local/sensor.py:349:16: W0104: Statement seems to have no effect (pointless-statement)
homeassistant/components/solaredge_local/sensor.py:356:16: W0104: Statement seems to have no effect (pointless-statement)

* Rename import energy sensor

* Insert feadback

* Change to debug info

* Add check if attribute name exist

* Remove unnecessary else

* Add return None if no attributes

* flake
2019-10-17 17:21:00 -07:00
Erik Montnemery
6d083969c2 Add device action support to the lock integration (#27499)
* Add device action support to the lock integration

* Check that the enitity supports open service
2019-10-17 17:20:10 -07:00
Quentame
bd0403c65e Move imports in telegram_bot component (#27785) 2019-10-17 17:19:34 -07:00
David Bonnes
2d1f7932ba bump client (#27799) 2019-10-17 17:19:07 -07:00
bouni
e17b8b011a Move imports in bitcoin component (#27814) 2019-10-17 17:18:47 -07:00
bouni
21754fd7cc Move imports in bbb_gpio component (#27813) 2019-10-17 17:18:22 -07:00
bouni
d95b4a6a0b Move imports in anel_pwrctrl component (#27798) 2019-10-17 17:18:11 -07:00
Tomasz Jagusz
bc58649c2b Move imports in MCP23017 component (#27769)
* mcp23017 move imports

* fix pylint errors
2019-10-17 17:17:56 -07:00
Quentame
fdf839774e Move imports in fritz + fritzbox_netmonitor component (#27823)
* Move imports in fritz + fritzbox_netmonitor component

* Fix PyLint 1
2019-10-17 17:17:24 -07:00
Quentame
22b904f5e0 Move imports in flux_led component (#27822) 2019-10-17 17:15:18 -07:00
Quentame
0965e358ea Move imports in fitbit component (#27820) 2019-10-17 17:14:53 -07:00
Quentame
fe036ed094 Move imports in flic component (#27821) 2019-10-17 17:13:20 -07:00
Ville Skyttä
3a608314c4 Mypy setup fixes (#27825)
* Install our core dependencies for mypy in azure

To match local setups and tox.

* Use "system" mypy in pre-commit instead of the "real" mypy hook

The results of mypy depend on what is installed. And the mypy hook
runs in a virtualenv of its own, meaning we'd need to install and
maintain another set of our dependencies there... no. Use the "system"
one and reuse the environment that is set up anyway already instead.

* Reintroduce needed ruamel.yaml type ignore

This ignore is required when ruamel.yaml is installed, and we want it
to be as it's part of the core dependency set.
2019-10-17 17:12:58 -07:00
Quentame
61edd33da7 Move imports in google component (#27826) 2019-10-17 17:11:51 -07:00
Quentame
6998687742 Move imports in gitlab_ci component (#27827) 2019-10-17 17:11:20 -07:00
bouni
9d583ad9f9 Move imports in baidu component (#27812) 2019-10-17 17:11:11 -07:00
bouni
54ef96e79a Move imports in awair component (#27811) 2019-10-17 17:11:01 -07:00
bouni
447d99a1ae Move imports in apcupsd component (#27803) 2019-10-17 17:10:28 -07:00
bouni
56c13503c3 Move imports in aqualogic component (#27805) 2019-10-17 17:10:16 -07:00
bouni
5eb781d378 Move imports in arlo component (#27806) 2019-10-17 17:09:47 -07:00
bouni
3cf7983e00 Move imports in asterisk_mbox component (#27807) 2019-10-17 17:08:58 -07:00
bouni
bb80d9bd16 Move imports in august component (#27810) 2019-10-17 17:06:41 -07:00
Malte Franken
1a5b4c105a Move imports in mqtt component (#27835)
* move imports to top-level in mqtt server

* move imports to top-level in mqtt configflow

* move imports to top-level in mqtt init

* move imports to top-level in mqtt vacuum

* move imports to top-level in mqtt light
2019-10-17 17:04:27 -07:00
Quentame
7637ceb880 Move imports in html5 component (#27473)
* Move imports in html5 component

* Fix tests 1

* Fix tests 2
2019-10-17 21:17:23 +02:00
tombbo
e992cfb45c Add on_off_inverted to KNX climate (#25900)
* Added a new configuration boolean parameter on_off_inverted to KNX Climate component.

* Remove unexpected spaces around equals.

* Parameter name changed to on_off_invert and modified to new version of XKNX library.

* Dict[key] for required config keys and keys with default config schema values.
2019-10-17 21:07:09 +02:00
bouni
ba0107f912 Move imports in android_ip_webcam component (#27797) 2019-10-17 17:07:36 +02:00
Pascal Vizeli
d52476333e Update devcontainer.json 2019-10-17 17:06:33 +02:00
bouni
136df743e3 moved imports to top level (#27782) 2019-10-17 15:38:58 +02:00
Jeff Irion
28cef89e03 Generate ADB key for Android TV integration (#27344)
* Generate ADB key for Android TV integration

* Remove 'do_nothing' function

* Remove 'return True'

* Re-add 2 'return True' lines
2019-10-17 15:33:20 +02:00
bouni
2c535c92bd moved imports to top level (#27784) 2019-10-17 15:05:45 +02:00
Quentame
12a8e7520e Move imports in netgear component (#27776) 2019-10-17 15:05:14 +02:00
bouni
62fcea2a8d moved imports to top level (#27781) 2019-10-17 15:04:41 +02:00
Quentame
ab598da4ba Move imports in nest component (#27778) 2019-10-17 15:03:50 +02:00
Quentame
8350e1246a Move imports in netgear_lte component (#27777) 2019-10-17 15:03:05 +02:00
Quentame
9dc0c05ee0 Move imports in imap + imap_email_content component (#27793) 2019-10-17 15:01:50 +02:00
bouni
88a78a4a18 Move imports in amcrest component (#27787) 2019-10-17 15:01:09 +02:00
Quentame
dc72aa48da Move imports in liveboxplaytv component (#27790) 2019-10-17 15:00:32 +02:00
bouni
4efa6689e4 Move imports in ampio component (#27788) 2019-10-17 15:00:00 +02:00
Quentame
9f71384524 Move imports in linux_battery component (#27789) 2019-10-17 14:59:36 +02:00
Quentame
35e0acf0a5 Move imports in keyboard component (#27791) 2019-10-17 14:58:56 +02:00
Quentame
e54f5102aa Move imports in ifttt component (#27792) 2019-10-17 14:58:23 +02:00
Tomasz Jagusz
b187ca93d0 Move imports in rpi_gpio (#27752)
* move imports for rpi_gpio

* fixed pylint error

* fix pylint error

* removed empty line

* add missing blank line

* sort with isort
2019-10-17 12:24:53 +02:00
Tomasz Jagusz
7fd606a254 bump rpi.gpio to 0.7.0 (#27753) 2019-10-17 11:30:18 +02:00
Antonio Larrosa
2d6d6ba90e Forget auth token when going offline so we can reconnect (#26630)
When an amcrest camera was unplugged and then plugged again
it was impossible to reconnect to it, since the old
auth token was reused while we need to use a new one.

In fact, the method that is called every minute to check
the camera availability is going to fail always since we're
reusing an old token.

By forgetting the token (setting it to None) when going offline,
we ensure that we'll regenerate it in the next commands thus allowing
to reconnect to the camera when it comes back online.
2019-10-17 11:29:08 +02:00
kennedyshead
46f1166edd Fix On/Off for melissa (#27733)
* Fixed On/Off for melissa

fixes #27092

* reformatted
2019-10-17 10:32:02 +02:00
Ville Skyttä
23db94c627 Run mypy in pre-commit without args to match CI (#27741) 2019-10-16 21:36:43 -07:00
springstan
e79a5baf9e Move imports in slack and socialblade (#27747)
* Moved imports to top-level in samsungtv, slack and socialblade

* Rewinded top-level imports in samsungtv component
2019-10-16 21:36:19 -07:00
Erik Montnemery
43c85c0549 Add device action support to the alarm_control_panel integration (#27616)
* Add device action support to the alarm_control_panel integration

* Improve tests
2019-10-16 21:34:56 -07:00
Robert Svensson
6ffc520b1c Axis - Improve discovery title by adding placeholder support (#27663)
* Improve discovery title by adding placeholder support
2019-10-16 20:45:03 +02:00
Josef Schlehofer
0607a30612 Upgrade youtube_dl to 2019.10.16 (#27737) 2019-10-16 20:28:59 +02:00
Andrey Kupreychik
bd95a89f45 Bump ndms2-client to 0.0.10 (#27734) 2019-10-16 20:28:12 +02:00
Pascal Vizeli
8a0f26e155 Add cache for mypy (#27745)
* Add cache for mypy

* Update ruamel_yaml.py
2019-10-16 17:37:24 +02:00
Pascal Vizeli
a1b8f4d9c3 New cache on Azure (#27739)
* New cache on Azure

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml

* Update azure-pipelines-ci.yml
2019-10-16 17:11:25 +02:00
cgtobi
14d3b9b8f9 Bump pyatmo version to 2.3.2 (#27731)
* Bump pyatmo version to 2.3.2

* Add reachable attribute

* Add reachable attribute
2019-10-16 12:19:38 +02:00
Maciej Bieniek
ec78821161 Add sensor platform to Airly integration (#27717)
* Add sesnor.py file

* Move AirlyData to __init__

* Cleaning

* Update .coveragerc file

* Sort consts

* Sort imports

* Remove icons from sensors with device_class
2019-10-16 12:06:52 +02:00
Paolo Tuninetto
cc93dd4928 Move imports in Kodi component (#27728)
* Move imports for Kodi component

* Removed empty line ad requested by review
2019-10-16 12:05:05 +02:00
David Bonnes
44b6258e48 Add evohome high_precision temperatures (#27513)
* add high_precision (current) temperatures 
* bump client to use aiohttp for v1 client
* token saving now event-driven rather than scheduled
* protection against invalid tokens that cause issues
* tweak error message
2019-10-16 10:32:25 +01:00
bouni
5a35e52adf Move imports in device_tracker component (#27676)
* moved imports to top level

* sorted imports using isort
2019-10-16 10:25:37 +02:00
Bogdan Vlaicu
c8f6484095 New sensor platform integration for Orange and Rockland Utility smart energy meter (#27571)
* New sensor platform integration for Orange and Rockland Utility smart energy meter

* New sensor platform integration for Orange and Rockland Utility smart energy meter

* bumped the oru py version to 0.1.9

* Added PLATFORM_SCHEMA
Adde unique_id property
Changed logger level from info to debug when printing the updated sensor value
Set the SCAN_INTERVAL to 15 mins
Added exception handling durin init when creating the oru meter instance

* Various fixes base on the PR review
+ Added SCAN_INTERVAL for 15 mins

* fixed path to documentation
2019-10-16 09:52:30 +02:00
HomeAssistant Azure
b8e00925e7 [ci skip] Translation update 2019-10-16 00:32:17 +00:00
bouni
04a5f19f6a moved imports to top level (#27696) 2019-10-15 16:24:18 -07:00
springstan
2b92fd3422 Moved imports to top-level in fritzbox_callmonitor component (#27705) 2019-10-15 16:22:42 -07:00
Michał Mrozek
d4692367c5 move imports in spotcrime component (#27715) 2019-10-15 16:21:19 -07:00
Michał Mrozek
b2f6931bbe move imports in speedtestdotnet component (#27716) 2019-10-15 16:20:59 -07:00
Michał Mrozek
a58d242909 move imports in sony_projector component (#27718) 2019-10-15 16:17:09 -07:00
Rolf K
8720ca38b5 Add improved scene support for input_select (#27697)
* Add improved scene support for input_select

* Add tests for reproducing input_select states.

* Add some comments.

* Add support for set_options

Allows defining the options for an input_select in a scene.

* Add tests for set_options in test_reproduce_state

* Execute for real instead of mock execution.
2019-10-15 16:15:42 -07:00
Paulus Schoutsen
93f9afcd21 Fix config imports (#27669)
* Fix config imports

* Remove old migration

* Remove migrate tests
2019-10-15 16:15:26 -07:00
Rolf K
c700085490 Add improved scene support to input_text (#27687)
* Add improved scene support for input_text.

* Add tests for reproducing input_text states.

* Add some comments.
2019-10-15 08:37:15 -07:00
quthla
a591d78efe Bump PyMata to 2.20 (#27431)
* Bump PyMata to 2.20

* Bump PyMata to 2.20
2019-10-15 17:21:40 +02:00
bouni
6f894d2dec moved imports to top level (#27679) 2019-10-15 17:12:32 +02:00
springstan
26d19f9e1c Moved imports to top-level in spotify integration (#27703) 2019-10-15 17:12:12 +02:00
AaronDavidSchneider
d534f30042 Update fritzconnection requirement to 0.8.4 (#27698)
* update fritzconnection requirement

* update requierements for other components and requierements_all
2019-10-15 17:11:17 +02:00
bouni
0e5f24d60c moved imports to top level (#27693) 2019-10-15 17:57:02 +05:30
Luca Angemi
3e26b49cc2 Add battery status in owntracks (#27686)
* Add battery status in owntracks

* Remove trailing whitespaces
2019-10-15 17:56:39 +05:30
bouni
b22eb22358 moved imports to top level (#27695) 2019-10-15 17:56:04 +05:30
Tiit Rätsep
40fbc3bd41 Fix missing strings in soma config flow (#27689) 2019-10-15 14:05:10 +02:00
bouni
16c18d303f Move imports in bme680 component (#27506)
* moved imports to top level

* fixed pylint error

* moved imports to top level

* fixed import error
2019-10-15 13:39:51 +02:00
Quentame
5b1f44ba19 Move imports in yeelight + yeelightsunflower component (#27388)
* Move imports in yeelight + yeelightsunflower component

* Fix pylint

* Fix pylint (again)
2019-10-15 13:37:40 +02:00
bouni
0463349f02 moved imports to top level (#27683) 2019-10-15 12:28:24 +02:00
bouni
b4a73fa87e Move imports in decora component (#27645)
* moved imports to top level

* replaced importlib with standard import

* fix for Unable to import 'decora' error
2019-10-15 12:26:50 +02:00
SukramJ
3d7860391a Improve code coverage for HomematicIP Cloud (#27606)
* Improve tests for HomematicIP Cloud

* create fixtures remove decorators

* removed further decorators

* remove  last decorator

* improve exception handling

* removed not required coroutine

* use the correct place for mock
2019-10-15 12:12:58 +02:00
Brett T. Warden
57b8d1889a Handle marker attrs that may not exist (#27519)
marker-high-levels and marker-low-levels may not exist in printer
attributes returned by CUPS, so we'll use .get() to avoid this and
default to None:
KeyError: 'marker-high-levels'

Fixes #27518
2019-10-15 15:23:13 +05:30
bouni
5b410ff3a5 moved imports to top level (#27677) 2019-10-15 15:03:22 +05:30
bouni
ecc276de38 moved imports to top level (#27675) 2019-10-15 10:07:37 +02:00
bouni
502c65b5fd moved imports to top level (#27678) 2019-10-15 10:06:56 +02:00
bouni
5938f5a3a1 moved imports to top level (#27682) 2019-10-15 10:06:29 +02:00
Ville Skyttä
68a3c97464 Deprecate Python 3.6 support, 3.8.0 is out (#27680) 2019-10-15 10:04:58 +02:00
HomeAssistant Azure
d8e3255603 [ci skip] Translation update 2019-10-15 00:31:44 +00:00
Chris Caron
3cb844f22c Add Apprise notification integration (#26868)
* Added apprise notification component

* flake-8 fixes; black formatting + import merged to 1 line

* pylint issues resolved

* added github name to manifest.json

* import moved to top as per code review request

* manifest formatting to avoid failing ci

* .coveragerc updated to include apprise

* removed block for written tests

* more test coverage

* formatting as per code review

* tests converted to async style as per code review

* increased coverage

* bumped version of apprise to 0.8.1

* test that mocked entries are called

* added tests for hass.service loading

* support tags for those who identify the TARGET option

* renamed variable as per code review

* 'assert not' used instead of 'is False'

* added period (in case linter isn't happy)
2019-10-15 00:53:59 +02:00
Paulus Schoutsen
3231e22ddf Remove direct authentication via trusted networks or API password (#27656)
* Remove direct authentication via trusted networks and API password

* Fix tests
2019-10-14 14:56:45 -07:00
Michał Mrozek
97478d1ef4 Move imports in switchmate component (#27646)
* move imports in switchmate component

* fix: bring back pylint ignore line
2019-10-14 14:20:35 -07:00
Michał Mrozek
9aa28dfd54 move imports in stream component (#27647) 2019-10-14 14:20:18 -07:00
Michał Mrozek
4efa2f3244 Move imports in steam_online component (#27648)
* move imports in steam_online component

* fix: import reassigment
2019-10-14 14:19:53 -07:00
Michał Mrozek
bcb14182c6 move imports in statsd component (#27649) 2019-10-14 14:19:37 -07:00
ochlocracy
a49dbb9718 Update Unlock directive for Alexa LockController (#27653)
* Update the Alexa.LockController Unlock directive to include the lockState property in the context of the response.

* Added Test for Alexa.LockController Unlock directive to include the lockState property in the context of the response.
2019-10-14 14:19:05 -07:00
javicalle
6c0efe9329 Move imports in panasonic_bluray component (#27658) 2019-10-14 14:17:08 -07:00
Robert Svensson
5c2bf6dc7c Improve discovery title (#27664) 2019-10-14 14:15:46 -07:00
javicalle
487a5b2527 Move imports in panasonic_viera component (#27665) 2019-10-14 14:15:29 -07:00
Bram Kragten
75eb33eb70 Updated frontend to 20191014.0 (#27661) 2019-10-14 13:07:47 -07:00
Ville Skyttä
759ad08930 Typing misc fixes (#27543)
* Make async_get_conditions return type hint more specific

* Exclude script/scaffold/templates/ from pre-commit mypy
2019-10-14 13:03:37 -07:00
Michał Mrozek
2f6c2fadd0 move imports in squeezebox component (#27650) 2019-10-14 14:20:15 -05:00
Erik Montnemery
c7bd0fe909 Fix ZHA regressions caused by "Support async validation of device trigger" (#27401)
* Revert "Support async validation of device trigger (#27333)"

This reverts commit fdf4f398a7.

* Revert only ZHA changes

* Fix whitespace

* Restore ZHA changes but add check to make sure ZHA is loaded

* Address review comment

* Remove additional check
2019-10-14 14:11:43 -04:00
bouni
2295b33204 Move imports in bluesound component (#27502)
* moved imports to top level

* changed import order

* changed import order
2019-10-14 19:57:03 +02:00
Steven D. Lander
5a83a92390 Refactor imports for tensorflow (#27617)
* Refactoring imports for tensorflow

* Removing whitespace spaces on blank line 110

* Moving tensorflow to try/except block

* Fixed black formatting

* Refactoring try/except to if/else
2019-10-14 08:44:30 -07:00
Otto Winter
09de6d5889 Fix ESPHome climate preset mode refactor (#27637)
Fixes https://github.com/home-assistant/home-assistant/issues/25613
2019-10-14 08:41:16 -07:00
javicalle
de7963544f Apply isort on rfxtrx classes (#27615)
* Move imports in rfxtrx component

* Apply isort on rfxtrx files

* Update test_switch.py
2019-10-14 10:38:34 -05:00
ju
288d370ef5 Fix html5 notification documentation url (#27636) 2019-10-14 10:28:25 -05:00
bouni
6d4e3945d6 moved imports to top level (#27641) 2019-10-14 10:25:55 -05:00
Otto Winter
a79a9809f4 ESPHome Fix intermediary state published (#27638)
Fixes https://github.com/esphome/issues/issues/426
2019-10-14 16:02:39 +02:00
bouni
79b391c673 moved imports to top level (#27640) 2019-10-14 15:58:15 +02:00
Martin
d7d7f6a1c9 Fix temperature and heating mode (#27604) 2019-10-14 15:03:07 +02:00
Malte Franken
91c6cd9646 Move imports in darksky component (#27633)
* move imports to top-level

* modify patch path

* removed unused mocks and patches
2019-10-14 15:02:00 +02:00
bouni
aefb807222 moved imports to top level (#27634) 2019-10-14 15:00:51 +02:00
bouni
14e3b3af6f moved imports to top level (#27632) 2019-10-14 15:00:02 +02:00
Michał Mrozek
3c280565fa move imports in synology_srm component (#27603) 2019-10-14 14:59:26 +02:00
Pascal Vizeli
017a5a5b09 Update azure-pipelines-wheels.yml for Azure Pipelines 2019-10-14 14:30:08 +02:00
Malte Franken
1cae6e664c move imports to top-level (#27630) 2019-10-14 10:56:40 +02:00
Steven D. Lander
b7023a96a3 Issue #27288 Move imports to top for FFMPEG (#27613) 2019-10-14 10:51:37 +02:00
Askarov Rishat
ff4e35e0ad Update yandex transport after api change (#27591)
* yandex maps api changed ("threads" in "Transport" added), ya_ma=>0.3.8 bug_fixed

* Update homeassistant/components/yandex_transport/sensor.py

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

* additional fix

* reformat

* fix mistake
2019-10-14 10:12:08 +02:00
Moritz Fey
da29c1125f add content for services.yaml for ccomponent stream (#27610) 2019-10-13 22:13:31 -07:00
Steven D. Lander
2cf3f6bffa Issue #27288 Moving imports to top for tesla component (#27618) 2019-10-13 22:02:01 -07:00
Michał Mrozek
afa7e0bfe8 fix: exception after kaiterra api call timeout (#27622) 2019-10-13 22:01:40 -07:00
jjlawren
cf76f22c89 Rewrite Plex tests (#27624) 2019-10-13 21:59:25 -07:00
HomeAssistant Azure
b37f0ad812 [ci skip] Translation update 2019-10-14 00:32:27 +00:00
Daniel Perna
fe7467cd5c Update pyhomematic to 0.1.61 (#27620) 2019-10-14 00:01:14 +02:00
Paulus Schoutsen
e866d769e8 Google Assistant Local SDK (#27428)
* Local Google

* Fix test

* Fix tests
2019-10-13 14:16:27 -07:00
Patrik
3454b6fa87 Refactor Tradfri base class (#27589)
* Refactor Tradfri base class

* Clarify doc

* Fix pylint

* Review fix

* Move
2019-10-13 13:59:28 -07:00
Santobert
9fb0812ce5 Improve neato tests (#27578)
* Improve tests

* Rename account to configflow

* configflow to config_flow

* Patch pybotvac instead of own code
2019-10-13 13:56:34 -07:00
Patrik
0235487a22 Move top level imports (#27597) 2019-10-13 13:56:01 -07:00
Michał Mrozek
c5dc670b36 move imports in tellstick component (#27600) 2019-10-13 13:55:43 -07:00
Michał Mrozek
d8b73f9459 move imports in ted5000 component (#27601) 2019-10-13 13:55:24 -07:00
Moritz Fey
48c1a0290c add content for services.yaml in component media_extractor (#27608)
* add content for services.yaml for media_extractor component

* remove example data

* add empty line on end of file

* Update services.yaml
2019-10-13 13:53:42 -07:00
Michał Mrozek
1d2b59db82 Move imports in syslog (#27602) 2019-10-13 22:38:42 +02:00
Fabian Affolter
585214f3a4 Upgrade Mastodon.py to 1.5.0 (#27598) 2019-10-13 22:29:48 +02:00
Ville Skyttä
5e79408708 Upgrade to flake8-docstrings 1.5.0, pytest 5.2.1, and pytest-cov 2.8.1 (#27588)
https://gitlab.com/pycqa/flake8-docstrings/blob/1.5.0/HISTORY.rst
https://docs.pytest.org/en/latest/changelog.html#pytest-5-2-1-2019-10-06
https://pytest-cov.readthedocs.io/en/latest/changelog.html#id1
2019-10-13 22:27:42 +02:00
Michał Mrozek
45694de2ee move imports in tibber component (#27584) 2019-10-13 22:25:54 +02:00
javicalle
dd8fc41747 Move imports in rflink component (#27367)
* Move imports in rflink component

* import order

* import order

* Update __init__.py

* Update __init__.py

I don't understand why tests are failing...

* Fix RFLink imports

* Fix monkeypatch for 'create_rflink_connection'

* isort for rflink classes
2019-10-13 22:19:11 +02:00
starkillerOG
2acd3f9e98 Allow MQTT json light floating point transition (#27253)
* MQTT json light: allow floating point transition

Allow to use floating point values for the transition time of the MQTT json light.
In this way transitions shorter than 1s can be used (0.5 seconds for instance) if the MQTT light supports it.

* Always sent a float
2019-10-13 20:29:14 +02:00
shred86
1774a1427b Add abode config entries and device registry (#26699)
* Adds support for config entries and device registry

* Fixing string formatting for logger

* Add unit test for abode config flow

* Fix for lights, only allow one config, add ability to unload entry

* Fix for subscribing to hass_events on adding abode component

* Several fixes from code review

* Several fixes from second code review

* Several fixes from third code review

* Update documentation url to fix branch conflict

* Fixes config flow and removes unused constants

* Fix for switches, polling entry option, improved tests

* Update .coveragerc, disable pylint W0611, remove polling from UI

* Multiple fixes and edits to adhere to style guidelines

* Removed unique_id

* Minor correction for formatting error in rebase

* Resolves issue causing CI to fail

* Bump abodepy version

* Add remove device callback and minor clean up

* Fix incorrect method name

* Docstring edits

* Fix duplicate import issues from rebase

* Add logout_listener attribute to AbodeSystem

* Add additional test for complete coverage
2019-10-13 20:01:04 +02:00
Michał Mrozek
d96cd4c4ea Move imports in tplink component (#27567)
* move imports in tplink component

* fix: order of imports

* fix: tplink tests

* fix: import order in tests

* fix: tests formatting
2019-10-13 17:05:04 +02:00
bouni
5e4b33c740 Move imports in bme280 component (#27505) 2019-10-13 15:09:44 +02:00
Michał Mrozek
989c3581ac Move imports in tplink_lte component (#27583) 2019-10-13 15:01:13 +02:00
Michał Mrozek
627ca3182a Move imports in thingspeak component (#27585) 2019-10-13 14:56:02 +02:00
springstan
930182a7cb Move import in deutsche_bahn integration (#27579)
* Moved import in deutsche_bahn integration

* Moved import schiene before PLATFORM_SCHEMA
2019-10-13 14:54:38 +02:00
Fabian Affolter
bbafeb5da2 Upgrade pillow to 6.2.0 (#27581) 2019-10-13 14:46:12 +02:00
Michał Mrozek
bb2a1cd439 Move imports in thermoworks_smoke component (#27586) 2019-10-13 14:42:29 +02:00
Fabian Affolter
b570be47ca Upgrade alpha_vantage to 2.1.1 (#27580)
* Upgrade alpha_vantage to 2.1.1

* Move imports
2019-10-13 12:46:43 +02:00
foxy82
7aae106525 Fix pioneer volume when using onkyo component (#27218)
* Fix Onkyo when using pioneer AV receiver so it can use max volume of 164

* Update media_player.py

Change to make receiver max volume configurable

* Update manifest.json

Update to latest onkyo-eiscp with a fix required for Pionner AVR

* Fix Onkyo when using pioneer AV receiver so it can use max volume of 164

* Fix Onkyo when using pioneer AV receiver so it can use max volume of 164

* Format

* Requirements all

* Fix CI errors

* Black
2019-10-13 10:59:35 +02:00
Paulus Schoutsen
066f2db602 Merge remote-tracking branch 'origin/master' into dev 2019-10-12 23:34:51 -07:00
Paulus Schoutsen
71f73af535 Merge pull request #27572 from home-assistant/rc
0.100.2
2019-10-12 23:33:53 -07:00
Paulus Schoutsen
24a1139c1d Update reqs 2019-10-12 20:27:48 -07:00
chriscla
57e6dc3f7a Fixing nzbget units display (#27521) 2019-10-12 20:19:02 -07:00
chriscla
6cbc9d6abb Fixing nzbget units display (#27521) 2019-10-12 20:18:30 -07:00
Paulus Schoutsen
17c3efa556 Bumped version to 0.100.2 2019-10-12 20:12:54 -07:00
Paulus Schoutsen
422ba89c6d Google: catch query not supported (#27559) 2019-10-12 20:12:48 -07:00
Mark Coombes
134137dd1c Fix for unknown sensor state (#27542) 2019-10-12 20:12:48 -07:00
Jordan Speicher
0fd49e13da Add mobile_app dependency on cloud (#27470) 2019-10-12 20:12:47 -07:00
Florent Thoumie
093ee7d5b2 iaqualink: set 5s timeout, use cookiejar defaults (#27426) 2019-10-12 20:12:46 -07:00
Teemu R
e8e32e3ed4 bump songpal to fix attrs usage when using its most recent version (#27410) 2019-10-12 20:12:46 -07:00
Teemu R
258f86801c Bump python-songpal (#27398)
Fixes #24269 and fixes #26776 - potentially also #22116
2019-10-12 20:12:45 -07:00
Robert Van Gorkom
863cf9823b Vangorra withings fix (#27404)
* Fixing connection issues with withings API by switching to a maintained client codebase.

* Updating requirements files.

* Adding withings api to requirements script.

* Using version of withings api with static version in setup.py.

* Updating requirements files.
2019-10-12 20:09:55 -07:00
Michał Mrozek
df646f5db1 Move imports in tikteck component (#27568)
* move imports in tikteck component

* fix: order of imports
2019-10-12 20:02:29 -07:00
springstan
25bec13335 Filled services.yaml for logbook integration (#27560) 2019-10-12 20:01:12 -07:00
springstan
a8f43843bf Filled services.yaml for browser integration (#27563)
* Filled services.yaml for browser integration

* Update services.yaml
2019-10-12 20:00:48 -07:00
Michał Mrozek
1fa6d9887e Move imports in tts component (#27565)
* move imports in tts components

* fix: order of imports
2019-10-12 19:59:30 -07:00
HomeAssistant Azure
62b886a5d5 [ci skip] Translation update 2019-10-13 00:31:39 +00:00
Paulus Schoutsen
a82ff4f7a9 Add strings for device automations to scaffold (#27556) 2019-10-12 14:09:06 -07:00
Paulus Schoutsen
9e121b785a Google: catch query not supported (#27559) 2019-10-12 14:07:01 -07:00
Mark Coombes
6c947f58b8 Fix for unknown sensor state (#27542) 2019-10-12 13:11:30 -07:00
Moritz Fey
96c0ad302f add device conditions for platform cover (#27544)
* add device condition support to the cover integration

* remove TODO comment

* add strings.json
2019-10-12 13:08:45 -07:00
SukramJ
1f7bd4235c Add test to Homematic IP Cloud switch (#27532) 2019-10-12 13:07:54 -07:00
Sébastien RAMAGE
6b92dbe209 Move imports for pushbullet component (#27460)
* Move imports in dht component

* remove empty line

* Move imports for pushbullet component

* revert unwanted changes

* Move imports for pushbullet component

* remove dht change from that branch

* remove dht changes from this branch
2019-10-12 13:05:36 -07:00
Jordan Speicher
86da3fb334 Add mobile_app dependency on cloud (#27470) 2019-10-12 13:05:01 -07:00
bouni
3096e94343 moved imports to top level (#27469) 2019-10-12 13:04:42 -07:00
bouni
88e54a4ce6 moved imports to top level (#27468) 2019-10-12 13:04:35 -07:00
Paolo Tuninetto
08ccaac21f Move Epson imports (#27457) 2019-10-12 13:04:14 -07:00
Sébastien RAMAGE
3b4e257214 Move imports in dht component (#27459)
* Move imports in dht component

* remove empty line

* Move imports for pushbullet component

* revert unwanted changes
2019-10-12 13:03:56 -07:00
bouni
930b576685 moved imports to top level (#27458) 2019-10-12 13:03:42 -07:00
Quentame
72b711fde6 Move imports in w800rf32 component (#27451) 2019-10-12 13:03:02 -07:00
quthla
e9642a0f65 Bump PyGithub to 1.43.8 (#27432)
* Bump PyGithub to 1.43.8

* Bump PyGithub to 1.43.8
2019-10-12 13:02:20 -07:00
bouni
8a1738281a moved imports to top level (#27454) 2019-10-12 13:02:12 -07:00
Quentame
701bb666c4 Move imports in watson_iot component (#27448) 2019-10-12 13:01:34 -07:00
quthla
3b9ee9c901 Bump RtmAPI to 0.7.2 (#27433)
* Bump RtmAPI to 0.7.2

* Bump RtmAPI to 0.7.2

* Bump RtmAPI to 0.7.2
2019-10-12 13:00:48 -07:00
foreign-sub
15f0fabe9d Bump pysyncthru to 0.5.0 (#27439) 2019-10-12 12:59:36 -07:00
Fredrik Erlandsson
22e7cb11f4 Change persistent notification about dev-info panel (#27441)
* there is no dev-info panel anymore

* Update __init__.py

* Update __init__.py
2019-10-12 12:58:52 -07:00
Paolo Tuninetto
17b1ba2e9f Move AmazonPolly imports (#27443) 2019-10-12 12:57:18 -07:00
Maciej Bieniek
652bf54044 Fix update after network error (#27444) 2019-10-12 12:57:01 -07:00
Paulus Schoutsen
64f9ecbac9 Remove incorrect translation folder 2019-10-12 12:56:10 -07:00
Quentame
bac337889f Move imports in vera component (#27477) 2019-10-12 12:55:40 -07:00
Quentame
eaf855286b Move imports in verisure component (#27476) 2019-10-12 12:55:33 -07:00
Quentame
c5b12d6006 Move imports in venstar component (#27478) 2019-10-12 12:54:55 -07:00
Quentame
0a2ec30ce3 Move imports in vasttrafik component (#27480) 2019-10-12 12:54:41 -07:00
Quentame
54d63c63c3 Move imports in uscis component (#27481) 2019-10-12 12:54:16 -07:00
bouni
5198f522c7 moved imports to top level (#27483) 2019-10-12 12:53:43 -07:00
Erik Montnemery
15820c6751 Add device condition support to the lock integration (#27488) 2019-10-12 12:53:15 -07:00
bouni
8436acbffa moved imports to top level (#27495) 2019-10-12 12:52:34 -07:00
bouni
2c8e24eb14 moved imports to top level (#27496) 2019-10-12 12:52:19 -07:00
thaohtp
468e6c30b3 Move imports in aruba component to top-level (#27497)
Issue: https://github.com/home-assistant/home-assistant/issues/27284
2019-10-12 12:52:04 -07:00
bouni
3ca74373d3 moved imports to top level (#27500) 2019-10-12 12:51:32 -07:00
Kevin Fronczak
3f9f8eb379 Update blink version to 0.14.2 (#27555)
* Update blink version to 0.14.2

* Ren gen_requirements_all script
2019-10-12 21:51:10 +02:00
bouni
4cded9782d moved imports to top level (#27498) 2019-10-12 12:50:30 -07:00
bouni
b825631676 moved imports to top level (#27501) 2019-10-12 12:48:30 -07:00
bouni
0331c8453a moved imports to top level (#27503) 2019-10-12 12:48:12 -07:00
thaohtp
1dcdc17202 Move imports in startca to top-level (#27510) 2019-10-12 12:46:26 -07:00
bouni
b9d54de09b moved imports to top level (#27509) 2019-10-12 12:45:40 -07:00
bouni
ae5cb82908 moved imports to top level (#27508) 2019-10-12 12:45:31 -07:00
SukramJ
f979eca83a Add test to Homematic IP Cloud climate (#27472) 2019-10-12 12:45:11 -07:00
bouni
6317ef1324 moved imports to top level (#27512) 2019-10-12 12:44:47 -07:00
SukramJ
28e3cf29b3 Add test to Homematic IP Cloud sensor (#27533) 2019-10-12 12:44:19 -07:00
SukramJ
bb1be5327e Add test to Homematic IP Cloud cover (#27535) 2019-10-12 12:44:13 -07:00
SukramJ
eb77db6569 Add test to Homematic IP Cloud alarm control panel (#27534) 2019-10-12 12:43:46 -07:00
SukramJ
5030be274a Add test to Homematic IP Cloud weather (#27536) 2019-10-12 12:43:06 -07:00
Moritz Fey
ddeac071b3 fill services.yaml for downloader (#27553) 2019-10-12 12:38:39 -07:00
javicalle
40e5beb0ed Move imports in rfxtrx component (#27549) 2019-10-12 12:37:59 -07:00
bouni
3873a1b070 moved imports to top level (#27494) 2019-10-12 12:35:39 -07:00
Erik Montnemery
42691b783e Handle empty service in script action gracefully (#27467)
* Handle empty service in script action gracefully

* Add test
2019-10-12 12:28:47 -07:00
Quentame
ee8b72fb71 Move imports in http component (#27474) 2019-10-12 12:27:27 -07:00
Rolf K
96d35379f2 Add improved scene support to input number integration (#27530)
* Added improved scene support to the input_number integration.

* Minor fix in test.

* Use snake case for variable names in test_reproduce_state.

* Remove redundant tests.
2019-10-12 11:46:09 -07:00
Patrik
86386912b9 Refactor Tradfri cover (#27413)
* Remove unused logging

* Refactor cover

* Remove method

* Fix typo and use consistent wording for gateway

* Revert changes
2019-10-12 17:53:25 +02:00
thaohtp
21ca936d33 Move imports in upcloud component to top-level (#27514)
* Move imports in upcloud component to top-level

* Additional isort ordering
2019-10-12 17:30:21 +03:00
Erik Montnemery
dbe366933f Fix typing for device condition scaffold (#27487) 2019-10-12 16:37:32 +03:00
Florent Thoumie
22eaff9897 iaqualink: set 5s timeout, use cookiejar defaults (#27426) 2019-10-12 08:17:02 -05:00
foreign-sub
9d7a218df5 Bump pygatt to 4.0.5 (#27526) 2019-10-12 15:08:57 +02:00
Quentame
3d05228ec1 Move imports in vizio component (#27452) 2019-10-12 14:09:39 +02:00
bouni
de4482e8d3 Move imports in acer_projector component (#27456) 2019-10-12 08:43:34 +02:00
Quentame
af4bcf8de6 Move imports in waqi component (#27450) 2019-10-12 07:44:22 +02:00
thaohtp
d516bc44fa Move trend imports to top level (#27507) 2019-10-12 07:40:44 +02:00
Jacob Mansfield
a712c9b9f5 SNMP Switch payloads are not guaranteed to be integers (#27422)
Fixes #27171
2019-10-12 07:23:55 +02:00
cgtobi
99e7808441 Move imports in rmvtransport (#27420) 2019-10-12 07:21:53 +02:00
Quentame
f236e84753 Move imports in updater component (#27485) 2019-10-12 07:19:53 +02:00
bouni
712628395e moved imports to top level (#27511) 2019-10-12 07:18:47 +02:00
John Mihalic
d58717d772 Bump pyhik to 0.2.4 (#27523) 2019-10-12 07:18:15 +02:00
HomeAssistant Azure
78a08d0425 [ci skip] Translation update 2019-10-12 00:31:47 +00:00
Quentame
8bd847ed39 Move imports in waterfurnace component (#27449) 2019-10-11 18:30:27 +02:00
cgtobi
cb30065a40 Update upstream (#27440) 2019-10-11 18:29:27 +02:00
Paolo Tuninetto
618cf5fa04 Move Arduino imports (#27438) 2019-10-11 17:52:38 +02:00
SukramJ
8bbf261302 Refactor home --> hap for Homematic IP Cloud (#27368)
* Refactor home to hap for Homematic IP Cloud

* Add some tests

* Rename ha_entity --> ha_state

* use asynctest.Mock
2019-10-11 16:36:46 +02:00
quthla
0c8e208fd8 Bump python-slugify to 3.0.6 (#27430)
* Bump python-slugify to 3.0.6

* Bump python-slugify to 3.0.6

* Bump python-slugify to 3.0.6
2019-10-11 00:27:07 -07:00
HomeAssistant Azure
4c71c6df6f [ci skip] Translation update 2019-10-11 00:31:40 +00:00
Teemu R
4b8a35dffb move songpal imports to top (#27402)
* move songpal imports to top

* Update media_player.py
2019-10-10 12:53:05 -07:00
Franck Nijhof
ed3516186b Bump sqlalchemy to 1.3.10 (#27408) 2019-10-10 12:52:54 -07:00
Franck Nijhof
aecf7e65ff Bump aiohttp to 3.6.2 (#27409) 2019-10-10 12:52:40 -07:00
Teemu R
4f4bbedc58 bump songpal to fix attrs usage when using its most recent version (#27410) 2019-10-10 12:52:29 -07:00
Paulus Schoutsen
2ab6eb4fa0 Revert "Allow Google Assistant relative volume control (#26585)" (#27416)
This reverts commit 95c537bee8.
2019-10-10 12:46:40 -07:00
Tsvi Mostovicz
9e3005133a Standardize times in time sensors Jewish calendar (#26940)
* Standardize times in time sensors Jewish calendar

* Fix pylint errors

* Add non-default time format test

* Make black happy

* Remove timestamp device class

Timestamp device class requires ISO 8601 format

* Revert "Remove timestamp device class"

This reverts commit 8a2fda39831bc750c3a77aa774b84b054d78032c.

* Remove time_format

As this is part of the UI decision, it should be decided by lovelace.

A nice addition for a future PR, might be the option to hint to lovelace the preferred way to display some data.

* Update name of state_attributes

* State of timestamp variable to be shown in UTC

Although I don't understand it, I give up :)

* Remove unnecessary attributes

I don't really see the value in these attributes, if there are any they should be implemented in
the sensor component for the timestamp device class
2019-10-10 20:57:48 +02:00
Franck Nijhof
2e9e8a16bd Remove hydroquebec integration (ADR-0004) (#27407) 2019-10-10 20:51:04 +02:00
Quentame
7e91677362 Move imports in apple_tv component (#27356)
* Move imports in apple_tv component

* Fix pylint
2019-10-10 11:39:09 -07:00
Robert Van Gorkom
77490a3246 Vangorra withings fix (#27404)
* Fixing connection issues with withings API by switching to a maintained client codebase.

* Updating requirements files.

* Adding withings api to requirements script.

* Using version of withings api with static version in setup.py.

* Updating requirements files.
2019-10-10 11:22:36 -07:00
Markus Nigbur
27f036c691 Move imports in eufy component (#27405) 2019-10-10 11:16:30 -07:00
Markus Nigbur
13ac6ac315 Move imports in github component (#27406) 2019-10-10 11:16:19 -07:00
Kevin Eifinger
99885b9acf Move imports in google_travel_time component (#27381) 2019-10-10 09:57:14 -07:00
Quentame
fc7a20d180 Move imports in yr component (#27382) 2019-10-10 09:57:00 -07:00
Quentame
6364da1150 Move imports in zigbee component (#27383) 2019-10-10 09:56:07 -07:00
Quentame
ec08c251ea Move imports in zestimate component (#27386) 2019-10-10 09:54:20 -07:00
Quentame
f5560e2b18 Move imports in zengge component (#27387) 2019-10-10 09:53:52 -07:00
Quentame
19c8710698 Move imports in yamaha + yamaha_musiccast component (#27389) 2019-10-10 09:53:27 -07:00
Quentame
a5ee138d56 Move imports in xmpp component (#27390) 2019-10-10 09:52:19 -07:00
Quentame
84d1c0ca31 Move imports in wunderlist component (#27391) 2019-10-10 09:52:03 -07:00
Quentame
91379b0ff7 Move imports in wink component (#27392) 2019-10-10 09:51:28 -07:00
Quentame
7b13f0caf7 Move imports in wemo component (#27393) 2019-10-10 09:50:58 -07:00
Kevin Eifinger
e93ffa5688 Move imports in waze_travel_time component (#27384) 2019-10-10 09:48:59 -07:00
Teemu R
6c945c845e Bump python-songpal (#27398)
Fixes #24269 and fixes #26776 - potentially also #22116
2019-10-10 09:30:30 -07:00
Fabian Affolter
1719bc6fd3 Remove hipchat (#27399)
* Delete hipchat integration

* Remove hipchat
2019-10-10 09:30:15 -07:00
Paulus Schoutsen
dfcab456c6 Merge remote-tracking branch 'origin/master' into dev 2019-10-10 09:13:56 -07:00
Paulus Schoutsen
8f384e6b82 Merge pull request #27396 from home-assistant/rc
0.100.1
2019-10-10 09:08:22 -07:00
Ryan Ewen
95c537bee8 Allow Google Assistant relative volume control (#26585)
* Allow Google Assistant volume control without volume_level

* Add test for relative volume control w/o volume_level
2019-10-10 17:53:52 +03:00
Bram Kragten
7398e06c78 fix withings nokia test req 2019-10-10 15:03:39 +02:00
Bram Kragten
9f32e5cf46 Bumped version to 0.100.1 2019-10-10 14:32:40 +02:00
Martin Hjelmare
65372da241 Revert "Fix connection issues with withings API by switching to a maintained codebase (#27310)" (#27385)
This reverts commit 071476343c.
2019-10-10 14:29:38 +02:00
Martin Hjelmare
c188ecf79b Revert "Fix connection issues with withings API by switching to a maintained codebase (#27310)" (#27385)
This reverts commit 071476343c.
2019-10-10 14:21:42 +02:00
Malte Franken
d337b71725 move import to top-level (#27352) 2019-10-10 00:25:21 -07:00
Malte Franken
0cc2d0d557 move import to top-level (#27353) 2019-10-10 00:24:38 -07:00
Quentame
7718d61cd7 Move imports in netatmo component (#27360) 2019-10-10 00:22:10 -07:00
Quentame
6c739f4be5 Move imports in nissan_leaf component (#27359) 2019-10-10 00:21:40 -07:00
Quentame
549c79b6ce Move imports in season component (#27358) 2019-10-10 00:21:18 -07:00
Markus Nigbur
a2591e696c Move imports in vlc component (#27361) 2019-10-10 00:19:46 -07:00
Mark Coombes
829cffd5de Fix ecobee weather platform (#27369)
* Fix ecobee weather platform

* Remove custom forecast attributes

* Tidy up process forecast method

* Fix lint complaints

* Add missed weather symbol
2019-10-10 00:05:46 -07:00
Paulus Schoutsen
baa750a3c7 Merge remote-tracking branch 'origin/master' into dev 2019-10-09 23:46:48 -07:00
Santobert
80f6781f21 Migrate Neato to use top-level imports (#27363)
* Neato move imports up

* Move one last import

* Fix tests
2019-10-10 08:08:11 +02:00
HomeAssistant Azure
762a714d87 [ci skip] Translation update 2019-10-10 00:31:40 +00:00
Paulus Schoutsen
54c24de158 Install requirements for all deps with tests (#27362)
* Install requirements for all deps with tests

* Remove unused REQUIREMENTS var

* Print diff if not the same

* Simplify

* Update command line

* Fix detecting empty dirs

* Install non-integration

* Fix upnp tests

* Lint

* Fix ZHA test
2019-10-09 16:16:29 -07:00
Bram Kragten
74ef1358da Updated frontend to 20191002.2 (#27370) 2019-10-09 23:06:27 +02:00
Patrik
78e9bba279 Refactor Tradfri constants (#27334)
* Refactor constants

* Rename constant

* Rename constant

* Rename constant

* Review update

* Remove duplicate constant

* Reorder constants

* Dont refresh features

* Order package imports

* Fix bug

* Put back features in refresh

* Fix import order

* Refactor supported features

* Refactor supported features, take 2
2019-10-09 12:56:16 -07:00
Robert Svensson
a8db8d8c0b deCONZ - Update discovery address (#27365) 2019-10-09 21:44:02 +02:00
Erik Montnemery
fdf4f398a7 Support async validation of device trigger (#27333) 2019-10-09 21:04:11 +02:00
Oncleben31
3194dd3456 Add documentation for logger.set_level service (#27211)
* Add set_level doc

* use only yaml

* reformat

* improvements
2019-10-09 10:58:36 -07:00
Sébastien RAMAGE
1257706bd9 Update zigpy-zigate to 0.4.1 (#27345)
* Update zigpy-zigate to 0.4.1

Fix #27297

* Update zigpy-zigate to 0.4.1

Fix #27297
2019-10-09 08:47:43 -04:00
Malte Franken
9ea58b970e Move imports in caldav component (#27349) 2019-10-09 12:02:09 +02:00
Malte Franken
3d937bfd8a move import to top-level (#27348) 2019-10-09 10:57:51 +02:00
HomeAssistant Azure
768bb00177 [ci skip] Translation update 2019-10-09 00:32:17 +00:00
Ville Skyttä
3e6b9a17cc Run mypy in pre-commit (#27339)
* Move mypy files config to setup.cfg

* Add mypy in pre-commit
2019-10-08 14:45:24 -07:00
Robert Svensson
d345b58ce6 Improve UniFi config flow tests and add options flow test (#27340) 2019-10-08 14:44:33 -07:00
Erik Montnemery
7f20210e93 Include unit_of_measurement in sensor device trigger capabilities (#27265)
* Expose unit_of_measurement in sensor device trigger

* Update test
2019-10-08 12:52:25 -07:00
Robert Van Gorkom
071476343c Fix connection issues with withings API by switching to a maintained codebase (#27310)
* Fixing connection issues with withings API by switching to a maintained client codebase.

* Updating requirements files.

* Adding withings api to requirements script.
2019-10-08 20:14:52 +02:00
SukramJ
55e10d552e Cleanup handling of attributes for HomematicIP Cloud (#27331)
* Cleanup handling of attributes for HomematicIP Cloud

* Remove special climate handling
2019-10-08 19:52:43 +02:00
Erik Montnemery
0ba4ee1398 Validate generated device actions (#27262)
* Validate generated actions

* Use hass.services.async_call instead of service.async_call_from_config
2019-10-08 10:06:17 -07:00
Santobert
1a9d07dbdc Improve Neato login process (#27327)
* initial commit

* Readded log message

* Clean up try-except
2019-10-08 10:05:35 -07:00
Paulus Schoutsen
f5bd0f29b4 Add scene.apply service (#27298)
* Add scene.apply service

* Use return value entity ID validator"

* Require entities field in service call

* Simplify scene service
2019-10-08 09:59:32 -07:00
Paulus Schoutsen
a51e0d7a5f Google: Report all states on activating report state (#27312) 2019-10-08 09:58:36 -07:00
Erik Montnemery
0cfd0388d6 Fix translations for binary_sensor triggers (#27330) 2019-10-08 09:57:24 -07:00
Bram Kragten
cf555428d0 Updated frontend to 20191002.1 (#27329) 2019-10-08 09:33:14 -07:00
Evan Bruhn
15c54f34df Fix Logi Circle cameras not responding to turn on/off commands (#27317) 2019-10-08 09:31:52 -07:00
Fabian Affolter
13956d3516 Upgrade sqlalchemy to 1.3.9 (#27322) 2019-10-08 09:30:18 -07:00
Fabian Affolter
396e68a4b9 Upgrade beautifulsoup4 to 4.8.1 (#27325) 2019-10-08 09:28:37 -07:00
ottersen
0a66a03de6 Align user name vs username (#27328)
Align to be Username as all other integrations
2019-10-08 09:27:49 -07:00
Fabian Affolter
937d348867 Upgrade certifi to >=2019.9.11 (#27323) 2019-10-08 09:00:11 -07:00
jjlawren
df8bf51598 Fix single Plex server case (#27326) 2019-10-08 08:54:01 -07:00
Fabian Affolter
7a57c3a66a Set pytz to >=2019.03 2019-10-08 16:23:21 +02:00
Malte Franken
e176f16141 move import to top-level (#27320) 2019-10-08 16:14:50 +02:00
Malte Franken
15c56f1f64 Move imports in geo_rss_events component (#27313)
* move imports to top-level

* fixed patch path

* added myself as codeowner

* regenerated codeowners
2019-10-08 12:50:45 +02:00
Malte Franken
5645d43bd1 move import to top-level (#27314) 2019-10-08 12:50:23 +02:00
Brendon Baumgartner
15870e0185 Do not fail smtp notify service on connection error (#27240)
* smtp notify dont disable service

* auth fails smtp notify service
2019-10-08 10:14:17 +02:00
Robert Van Gorkom
50b5dba43e Making withings logs less noisy. (#27311) 2019-10-07 22:22:13 -07:00
Erik Montnemery
c72ac87c73 Fix device condition scaffold (#27300) 2019-10-07 20:10:21 -07:00
Paulus Schoutsen
c9e26b6fd0 Improve speed websocket sends messages (#27295)
* Improve speed websocket sends messages

* return -> continue
2019-10-07 20:08:07 -07:00
HomeAssistant Azure
1087abd3b5 [ci skip] Translation update 2019-10-08 00:32:12 +00:00
Erik Montnemery
dabdf8b577 Validate generated device triggers (#27264)
* Validate generated trigger

* Update scaffold
2019-10-07 13:09:48 -07:00
Robert Svensson
6565c17828 UniFi - Improve controller tests (#27261)
* Improve controller tests and harmonize setup_unifi_integration to one
* Store listeners to dispatchers to be used during reset
2019-10-07 21:55:35 +02:00
Santobert
1febb32dd9 Neato clean up (#27294)
* Replace hass with neato

* Clean up try-except blocks

* Add some new try-except blocks

* Clean up vacuum

* Minor fix

* Another fix
2019-10-07 12:49:54 -07:00
jjlawren
a3c98440e0 Remove manual config flow step (#27291) 2019-10-07 11:29:12 -07:00
Daniel Shokouhi
35bca702b4 Neato battery sensor (#27286)
* initial commit

* Pring log only once if available

* Update coverage

* Review comments

* Move variables
2019-10-07 11:09:08 -07:00
Patrik
fe155faf6a Refactor tradfri light (#27259)
* Refactor light file

* Update following review
2019-10-07 10:43:47 -07:00
Edgardo Ramírez
7cdb76eedb FIX: Typo (#27267) 2019-10-07 10:41:26 -07:00
Aaron Godfrey
feb1986459 Fix the todoist integration (#27273)
* Fixed the todoist integration.

* Removing unused import

* Flake8 fixes.

* Added username to codeowners.

* Updated global codeowners
2019-10-07 10:40:52 -07:00
Chandan Rai
eb10f8dcd3 fixed minor typo in docs/source/api/helpers.rst (#27282) 2019-10-07 10:25:36 -07:00
Ville Skyttä
761d7f21e9 Upgrade pylint (#27279)
* Upgrade pylint to 2.4.2 and astroid to 2.3.1

https://pylint.readthedocs.io/en/latest/whatsnew/2.4.html
https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-1
https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-2

* unnecessary-comprehension fixes

* invalid-name fixes

* self-assigning-variable fixes

* Re-enable not-an-iterable

* used-before-assignment fix

* invalid-overridden-method fixes

* undefined-variable __class__ workarounds

https://github.com/PyCQA/pylint/issues/3090

* no-member false positive disabling

* Remove some no longer needed disables

* using-constant-test fix

* Disable import-outside-toplevel for now

* Disable some apparent no-value-for-parameter false positives

* invalid-overridden-method false positive disables

https://github.com/PyCQA/pylint/issues/3150

* Fix unintentional Entity.force_update override in AfterShipSensor
2019-10-07 08:17:39 -07:00
Ville Skyttä
3adac699c7 Note snake_case state attribute name convention in entity docs (#27287)
https://github.com/home-assistant/home-assistant/pull/26675#discussion_r331763063
2019-10-07 08:16:26 -07:00
Sergio Conde Gómez
f6b8cffeaf Add PTZ support to Foscam camera component (#27238)
* Add PTZ support to Foscam camera component

* Address review comments:

 - Move service to foscam domain
 - Use `dict[key]` for required schema keys or with defaults
 - Fix sync operations in async context
 - Remove excessive logging

* Fix import order

* Move all the initialization to setup_platform and fix motion detection status logic

* Move function dictionary out of the function.

* Change user input to lowercase snake case

* Change user input to lowercase snake case

* Fix service example value

* Omit foscam const module from code coverage tests

* Add myself to foscam codeowners
2019-10-07 13:17:43 +02:00
Santobert
4124211095 Add attributes to neato integration (#27260)
* inital commit

* simplify self.neato
2019-10-07 08:30:49 +02:00
Erik Montnemery
5d1dd6390d Validate generated condition (#27263) 2019-10-06 21:06:16 -07:00
jjlawren
0915d927df Fix Plex media_player.play_media service (#27278)
* First attempt to fix play_media

* More changes to media playback

* Use playqueues, clean up play_media

* Use similar function name, add docstring
2019-10-06 21:02:58 -07:00
HomeAssistant Azure
073bdd672a [ci skip] Translation update 2019-10-07 00:32:19 +00:00
Oncleben31
3b9f0062a2 Add missing documentation for some Hassio services (#27215)
* Add services doc

* Add missing services doc and reformat

* improve readability

* content improvement

* HassIO to Hass.io
2019-10-06 23:02:15 +02:00
CQoute
02c983d332 Add 'flash_length' to esphome light async_turn_off (#27214)
flash_length was overlooked when fixing the asyn_turn_on flash attribute. async_turn_off is now fixed with the flash attribute.
2019-10-06 21:49:31 +02:00
Santobert
dae8cd8801 Bump pybotvac and use new exceptions (#27249)
* Bump pybotvac

* Fix tests

* Remove super calls

* Surround some more statements

* Correct logger message for vacuum
2019-10-06 20:10:11 +02:00
Patrik
1059cea28f Refactor IKEA Tradfri, part 2 (#27245)
* Add more device info data

* Add attributes to device_info

* Refactor sensor

* Filter
devices

* Update following review

* Update following review

* Add device_Class
2019-10-06 19:24:56 +02:00
Robbert Müller
7a156059e9 Switch on/off all lights, and wait for the result (#27078)
* Switch on/off all lights, and wait for the result

Reuses the parallel_updates semaphore.
This is a small crutch which serializes platforms which already do tis
for updates. Platforms which can parallelize everything, this makes it
go faster

* Fix broken unittest

With manual validation, with help from @frenck, we found out that the
assertions are wrong and the test should be failing.

The sequence requested is
OFF
ON

without cancelation, this code should result in:
off,off,off,on,on,on

testable, by adding a `await hass.async_block_till_done()` between the
off and on call.

with cancelation. there should be less off call's so
off,on,on,on

* Adding tests for async_request_call

* Process review feedback

* Switch gather with wait

* 👕 running black
2019-10-06 08:23:12 -07:00
Robert Svensson
c7c88b2b68 UniFi - Bandwidth sensors (#27229)
* First draft of UniFi bandwidth sensors

* Clean up

* Add tests for sensors
2019-10-06 08:17:40 -07:00
Sergio Conde Gómez
6cc71db385 Fix onvif PTZ service freeze (#27250) 2019-10-06 17:00:44 +02:00
ktnrg45
1ecc883ef4 PS4 bump to renamed dependency (#27144)
* Change to renamed dependency pyps4-2ndscreen 0.9.0

* Rename / bump to ps4 dependency to 1.0.0

* update requirements

* Rename test req

* Fix import

* Bump 1.0.1

* Fix flaky test leaving files behind
2019-10-06 14:43:34 +02:00
Santobert
bd6bbcd5af Neato config flow (#26579)
* initial commit

* Minor changes

* add async setup entry

* Add translations and some other stuff

* add and remove entry

* use async_setup_entry

* Update config_flows.py

* dshokouhi's changes

* Improve workflow

* Add valid_vendors

* Add entity registry

* Add device registry

* Update entry from configuration.yaml

* Revert unneccesary changes

* Update .coveragerc

* Prepared tests

* Add dshokouhi and Santobert as codeowners

* Fix unload entry and abort when already_configured

* First tests

* Add test for abort cases

* Add test for invalid credentials on import

* Add one last test

* Add test_init.py with some tests

* Address reviews, part 1

* Update outdated entry

* await instead of add_job

* run IO inside an executor

* remove faulty test

* Fix pylint issues

* Move IO out of constructur

* Edit error translations

* Edit imports

* Minor changes

* Remove test for invalid vendor

* Async setup platform

* Edit login function

* Moved IO out if init

* Update switches after added to hass

* Revert update outdated entry

* try and update new entrys from config.yaml

* Add test invalid vendor

* Default to neato
2019-10-06 13:05:51 +02:00
SukramJ
476f24e451 Add basic test support to Homematic IP Cloud (#27228)
* Add basic test support to Homematic IP Cloud

* move test data address comments
2019-10-06 11:54:26 +02:00
HomeAssistant Azure
2c6a869bc6 [ci skip] Translation update 2019-10-06 00:32:15 +00:00
Jens
bd92532ebb Add io:SomfyBasicContactIOSystemSensor to TaHoma component (#27234) 2019-10-06 01:12:50 +02:00
Sebastian Muszynski
5c01dd483f Add Xiaomi Air Humidifier CB1 (zhimi.humidifier.cb1) support (#27232) 2019-10-05 13:31:10 -07:00
Sebastian Muszynski
be60b065a3 Bump python-miio version to 0.4.6 (#27231) 2019-10-05 13:31:01 -07:00
Matthew Donoughe
d16edb3ef0 add script shortcut for activating scenes (#27223)
* add script shortcut for activating scenes

use `- scene: scene.<scene name>` in a script to activate a scene

* Update validation
2019-10-05 13:30:43 -07:00
Pierre Sicot
43d1413050 Fix closed status for non horizontal awnings. (#26840) 2019-10-05 13:28:19 -07:00
scheric
99859485e2 Repair SolarEdge_local inverter fahrenheit temperature (#27096)
* Add Fahrenheit check

* Rounding values

* add missing bracket

* Fix spelling

* round fahrenheit to 1 decimal

* Change unit on the fly

* Use new sensor names

* Use TEMP_FAHRENHEIT constant

* Pass new sensors fully to SolarEdgeSensor

* applying snake_case

* applying snake_case lower case

* Update sensor.py

* applying feedback
2019-10-05 13:07:01 -07:00
Santobert
601d15701b Add initial state to Flux Switch (#27089)
* flux restore state

* Add config options

* Add tests

* Add more tests

* just restores state
2019-10-05 12:57:12 -07:00
Patrik
5ae497bfdc Refactor Tradfri switch device (#26864)
* Refactor Tradfri switch device

* Lint

* Lint

* Removed unused constant

* Add base_class

* Lint

* Improvements after review

* Typo
2019-10-05 12:46:16 -07:00
Jeff Irion
0b838f88c1 Bump adb-shell to 0.0.4; bump androidtv to 0.0.30 (#27224) 2019-10-05 12:44:51 -07:00
definitio
9c08c35881 Improve influxdb error handling (#27225) 2019-10-05 12:43:57 -07:00
Santobert
46ac98379e Add improved scene support to the light integration (#27182)
* light reproduce state

* Add types

* Fix linting error

* Add tests

* Improve test

* Fix failing tests

* Another try

* avoid repetition

* simplified if

* Remove attributes that are no attributes
2019-10-05 12:43:12 -07:00
Santobert
e088119d6d fan_reproduce_state (#27227) 2019-10-05 12:42:37 -07:00
Oncleben31
3d1e743b0c Add set_location service doc (#27216) 2019-10-05 12:34:18 -07:00
Santobert
cc1cca0a14 automation_reproduce_state (#27222) 2019-10-05 12:31:51 -07:00
Ville Skyttä
25bfdbc8df Require Python >= 3.6.1 (#27226)
https://github.com/home-assistant/architecture/issues/278
2019-10-05 12:20:11 -07:00
Robert Svensson
a8567a746b UniFi - Improve switch tests (#27200)
* Continue rewriting tests for UniFi
2019-10-05 16:16:08 +02:00
MagicalTrev89
a9073451f8 Add hive trv support (#27033)
* TRV-Support

* pyhive import update

* Moved HVAC to new line

* updated pyhiveapi version

* Update for pylint errors

* Fix Pylint Errors

* Fixed Pylint 2

* removed whitespace

* Black

* Updates following review

* updated phyhive to 0.2.19.3

* Corrected logic on TRV name

* updated requirements as requested

* Black run
2019-10-05 15:52:42 +02:00
Franck Nijhof
2e17ad86af Adds guards for missing information in call stack frames (#27217) 2019-10-05 11:59:33 +02:00
Josh
71a3516053 Guard against network errors for Dark Sky (#27141)
* Guard against network errors for Dark Sky

- Prevents network errors from throwing an exception during
  state updates for the Dark Sky weather component.

* Implement `available` for Dark Sky component

* unknown -> unavailable
2019-10-04 19:28:55 -07:00
Zach
bbd2078986 Add doods contains flags on areas to allow specifying overlap (#27035)
* Add support for the contains flags on areas to allow specifying overlap vs contains

* Remove draw_box

* Add timeout option

* Fix import for CONF_TIMEOUT

* Change contains to covers
2019-10-04 17:48:45 -07:00
mvn23
6ae908b883 Add opentherm_gw config flow (#27148)
* Add config flow support to opentherm_gw.
Bump pyotgw to 0.5b0 (required for connection testing)
Existing entries in configuration.yaml will be converted to config entries and ignored in future runs.

* Fix not connecting to Gateway on startup.
Pylint fixes.

* Add tests for config flow.
Remove non-essential options from config flow.
Restructure config entry data.

* Make sure gw_id is slugified
2019-10-04 17:38:26 -07:00
Mark Coombes
2e49303401 Add turn_on method to ecobee climate platform (#27103)
* Add turn on method to ecobee climate

* Update climate.py

* Update value in async_update

* Fix update in async_update

* Simplify async_update

* Fix lint complaining about log string

* Cleanup inline if statement
2019-10-04 17:35:31 -07:00
HomeAssistant Azure
7e7868f0a6 [ci skip] Translation update 2019-10-05 00:32:19 +00:00
Santobert
9c96ec858a switch reproduce state (#27202) 2019-10-04 14:32:10 -07:00
Santobert
cc4926afb1 lock_reproduce_state (#27203) 2019-10-04 14:29:53 -07:00
SukramJ
0be1269b20 Add acceleration sensor to Homematic IP Cloud (#27199) 2019-10-04 14:21:19 -07:00
Mark Coombes
c62d1a77ec Fix ecobee binary sensor and sensor unique ids (#27208)
* Fix sensor unique id

* Fix binary sensor unique id
2019-10-04 14:15:43 -07:00
Santobert
de246fa7d8 lock open service data (#27204) 2019-10-04 14:14:47 -07:00
Paulus Schoutsen
23686710b1 Fix tests running in hass.io image (#27169)
* Fix tests running in hass.io image

* Real fix now

* Only remove wheel links
2019-10-04 22:49:51 +02:00
Sergio Mayoral Martínez
e5a2e18881 Fix template fan turn_on action (#27181)
* Fix template fan turn_on action

The turn_on action of a template fan should
receive the 'speed' attribute in order to give
the user the possibility of define the behaviour
of this action as he desires

Fixes #27176

* Format

* Update fan.py
2019-10-04 12:07:19 -07:00
Erik Montnemery
e27051aa61 Fix validation when automation is saved from frontend (#27195) 2019-10-04 10:17:57 -07:00
Erik Montnemery
b8f41dbb75 Add device condition support to sensor entities (#27163)
* Add device condition support to sensor entities

* Fix typing
2019-10-04 10:11:14 -07:00
David Bonnes
45d4586bc2 Improve evohome debug logging (#27178)
* add debug logging for schedule updates

* add debug logging for schedules

* change back to debug from warn
2019-10-04 08:54:15 -07:00
Santobert
3547b8691e Add examples to lights service (#27192) 2019-10-04 08:46:23 -07:00
ochlocracy
9a5c1fbaed Add SecurityPanelController for alarm_control_panel to alexa (#27081)
* Implemented Alexa.SecurityPanelController Interface for alarm_control_panel
https://developer.amazon.com/docs/device-apis/alexa-securitypanelcontroller.html

* Implemented Tests for Alexa.SecurityPanelController Interface for alarm_control_panel

* Added additional AuthorizationRequired error handling

* Removed optional exitDelayInSeconds

* Updating elif to if to please pylint

* Adding self to code owners.

* Adding self to code owners.

* Added AlexaEndpointHealth Interface to alarm_control_panel entities.

* Added additional entity tests.

* Code reformatted with Black.

* Updated alexa alarm_control_panel tests for more coverage.

* Updated alexa alarm_control_panel tests for more coverage. Fixed Test.

* Adding self to code owners.
2019-10-04 08:41:47 -07:00
Pascal Vizeli
f169e84d21 Update connect-box to fix issue with attrs (#27194) 2019-10-04 17:05:52 +02:00
Maciej Bieniek
8ba4ee1012 Add Airly integration (#26375)
* Add Airly integration

* Update .coveragerc file

* Remove AVAILABLE_CONDITIONS and fix device_class

* Don't create client on every update

* Rename client to session

* Rename state_attributes to device_state_attributes

* Remove log latitude and longitude

* Fix try...except

* Change latitude and longitude to HA defaults

* _show_config_form doesn't need coroutine

* Simplify config_flow errors handlig

* Preetier

* Remove unnecessary condition

* Change sensor platform to air_quality

* Remove PM1

* Make unique_id more unique

* Remove ,

* Add tests for config_flow

* Move conf to CONFIG

* Remove domain from unique_id

* Change the way update of attrs

* Language and attrs

* Fix attrs

* Add aiohttp error handling

* Throttle as decorator

* Suggested change

* Suggested change

* Invert condition

* Cleaning

* Add tests

* Polish no sesnor error handling

* Better strings

* Fix test_invalid_api_key

* Fix documentation url

* Remove unnecessary test

* Remove language option

* Fix test_invalid_api_key once again

* Sort imports

* Remove splits in strings
2019-10-04 13:58:29 +02:00
Daniel Shokouhi
4b4a290f71 WAQI add unique ID and availability (#27086)
* WAQI add unique ID and availability

* Review comments

* Fix unique ID

* Fix unique ID
2019-10-04 10:37:30 +02:00
Mark Coombes
98eaecf61d Add device registry support to ecobee integration (#27109)
* Add manufacturer const

* Add device_info to binary sensor

* Add device info to climate

* Add device info to sensor

* Add device info to weather

* Add constant for device info

* Fix log messages

* Use guard clauses
2019-10-04 08:31:45 +02:00
David Bonnes
f500367721 Handle all single zone thermostats (#27168) 2019-10-03 18:04:30 -07:00
Hugh Eaves
d36d123cf7 Support zone expanders in alarmdecoder (#27167) 2019-10-03 18:01:06 -07:00
Javier González Calleja
c6b08b28b2 Fix homekit temperaturesensor round (#27047)
* Fix homekit temperature sensor for round with one decimal

* Removing unnecesary operations

* Adapting tests for new temperature_to_homekit() result precision
2019-10-03 17:44:07 -07:00
HomeAssistant Azure
85947591c5 [ci skip] Translation update 2019-10-04 00:32:16 +00:00
Dan Cinnamon
f2c5c249d2 Envisalink startup reconnect (#27063)
* Added retry capability to the component initialization.

* Removed extra chars

* Black formatting.

* Removed issue with block upon setup. Now setup will only fail if auth failed to the device.
2019-10-03 17:15:52 -07:00
jjlawren
adab228012 Unload cert_expiry config entries (#27150)
* Allow cert_expiry unloading

* Update codeowners
2019-10-03 16:50:15 -07:00
Erik Montnemery
89ebc17fb1 Only generate device trigger for sensor with unit (#27152) 2019-10-03 13:30:59 -07:00
Erik Montnemery
cda7692f24 Add support for for to binary_sensor, light and switch device conditions (#27153)
* Add support for `for` to binary_sensor, light and switch device conditions

* Fix typing

* Fixup

* Fixup
2019-10-03 13:29:57 -07:00
Franck Nijhof
4733fea416 Adds fields to light.toggle service description (#27155) 2019-10-03 13:28:53 -07:00
Daniel Høyer Iversen
2f251104e3 update broadlink library (#27157) 2019-10-03 13:28:12 -07:00
ochlocracy
af81878d08 Add PowerLevelController for fan to alexa (#27158)
* Implement AlexaPowerLevelController

* Implement AlexaPowerLevelController Tests
2019-10-03 13:28:02 -07:00
Robert Svensson
565302ed34 Improve device tracker tests (#27159) 2019-10-03 13:23:25 -07:00
Erik Montnemery
9902209ad2 Add above and below to sensor trigger extra_fields (#27160) 2019-10-03 22:17:58 +02:00
jjlawren
bb45bdd8dd Fix update on cert_expiry startup (#27137)
* Don't force extra update on startup

* Skip on entity add instead

* Conditional update based on HA state

* Only force entity state update when postponed

* Clean up state updating

* Delay YAML import
2019-10-03 17:39:14 +02:00
jjlawren
2307cac942 Add unique_id to cert_expiry (#27140)
* Add unique_id to cert_expiry

* Simplify ID
2019-10-03 14:26:19 +02:00
Pascal Vizeli
69bdce768c Bump version 0.101.0dev0 2019-10-03 11:19:02 +00:00
1445 changed files with 38573 additions and 12422 deletions

View File

@@ -10,7 +10,15 @@ omit =
homeassistant/util/async.py
# omit pieces of code that rely on external devices being present
homeassistant/components/abode/*
homeassistant/components/abode/__init__.py
homeassistant/components/abode/alarm_control_panel.py
homeassistant/components/abode/binary_sensor.py
homeassistant/components/abode/camera.py
homeassistant/components/abode/cover.py
homeassistant/components/abode/light.py
homeassistant/components/abode/lock.py
homeassistant/components/abode/sensor.py
homeassistant/components/abode/switch.py
homeassistant/components/acer_projector/switch.py
homeassistant/components/actiontec/device_tracker.py
homeassistant/components/adguard/__init__.py
@@ -19,6 +27,10 @@ omit =
homeassistant/components/adguard/switch.py
homeassistant/components/ads/*
homeassistant/components/aftership/sensor.py
homeassistant/components/airly/__init__.py
homeassistant/components/airly/air_quality.py
homeassistant/components/airly/sensor.py
homeassistant/components/airly/const.py
homeassistant/components/airvisual/sensor.py
homeassistant/components/aladdin_connect/cover.py
homeassistant/components/alarm_control_panel/manual_mqtt.py
@@ -88,6 +100,7 @@ omit =
homeassistant/components/bt_home_hub_5/device_tracker.py
homeassistant/components/bt_smarthub/device_tracker.py
homeassistant/components/buienradar/sensor.py
homeassistant/components/buienradar/util.py
homeassistant/components/buienradar/weather.py
homeassistant/components/caldav/calendar.py
homeassistant/components/canary/alarm_control_panel.py
@@ -113,7 +126,9 @@ omit =
homeassistant/components/comfoconnect/*
homeassistant/components/concord232/alarm_control_panel.py
homeassistant/components/concord232/binary_sensor.py
homeassistant/components/coolmaster/__init__.py
homeassistant/components/coolmaster/climate.py
homeassistant/components/coolmaster/const.py
homeassistant/components/cppm_tracker/device_tracker.py
homeassistant/components/cpuspeed/sensor.py
homeassistant/components/crimereports/sensor.py
@@ -221,6 +236,7 @@ omit =
homeassistant/components/fortios/device_tracker.py
homeassistant/components/fortigate/*
homeassistant/components/foscam/camera.py
homeassistant/components/foscam/const.py
homeassistant/components/foursquare/*
homeassistant/components/free_mobile/notify.py
homeassistant/components/freebox/*
@@ -240,6 +256,7 @@ omit =
homeassistant/components/github/sensor.py
homeassistant/components/gitlab_ci/sensor.py
homeassistant/components/gitter/sensor.py
homeassistant/components/glances/__init__.py
homeassistant/components/glances/sensor.py
homeassistant/components/gntp/notify.py
homeassistant/components/goalfeed/*
@@ -271,7 +288,6 @@ omit =
homeassistant/components/heatmiser/climate.py
homeassistant/components/hikvision/binary_sensor.py
homeassistant/components/hikvisioncam/switch.py
homeassistant/components/hipchat/notify.py
homeassistant/components/hitron_coda/device_tracker.py
homeassistant/components/hive/*
homeassistant/components/hlk_sw16/*
@@ -279,7 +295,6 @@ omit =
homeassistant/components/homematic/climate.py
homeassistant/components/homematic/cover.py
homeassistant/components/homematic/notify.py
homeassistant/components/homematicip_cloud/*
homeassistant/components/homeworks/*
homeassistant/components/honeywell/climate.py
homeassistant/components/hook/switch.py
@@ -405,6 +420,7 @@ omit =
homeassistant/components/mpchc/media_player.py
homeassistant/components/mpd/media_player.py
homeassistant/components/mqtt_room/sensor.py
homeassistant/components/msteams/notify.py
homeassistant/components/mvglive/sensor.py
homeassistant/components/mychevy/*
homeassistant/components/mycroft/*
@@ -417,7 +433,10 @@ omit =
homeassistant/components/n26/*
homeassistant/components/nad/media_player.py
homeassistant/components/nanoleaf/light.py
homeassistant/components/neato/*
homeassistant/components/neato/camera.py
homeassistant/components/neato/sensor.py
homeassistant/components/neato/switch.py
homeassistant/components/neato/vacuum.py
homeassistant/components/nederlandse_spoorwegen/sensor.py
homeassistant/components/nello/lock.py
homeassistant/components/nest/*
@@ -461,7 +480,10 @@ omit =
homeassistant/components/openhome/media_player.py
homeassistant/components/opensensemap/air_quality.py
homeassistant/components/opensky/sensor.py
homeassistant/components/opentherm_gw/*
homeassistant/components/opentherm_gw/__init__.py
homeassistant/components/opentherm_gw/binary_sensor.py
homeassistant/components/opentherm_gw/climate.py
homeassistant/components/opentherm_gw/sensor.py
homeassistant/components/openuv/__init__.py
homeassistant/components/openuv/binary_sensor.py
homeassistant/components/openuv/sensor.py
@@ -469,6 +491,7 @@ omit =
homeassistant/components/openweathermap/weather.py
homeassistant/components/opple/light.py
homeassistant/components/orangepi_gpio/*
homeassistant/components/oru/*
homeassistant/components/orvibo/switch.py
homeassistant/components/osramlightify/light.py
homeassistant/components/otp/sensor.py
@@ -491,6 +514,7 @@ omit =
homeassistant/components/plex/media_player.py
homeassistant/components/plex/sensor.py
homeassistant/components/plex/server.py
homeassistant/components/plex/websockets.py
homeassistant/components/plugwise/*
homeassistant/components/plum_lightpad/*
homeassistant/components/pocketcasts/sensor.py
@@ -586,6 +610,7 @@ omit =
homeassistant/components/skybeacon/sensor.py
homeassistant/components/skybell/*
homeassistant/components/slack/notify.py
homeassistant/components/sinch/*
homeassistant/components/slide/*
homeassistant/components/sma/sensor.py
homeassistant/components/smappee/*
@@ -599,6 +624,7 @@ omit =
homeassistant/components/solaredge/__init__.py
homeassistant/components/solaredge/sensor.py
homeassistant/components/solaredge_local/sensor.py
homeassistant/components/solarlog/*
homeassistant/components/solax/sensor.py
homeassistant/components/soma/cover.py
homeassistant/components/soma/__init__.py
@@ -618,7 +644,6 @@ omit =
homeassistant/components/steam_online/sensor.py
homeassistant/components/stiebel_eltron/*
homeassistant/components/streamlabswater/*
homeassistant/components/stride/notify.py
homeassistant/components/suez_water/*
homeassistant/components/supervisord/sensor.py
homeassistant/components/swiss_hydrological_data/sensor.py
@@ -676,9 +701,9 @@ omit =
homeassistant/components/tradfri/*
homeassistant/components/tradfri/light.py
homeassistant/components/tradfri/cover.py
homeassistant/components/tradfri/base_class.py
homeassistant/components/trafikverket_train/sensor.py
homeassistant/components/trafikverket_weatherstation/sensor.py
homeassistant/components/transmission/__init__.py
homeassistant/components/transmission/sensor.py
homeassistant/components/transmission/switch.py
homeassistant/components/transmission/const.py

View File

@@ -5,7 +5,7 @@
"dockerFile": "../Dockerfile.dev",
"postCreateCommand": "mkdir -p config && pip3 install -e .",
"appPort": 8123,
"runArgs": ["-e", "GIT_EDITOR=\"code --wait\""],
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
"extensions": [
"ms-python.python",
"visualstudioexptteam.vscodeintellicode",

3
.gitignore vendored
View File

@@ -128,3 +128,6 @@ monkeytype.sqlite3
# This is left behind by Azure Restore Cache
tmp_cache
# python-language-server / Rope
.ropeproject

View File

@@ -6,6 +6,7 @@ repos:
args:
- --safe
- --quiet
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
@@ -13,3 +14,18 @@ repos:
additional_dependencies:
- flake8-docstrings==1.3.1
- pydocstyle==4.0.0
files: ^(homeassistant|script|tests)/.+\.py$
# 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
# another set of our dependencies there... no. Use the "system" one
# and reuse the environment that is set up anyway already instead.
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
require_serial: true
files: ^homeassistant/.+\.py$

View File

@@ -19,7 +19,7 @@ matrix:
- python: "3.6.1"
env: TOXENV=lint
- python: "3.6.1"
env: TOXENV=pylint
env: TOXENV=pylint PYLINT_ARGS=--jobs=0
- python: "3.6.1"
env: TOXENV=typing
- python: "3.6.1"
@@ -27,7 +27,10 @@ matrix:
- python: "3.7"
env: TOXENV=py37
cache: pip
cache:
pip: true
directories:
- $HOME/.cache/pre-commit
install: pip install -U tox
language: python
script: travis_wait 50 tox --develop

View File

@@ -13,10 +13,12 @@ homeassistant/util/* @home-assistant/core
homeassistant/scripts/check_config.py @kellerza
# Integrations
homeassistant/components/abode/* @shred86
homeassistant/components/adguard/* @frenck
homeassistant/components/airly/* @bieniu
homeassistant/components/airvisual/* @bachya
homeassistant/components/alarm_control_panel/* @colinodell
homeassistant/components/alexa/* @home-assistant/cloud
homeassistant/components/alexa/* @home-assistant/cloud @ochlocracy
homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/ambiclimate/* @danielhiversen
@@ -24,6 +26,7 @@ homeassistant/components/ambient_station/* @bachya
homeassistant/components/androidtv/* @JeffLIrion
homeassistant/components/apache_kafka/* @bachya
homeassistant/components/api/* @home-assistant/core
homeassistant/components/apprise/* @caronc
homeassistant/components/aprs/* @PhilRW
homeassistant/components/arcam_fmj/* @elupus
homeassistant/components/arduino/* @fabaff
@@ -49,7 +52,7 @@ homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/brunt/* @eavanvalkenburg
homeassistant/components/bt_smarthub/* @jxwolstenholme
homeassistant/components/buienradar/* @mjj4791 @ties
homeassistant/components/cert_expiry/* @cereal2nd
homeassistant/components/cert_expiry/* @Cereal2nd @jjlawren
homeassistant/components/cisco_ios/* @fbradyirl
homeassistant/components/cisco_mobility_express/* @fbradyirl
homeassistant/components/cisco_webex_teams/* @fbradyirl
@@ -97,15 +100,17 @@ homeassistant/components/flock/* @fabaff
homeassistant/components/flunearyou/* @bachya
homeassistant/components/fortigate/* @kifeo
homeassistant/components/fortios/* @kimfrellsen
homeassistant/components/foscam/* @skgsergio
homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85
homeassistant/components/fronius/* @nielstron
homeassistant/components/frontend/* @home-assistant/frontend
homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/geniushub/* @zxdavb
homeassistant/components/geo_rss_events/* @exxamalte
homeassistant/components/geonetnz_quakes/* @exxamalte
homeassistant/components/gitter/* @fabaff
homeassistant/components/glances/* @fabaff
homeassistant/components/glances/* @fabaff @engrbm87
homeassistant/components/gntp/* @robbiet480
homeassistant/components/google_assistant/* @home-assistant/cloud
homeassistant/components/google_cloud/* @lufton
@@ -152,6 +157,7 @@ homeassistant/components/izone/* @Swamp-Ig
homeassistant/components/jewish_calendar/* @tsvi
homeassistant/components/kaiterra/* @Michsior14
homeassistant/components/keba/* @dannerph
homeassistant/components/keenetic_ndms2/* @foxel
homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/* @armills
homeassistant/components/konnected/* @heythisisnate
@@ -165,7 +171,7 @@ homeassistant/components/liveboxplaytv/* @pschmitt
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/logi_circle/* @evanjd
homeassistant/components/lovelace/* @home-assistant/frontend
homeassistant/components/luci/* @fbradyirl
homeassistant/components/luci/* @fbradyirl @mzdrale
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/mastodon/* @fabaff
homeassistant/components/matrix/* @tinloaf
@@ -184,8 +190,10 @@ homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/* @fabaff
homeassistant/components/mpd/* @fabaff
homeassistant/components/mqtt/* @home-assistant/core
homeassistant/components/msteams/* @peroyvind
homeassistant/components/mysensors/* @MartinHjelmare
homeassistant/components/mystrom/* @fabaff
homeassistant/components/neato/* @dshokouhi @Santobert
homeassistant/components/nello/* @pschmitt
homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
@@ -209,6 +217,7 @@ homeassistant/components/opentherm_gw/* @mvn23
homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/* @fabaff
homeassistant/components/orangepi_gpio/* @pascallj
homeassistant/components/oru/* @bvlaicu
homeassistant/components/owlet/* @oblogic7
homeassistant/components/panel_custom/* @home-assistant/frontend
homeassistant/components/panel_iframe/* @home-assistant/frontend
@@ -249,6 +258,7 @@ homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/* @fabaff
homeassistant/components/simplisafe/* @bachya
homeassistant/components/sinch/* @bendikrb
homeassistant/components/slide/* @ualex73
homeassistant/components/sma/* @kellerza
homeassistant/components/smarthab/* @outadoc
@@ -256,6 +266,7 @@ homeassistant/components/smartthings/* @andrewsayre
homeassistant/components/smarty/* @z0mbieprocess
homeassistant/components/smtp/* @fabaff
homeassistant/components/solaredge_local/* @drobtravels @scheric
homeassistant/components/solarlog/* @Ernst79
homeassistant/components/solax/* @squishykid
homeassistant/components/soma/* @ratsept
homeassistant/components/somfy/* @tetienne
@@ -312,6 +323,7 @@ homeassistant/components/velux/* @Julius2342
homeassistant/components/version/* @fabaff
homeassistant/components/vesync/* @markperdue @webdjoe
homeassistant/components/vicare/* @oischinger
homeassistant/components/vivotek/* @HarlemSquirrel
homeassistant/components/vizio/* @raman325
homeassistant/components/vlc_telnet/* @rodripf
homeassistant/components/waqi/* @andrey-git

View File

@@ -37,27 +37,32 @@ stages:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python -m venv venv
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
build: |
python -m venv venv
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
displayName: 'Setup Env'
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
- script: |
. venv/bin/activate
flake8 homeassistant tests script
pre-commit run flake8 --all-files
displayName: 'Run flake8'
- job: 'Validate'
pool:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python -m venv venv
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'homeassistant/package_constraints.txt'
build: |
python -m venv venv
. venv/bin/activate
pip install -e .
displayName: 'Setup Env'
. venv/bin/activate
pip install -e .
- script: |
. venv/bin/activate
python -m script.hassfest validate
@@ -71,15 +76,18 @@ stages:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python -m venv venv
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test.txt | homeassistant/package_constraints.txt'
build: |
python -m venv venv
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
displayName: 'Setup Env'
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
- script: |
. venv/bin/activate
./script/check_format
pre-commit run black --all-files
displayName: 'Check Black formatting'
- stage: 'Tests'
@@ -100,22 +108,26 @@ stages:
steps:
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test_all.txt, .cache, homeassistant/package_constraints.txt'
keyfile: 'requirements_test_all.txt | homeassistant/package_constraints.txt'
build: |
set -e
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools pytest-azurepipelines -c homeassistant/package_constraints.txt
pip install -U pip setuptools pytest-azurepipelines pytest-xdist -c homeassistant/package_constraints.txt
pip install -r requirements_test_all.txt -c homeassistant/package_constraints.txt
# This is a TEMP. Eventually we should make sure our 4 dependencies drop typing.
# Find offending deps with `pipdeptree -r -p typing`
pip uninstall -y typing
- script: |
. venv/bin/activate
pip install -e .
displayName: 'Install Home Assistant'
- script: |
set -e
. venv/bin/activate
pytest --timeout=9 --durations=10 -qq -o console_output_style=count -p no:sugar tests
pytest --timeout=9 --durations=10 -n 2 --dist loadfile -qq -o console_output_style=count -p no:sugar tests
script/check_dirty
displayName: 'Run pytest for python $(python.container)'
condition: and(succeeded(), ne(variables['python.container'], variables['PythonMain']))
@@ -123,7 +135,7 @@ stages:
set -e
. venv/bin/activate
pytest --timeout=9 --durations=10 --cov homeassistant --cov-report html -qq -o console_output_style=count -p no:sugar tests
pytest --timeout=9 --durations=10 -n 2 --dist loadfile --cov homeassistant --cov-report html -qq -o console_output_style=count -p no:sugar tests
codecov --token $(codecovToken)
script/check_dirty
displayName: 'Run pytest for python $(python.container) / coverage'
@@ -140,7 +152,7 @@ stages:
steps:
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_all.txt, requirements_test.txt, .cache, homeassistant/package_constraints.txt'
keyfile: 'requirements_all.txt | requirements_test.txt | homeassistant/package_constraints.txt'
build: |
set -e
python -m venv venv
@@ -149,6 +161,10 @@ stages:
pip install -U pip setuptools
pip install -r requirements_all.txt -c homeassistant/package_constraints.txt
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
- script: |
. venv/bin/activate
pip install -e .
displayName: 'Install Home Assistant'
- script: |
. venv/bin/activate
pylint homeassistant
@@ -158,17 +174,16 @@ stages:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python -m venv venv
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test.txt | setup.py | homeassistant/package_constraints.txt'
build: |
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
displayName: 'Setup Env'
. venv/bin/activate
pip install -e . -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
- script: |
TYPING_FILES=$(cat mypyrc)
echo -e "Run mypy on: \n$TYPING_FILES"
. venv/bin/activate
mypy $TYPING_FILES
pre-commit run mypy --all-files
displayName: 'Run mypy'

View File

@@ -18,7 +18,7 @@ schedules:
always: true
variables:
- name: versionWheels
value: '1.3-3.7-alpine3.10'
value: '1.4-3.7-alpine3.10'
resources:
repositories:
- repository: azure

View File

@@ -56,7 +56,7 @@ homeassistant.helpers.data_entry_flow module
homeassistant.helpers.deprecation module
----------------------------------------
.. automodule:: homeassistant.helpers.depracation
.. automodule:: homeassistant.helpers.deprecation
:members:
:undoc-members:
:show-inheritance:

View File

@@ -45,7 +45,7 @@ async def auth_manager_from_config(
)
)
else:
providers = ()
providers = []
# So returned auth providers are in same order as config
provider_hash: _ProviderDict = OrderedDict()
for provider in providers:
@@ -57,7 +57,7 @@ async def auth_manager_from_config(
*(auth_mfa_module_from_config(hass, config) for config in module_configs)
)
else:
modules = ()
modules = []
# So returned auth modules are in same order as config
module_hash: _MfaModuleDict = OrderedDict()
for module in modules:
@@ -86,18 +86,6 @@ class AuthManager:
hass, self._async_create_login_flow, self._async_finish_login_flow
)
@property
def support_legacy(self) -> bool:
"""
Return if legacy_api_password auth providers are registered.
Should be removed when we removed legacy_api_password auth providers.
"""
for provider_type, _ in self._providers:
if provider_type == "legacy_api_password":
return True
return False
@property
def auth_providers(self) -> List[AuthProvider]:
"""Return a list of available auth providers."""

View File

@@ -64,13 +64,9 @@ async def async_from_config_dict(
)
core_config = config.get(core.DOMAIN, {})
api_password = config.get("http", {}).get("api_password")
trusted_networks = config.get("http", {}).get("trusted_networks")
try:
await conf_util.async_process_ha_core_config(
hass, core_config, api_password, trusted_networks
)
await conf_util.async_process_ha_core_config(hass, core_config)
except vol.Invalid as config_err:
conf_util.async_log_exception(config_err, "homeassistant", core_config, hass)
return None
@@ -97,11 +93,11 @@ async def async_from_config_dict(
stop = time()
_LOGGER.info("Home Assistant initialized in %.2fs", stop - start)
if sys.version_info[:3] < (3, 6, 1):
if sys.version_info[:3] < (3, 7, 0):
msg = (
"Python 3.6.0 support is deprecated and will "
"be removed in the first release after October 2. Please "
"upgrade Python to 3.6.1 or higher."
"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."
)
_LOGGER.warning(msg)
hass.components.persistent_notification.async_create(
@@ -264,7 +260,7 @@ def _get_domains(hass: core.HomeAssistant, config: Dict[str, Any]) -> Set[str]:
domains = set(key.split(" ")[0] for key in config.keys() if key != core.DOMAIN)
# Add config entry domains
domains.update(hass.config_entries.async_domains()) # type: ignore
domains.update(hass.config_entries.async_domains())
# Make sure the Hass.io component is loaded
if "HASSIO" in os.environ:

View File

@@ -1,18 +0,0 @@
{
"config": {
"error": {
"name_exists": "Name existiert bereits"
},
"step": {
"user": {
"data": {
"latitude": "Breitengrad",
"longitude": "L\u00e4ngengrad",
"name": "Name der Integration"
},
"title": "Airly"
}
},
"title": "Airly"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Nom\u00e9s es permet una \u00fanica configuraci\u00f3 d'Abode."
},
"error": {
"connection_error": "No es pot connectar amb Abode.",
"identifier_exists": "Compte ja registrat.",
"invalid_credentials": "Credencials inv\u00e0lides."
},
"step": {
"user": {
"data": {
"password": "Contrasenya",
"username": "Correu electr\u00f2nic"
},
"title": "Introdueix la teva informaci\u00f3 d'inici de sessi\u00f3 a Abode."
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Det er kun n\u00f8dvendigt med en ops\u00e6tning af Abode."
},
"error": {
"connection_error": "Kunne ikke oprette forbindelse til Abode.",
"identifier_exists": "Konto er allerede registreret.",
"invalid_credentials": "Ugyldige legitimationsoplysninger."
},
"step": {
"user": {
"data": {
"password": "Adgangskode",
"username": "Email adresse"
},
"title": "Udfyld dine Abode-loginoplysninger"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Es ist nur eine einzige Konfiguration von Abode erlaubt."
},
"error": {
"connection_error": "Es kann keine Verbindung zu Abode hergestellt werden.",
"identifier_exists": "Das Konto ist bereits registriert.",
"invalid_credentials": "Ung\u00fcltige Anmeldeinformationen"
},
"step": {
"user": {
"data": {
"password": "Passwort",
"username": "E-Mail-Adresse"
},
"title": "Gib deine Abode-Anmeldeinformationen ein"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Only a single configuration of Abode is allowed."
},
"error": {
"connection_error": "Unable to connect to Abode.",
"identifier_exists": "Account already registered.",
"invalid_credentials": "Invalid credentials."
},
"step": {
"user": {
"data": {
"password": "Password",
"username": "Email Address"
},
"title": "Fill in your Abode login information"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Solo se permite una \u00fanica configuraci\u00f3n de Abode."
},
"error": {
"connection_error": "No se puede conectar a Abode.",
"identifier_exists": "Cuenta ya registrada.",
"invalid_credentials": "Credenciales inv\u00e1lidas."
},
"step": {
"user": {
"data": {
"password": "Contrase\u00f1a",
"username": "Direcci\u00f3n de correo electr\u00f3nico"
},
"title": "Rellene la informaci\u00f3n de acceso Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Une seule configuration d'Abode est autoris\u00e9e."
},
"error": {
"connection_error": "Impossible de se connecter \u00e0 Abode.",
"identifier_exists": "Compte d\u00e9j\u00e0 enregistr\u00e9.",
"invalid_credentials": "Informations d'identification invalides."
},
"step": {
"user": {
"data": {
"password": "Mot de passe",
"username": "Adresse e-mail"
},
"title": "Remplissez vos informations de connexion Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "\u00c8 consentita una sola configurazione di Abode."
},
"error": {
"connection_error": "Impossibile connettersi ad Abode.",
"identifier_exists": "Account gi\u00e0 registrato",
"invalid_credentials": "Credenziali non valide"
},
"step": {
"user": {
"data": {
"password": "Password",
"username": "Indirizzo email"
},
"title": "Inserisci le tue informazioni di accesso Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "\ud558\ub098\uc758 Abode \ub9cc \uad6c\uc131 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."
},
"error": {
"connection_error": "Abode \uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",
"identifier_exists": "\uacc4\uc815\uc774 \uc774\ubbf8 \ub4f1\ub85d\ub418\uc5c8\uc2b5\ub2c8\ub2e4",
"invalid_credentials": "\uc0ac\uc6a9\uc790 \uc774\ub984 \ud639\uc740 \ube44\ubc00\ubc88\ud638\uac00 \uc798\ubabb\ub418\uc5c8\uc2b5\ub2c8\ub2e4"
},
"step": {
"user": {
"data": {
"password": "\ube44\ubc00\ubc88\ud638",
"username": "\uc774\uba54\uc77c \uc8fc\uc18c"
},
"title": "Abode \uc0ac\uc6a9\uc790 \uc815\ubcf4\ub97c \uc785\ub825\ud574\uc8fc\uc138\uc694"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "N\u00ebmmen eng eenzeg Konfiguratioun vun ZHA ass erlaabt."
},
"error": {
"connection_error": "Kann sech net mat Abode verbannen.",
"identifier_exists": "Konto ass scho registr\u00e9iert",
"invalid_credentials": "Ong\u00eblteg Login Informatioune"
},
"step": {
"user": {
"data": {
"password": "Passwuert",
"username": "E-Mail Adress"
},
"title": "F\u00ebllt \u00e4r Abode Login Informatiounen aus."
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Slechts een enkele configuratie van Abode is toegestaan."
},
"error": {
"connection_error": "Kan geen verbinding maken met Abode.",
"identifier_exists": "Account is al geregistreerd.",
"invalid_credentials": "Ongeldige inloggegevens."
},
"step": {
"user": {
"data": {
"password": "Wachtwoord",
"username": "E-mailadres"
},
"title": "Vul uw Abode-inloggegevens in"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,5 @@
{
"config": {
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Bare en enkelt konfigurasjon av Abode er tillatt."
},
"error": {
"connection_error": "Kan ikke koble til Abode.",
"identifier_exists": "Kontoen er allerede registrert.",
"invalid_credentials": "Ugyldig brukerinformasjon"
},
"step": {
"user": {
"data": {
"password": "Passord",
"username": "E-postadresse"
},
"title": "Fyll ut innloggingsinformasjonen for Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Dozwolona jest tylko jedna konfiguracja Abode."
},
"error": {
"connection_error": "Nie mo\u017cna po\u0142\u0105czy\u0107 si\u0119 z Abode.",
"identifier_exists": "Konto zosta\u0142o ju\u017c zarejestrowane",
"invalid_credentials": "Nieprawid\u0142owe dane uwierzytelniaj\u0105ce"
},
"step": {
"user": {
"data": {
"password": "Has\u0142o",
"username": "Adres e-mail"
},
"title": "Wprowad\u017a informacje logowania Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,12 @@
{
"config": {
"step": {
"user": {
"data": {
"username": "Endere\u00e7o de e-mail"
}
}
},
"title": ""
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"error": {
"identifier_exists": "Conta j\u00e1 registada"
},
"step": {
"user": {
"data": {
"username": "Endere\u00e7o de e-mail"
}
}
},
"title": ""
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430."
},
"error": {
"connection_error": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Abode.",
"identifier_exists": "\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430.",
"invalid_credentials": "\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435."
},
"step": {
"user": {
"data": {
"password": "\u041f\u0430\u0440\u043e\u043b\u044c",
"username": "\u0410\u0434\u0440\u0435\u0441 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b"
},
"title": "Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Dovoljena je samo ena konfiguracija Abode."
},
"error": {
"connection_error": "Ni mogo\u010de vzpostaviti povezave z Abode.",
"identifier_exists": "Ra\u010dun je \u017ee registriran.",
"invalid_credentials": "Neveljavne poverilnice."
},
"step": {
"user": {
"data": {
"password": "Geslo",
"username": "E-po\u0161tni naslov"
},
"title": "Izpolnite svoje podatke za prijavo v Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "\u50c5\u5141\u8a31\u8a2d\u5b9a\u4e00\u7d44 Abode\u3002"
},
"error": {
"connection_error": "\u7121\u6cd5\u9023\u7dda\u81f3 Abode\u3002",
"identifier_exists": "\u5e33\u865f\u5df2\u8a3b\u518a\u3002",
"invalid_credentials": "\u6191\u8b49\u7121\u6548\u3002"
},
"step": {
"user": {
"data": {
"password": "\u5bc6\u78bc",
"username": "\u96fb\u5b50\u90f5\u4ef6\u5730\u5740"
},
"title": "\u586b\u5beb Abode \u767b\u5165\u8cc7\u8a0a"
}
},
"title": "Abode"
}
}

View File

@@ -1,45 +1,36 @@
"""Support for Abode Home Security system."""
import logging
"""Support for the Abode Security System."""
from asyncio import gather
from copy import deepcopy
from functools import partial
from requests.exceptions import HTTPError, ConnectTimeout
import logging
from abodepy import Abode
from abodepy.exceptions import AbodeException
import abodepy.helpers.timeline as TIMELINE
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DATE,
ATTR_TIME,
ATTR_ENTITY_ID,
CONF_USERNAME,
ATTR_TIME,
CONF_PASSWORD,
CONF_EXCLUDE,
CONF_NAME,
CONF_LIGHTS,
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity
from .const import ATTRIBUTION, DOMAIN
_LOGGER = logging.getLogger(__name__)
ATTRIBUTION = "Data provided by goabode.com"
CONF_POLLING = "polling"
DOMAIN = "abode"
DEFAULT_CACHEDB = "./abodepy_cache.pickle"
NOTIFICATION_ID = "abode_notification"
NOTIFICATION_TITLE = "Abode Security Setup"
EVENT_ABODE_ALARM = "abode_alarm"
EVENT_ABODE_ALARM_END = "abode_alarm_end"
EVENT_ABODE_AUTOMATION = "abode_automation"
EVENT_ABODE_FAULT = "abode_panel_fault"
EVENT_ABODE_RESTORE = "abode_panel_restore"
SERVICE_SETTINGS = "change_setting"
SERVICE_CAPTURE_IMAGE = "capture_image"
SERVICE_TRIGGER = "trigger_quick_action"
@@ -53,6 +44,8 @@ ATTR_EVENT_TYPE = "event_type"
ATTR_EVENT_UTC = "event_utc"
ATTR_SETTING = "setting"
ATTR_USER_NAME = "user_name"
ATTR_APP_TYPE = "app_type"
ATTR_EVENT_BY = "event_by"
ATTR_VALUE = "value"
ABODE_DEVICE_ID_LIST_SCHEMA = vol.Schema([str])
@@ -63,10 +56,7 @@ CONFIG_SCHEMA = vol.Schema(
{
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
vol.Optional(CONF_NAME): cv.string,
vol.Optional(CONF_POLLING, default=False): cv.boolean,
vol.Optional(CONF_EXCLUDE, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA,
vol.Optional(CONF_LIGHTS, default=[]): ABODE_DEVICE_ID_LIST_SCHEMA,
}
)
},
@@ -96,83 +86,86 @@ ABODE_PLATFORMS = [
class AbodeSystem:
"""Abode System class."""
def __init__(self, username, password, cache, name, polling, exclude, lights):
def __init__(self, abode, polling):
"""Initialize the system."""
import abodepy
self.abode = abodepy.Abode(
username,
password,
auto_login=True,
get_devices=True,
get_automations=True,
cache_path=cache,
)
self.name = name
self.abode = abode
self.polling = polling
self.exclude = exclude
self.lights = lights
self.devices = []
def is_excluded(self, device):
"""Check if a device is configured to be excluded."""
return device.device_id in self.exclude
def is_automation_excluded(self, automation):
"""Check if an automation is configured to be excluded."""
return automation.automation_id in self.exclude
def is_light(self, device):
"""Check if a switch device is configured as a light."""
import abodepy.helpers.constants as CONST
return device.generic_type == CONST.TYPE_LIGHT or (
device.generic_type == CONST.TYPE_SWITCH and device.device_id in self.lights
)
self.logout_listener = None
def setup(hass, config):
"""Set up Abode component."""
from abodepy.exceptions import AbodeException
async def async_setup(hass, config):
"""Set up Abode integration."""
if DOMAIN not in config:
return True
conf = config[DOMAIN]
username = conf.get(CONF_USERNAME)
password = conf.get(CONF_PASSWORD)
name = conf.get(CONF_NAME)
polling = conf.get(CONF_POLLING)
exclude = conf.get(CONF_EXCLUDE)
lights = conf.get(CONF_LIGHTS)
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_IMPORT}, data=deepcopy(conf)
)
)
return True
async def async_setup_entry(hass, config_entry):
"""Set up Abode integration from a config entry."""
username = config_entry.data.get(CONF_USERNAME)
password = config_entry.data.get(CONF_PASSWORD)
polling = config_entry.data.get(CONF_POLLING)
try:
cache = hass.config.path(DEFAULT_CACHEDB)
hass.data[DOMAIN] = AbodeSystem(
username, password, cache, name, polling, exclude, lights
abode = await hass.async_add_executor_job(
Abode, username, password, True, True, True, cache
)
hass.data[DOMAIN] = AbodeSystem(abode, polling)
except (AbodeException, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))
hass.components.persistent_notification.create(
"Error: {}<br />"
"You will need to restart hass after fixing."
"".format(ex),
title=NOTIFICATION_TITLE,
notification_id=NOTIFICATION_ID,
)
return False
setup_hass_services(hass)
setup_hass_events(hass)
setup_abode_events(hass)
for platform in ABODE_PLATFORMS:
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, platform)
)
await setup_hass_events(hass)
await hass.async_add_executor_job(setup_hass_services, hass)
await hass.async_add_executor_job(setup_abode_events, hass)
return True
async def async_unload_entry(hass, config_entry):
"""Unload a config entry."""
hass.services.async_remove(DOMAIN, SERVICE_SETTINGS)
hass.services.async_remove(DOMAIN, SERVICE_CAPTURE_IMAGE)
hass.services.async_remove(DOMAIN, SERVICE_TRIGGER)
tasks = []
for platform in ABODE_PLATFORMS:
discovery.load_platform(hass, platform, DOMAIN, {}, config)
tasks.append(
hass.config_entries.async_forward_entry_unload(config_entry, platform)
)
await gather(*tasks)
await hass.async_add_executor_job(hass.data[DOMAIN].abode.events.stop)
await hass.async_add_executor_job(hass.data[DOMAIN].abode.logout)
hass.data[DOMAIN].logout_listener()
hass.data.pop(DOMAIN)
return True
def setup_hass_services(hass):
"""Home assistant services."""
from abodepy.exceptions import AbodeException
def change_setting(call):
"""Change an Abode system setting."""
@@ -223,13 +216,9 @@ def setup_hass_services(hass):
)
def setup_hass_events(hass):
async def setup_hass_events(hass):
"""Home Assistant start and stop callbacks."""
def startup(event):
"""Listen for push events."""
hass.data[DOMAIN].abode.events.start()
def logout(event):
"""Logout of Abode."""
if not hass.data[DOMAIN].polling:
@@ -239,14 +228,15 @@ def setup_hass_events(hass):
_LOGGER.info("Logged out of Abode")
if not hass.data[DOMAIN].polling:
hass.bus.listen_once(EVENT_HOMEASSISTANT_START, startup)
await hass.async_add_executor_job(hass.data[DOMAIN].abode.events.start)
hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, logout)
hass.data[DOMAIN].logout_listener = hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STOP, logout
)
def setup_abode_events(hass):
"""Event callbacks."""
import abodepy.helpers.timeline as TIMELINE
def event_callback(event, event_json):
"""Handle an event callback from Abode."""
@@ -259,6 +249,8 @@ def setup_abode_events(hass):
ATTR_EVENT_TYPE: event_json.get(ATTR_EVENT_TYPE, ""),
ATTR_EVENT_UTC: event_json.get(ATTR_EVENT_UTC, ""),
ATTR_USER_NAME: event_json.get(ATTR_USER_NAME, ""),
ATTR_APP_TYPE: event_json.get(ATTR_APP_TYPE, ""),
ATTR_EVENT_BY: event_json.get(ATTR_EVENT_BY, ""),
ATTR_DATE: event_json.get(ATTR_DATE, ""),
ATTR_TIME: event_json.get(ATTR_TIME, ""),
}
@@ -271,6 +263,12 @@ def setup_abode_events(hass):
TIMELINE.PANEL_FAULT_GROUP,
TIMELINE.PANEL_RESTORE_GROUP,
TIMELINE.AUTOMATION_GROUP,
TIMELINE.DISARM_GROUP,
TIMELINE.ARM_GROUP,
TIMELINE.TEST_GROUP,
TIMELINE.CAPTURE_GROUP,
TIMELINE.DEVICE_GROUP,
TIMELINE.AUTOMATION_EDIT_GROUP,
]
for event in events:
@@ -283,30 +281,36 @@ class AbodeDevice(Entity):
"""Representation of an Abode device."""
def __init__(self, data, device):
"""Initialize a sensor for Abode device."""
"""Initialize Abode device."""
self._data = data
self._device = device
async def async_added_to_hass(self):
"""Subscribe Abode events."""
"""Subscribe to device events."""
self.hass.async_add_job(
self._data.abode.events.add_device_callback,
self._device.device_id,
self._update_callback,
)
async def async_will_remove_from_hass(self):
"""Unsubscribe from device events."""
self.hass.async_add_job(
self._data.abode.events.remove_all_device_callbacks, self._device.device_id
)
@property
def should_poll(self):
"""Return the polling state."""
return self._data.polling
def update(self):
"""Update automation state."""
"""Update device and automation states."""
self._device.refresh()
@property
def name(self):
"""Return the name of the sensor."""
"""Return the name of the device."""
return self._device.name
@property
@@ -320,6 +324,21 @@ class AbodeDevice(Entity):
"device_type": self._device.type,
}
@property
def unique_id(self):
"""Return a unique ID to use for this device."""
return self._device.device_uuid
@property
def device_info(self):
"""Return device registry information for this entity."""
return {
"identifiers": {(DOMAIN, self._device.device_id)},
"manufacturer": "Abode",
"name": self._device.name,
"device_type": self._device.type,
}
def _update_callback(self, device):
"""Update the device state."""
self.schedule_update_ha_state()
@@ -354,7 +373,7 @@ class AbodeAutomation(Entity):
@property
def name(self):
"""Return the name of the sensor."""
"""Return the name of the automation."""
return self._automation.name
@property
@@ -368,6 +387,6 @@ class AbodeAutomation(Entity):
}
def _update_callback(self, device):
"""Update the device state."""
"""Update the automation state."""
self._automation.refresh()
self.schedule_update_ha_state()

View File

@@ -9,32 +9,31 @@ from homeassistant.const import (
STATE_ALARM_DISARMED,
)
from . import ATTRIBUTION, DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import ATTRIBUTION, DOMAIN
_LOGGER = logging.getLogger(__name__)
ICON = "mdi:security"
def setup_platform(hass, config, add_entities, discovery_info=None):
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up an alarm control panel for an Abode device."""
data = hass.data[ABODE_DOMAIN]
data = hass.data[DOMAIN]
alarm_devices = [AbodeAlarm(data, data.abode.get_alarm(), data.name)]
data.devices.extend(alarm_devices)
add_entities(alarm_devices)
async_add_entities(
[AbodeAlarm(data, await hass.async_add_executor_job(data.abode.get_alarm))]
)
class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanel):
"""An alarm_control_panel implementation for Abode."""
def __init__(self, data, device, name):
"""Initialize the alarm control panel."""
super().__init__(data, device)
self._name = name
@property
def icon(self):
"""Return the icon."""
@@ -65,11 +64,6 @@ class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanel):
"""Send arm away command."""
self._device.set_away()
@property
def name(self):
"""Return the name of the alarm."""
return self._name or super().name
@property
def device_state_attributes(self):
"""Return the state attributes."""

View File

@@ -1,19 +1,25 @@
"""Support for Abode Security System binary sensors."""
import logging
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
from . import AbodeAutomation, AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a sensor for an Abode device."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a sensor for an Abode device."""
data = hass.data[DOMAIN]
device_types = [
CONST.TYPE_CONNECTIVITY,
@@ -24,25 +30,18 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
]
devices = []
for device in data.abode.get_devices(generic_type=device_types):
if data.is_excluded(device):
continue
for device in data.abode.get_devices(generic_type=device_types):
devices.append(AbodeBinarySensor(data, device))
for automation in data.abode.get_automations(generic_type=CONST.TYPE_QUICK_ACTION):
if data.is_automation_excluded(automation):
continue
devices.append(
AbodeQuickActionBinarySensor(
data, automation, TIMELINE.AUTOMATION_EDIT_GROUP
)
)
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):

View File

@@ -2,35 +2,36 @@
from datetime import timedelta
import logging
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
import requests
from homeassistant.components.camera import Camera
from homeassistant.util import Throttle
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import DOMAIN
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode camera devices."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a camera for an Abode device."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_CAMERA):
if data.is_excluded(device):
continue
devices.append(AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE))
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeCamera(AbodeDevice, Camera):

View File

@@ -0,0 +1,79 @@
"""Config flow for the Abode Security System component."""
import logging
from abodepy import Abode
from abodepy.exceptions import AbodeException
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from .const import DOMAIN # pylint: disable=W0611
CONF_POLLING = "polling"
_LOGGER = logging.getLogger(__name__)
class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Config flow for Abode."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
def __init__(self):
"""Initialize."""
self.data_schema = {
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
}
async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
if not user_input:
return self._show_form()
username = user_input[CONF_USERNAME]
password = user_input[CONF_PASSWORD]
polling = user_input.get(CONF_POLLING, False)
try:
await self.hass.async_add_executor_job(Abode, username, password, True)
except (AbodeException, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))
if ex.errcode == 400:
return self._show_form({"base": "invalid_credentials"})
return self._show_form({"base": "connection_error"})
return self.async_create_entry(
title=user_input[CONF_USERNAME],
data={
CONF_USERNAME: username,
CONF_PASSWORD: password,
CONF_POLLING: polling,
},
)
@callback
def _show_form(self, errors=None):
"""Show the form to the user."""
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(self.data_schema),
errors=errors if errors else {},
)
async def async_step_import(self, import_config):
"""Import a config entry from configuration.yaml."""
if self._async_current_entries():
_LOGGER.warning("Only one configuration of abode is allowed.")
return self.async_abort(reason="single_instance_allowed")
return await self.async_step_user(import_config)

View File

@@ -0,0 +1,3 @@
"""Constants for the Abode Security System component."""
DOMAIN = "abode"
ATTRIBUTION = "Data provided by goabode.com"

View File

@@ -1,29 +1,31 @@
"""Support for Abode Security System covers."""
import logging
import abodepy.helpers.constants as CONST
from homeassistant.components.cover import CoverDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode cover devices."""
import abodepy.helpers.constants as CONST
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode cover devices."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_COVER):
if data.is_excluded(device):
continue
devices.append(AbodeCover(data, device))
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeCover(AbodeDevice, CoverDevice):

View File

@@ -2,6 +2,8 @@
import logging
from math import ceil
import abodepy.helpers.constants as CONST
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
@@ -16,31 +18,27 @@ from homeassistant.util.color import (
color_temperature_mired_to_kelvin,
)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode light devices."""
import abodepy.helpers.constants as CONST
data = hass.data[ABODE_DOMAIN]
device_types = [CONST.TYPE_LIGHT, CONST.TYPE_SWITCH]
data = hass.data[DOMAIN]
devices = []
# Get all regular lights that are not excluded or switches marked as lights
for device in data.abode.get_devices(generic_type=device_types):
if data.is_excluded(device) or not data.is_light(device):
continue
for device in data.abode.get_devices(generic_type=CONST.TYPE_LIGHT):
devices.append(AbodeLight(data, device))
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeLight(AbodeDevice, Light):

View File

@@ -1,29 +1,31 @@
"""Support for Abode Security System locks."""
"""Support for the Abode Security System locks."""
import logging
import abodepy.helpers.constants as CONST
from homeassistant.components.lock import LockDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode lock devices."""
import abodepy.helpers.constants as CONST
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode lock devices."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_LOCK):
if data.is_excluded(device):
continue
devices.append(AbodeLock(data, device))
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeLock(AbodeDevice, LockDevice):

View File

@@ -1,10 +1,13 @@
{
"domain": "abode",
"name": "Abode",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/abode",
"requirements": [
"abodepy==0.15.0"
"abodepy==0.16.6"
],
"dependencies": [],
"codeowners": []
}
"codeowners": [
"@shred86"
]
}

View File

@@ -1,13 +1,16 @@
"""Support for Abode Security System sensors."""
import logging
import abodepy.helpers.constants as CONST
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
from . import AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
@@ -19,23 +22,22 @@ SENSOR_TYPES = {
}
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up a sensor for an Abode device."""
import abodepy.helpers.constants as CONST
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a sensor for an Abode device."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_SENSOR):
if data.is_excluded(device):
continue
for sensor_type in SENSOR_TYPES:
devices.append(AbodeSensor(data, device, sensor_type))
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeSensor(AbodeDevice):

View File

@@ -0,0 +1,22 @@
{
"config": {
"title": "Abode",
"step": {
"user": {
"title": "Fill in your Abode login information",
"data": {
"username": "Email Address",
"password": "Password"
}
}
},
"error": {
"identifier_exists": "Account already registered.",
"invalid_credentials": "Invalid credentials.",
"connection_error": "Unable to connect to Abode."
},
"abort": {
"single_instance_allowed": "Only a single configuration of Abode is allowed."
}
}
}

View File

@@ -1,41 +1,37 @@
"""Support for Abode Security System switches."""
import logging
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
from homeassistant.components.switch import SwitchDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
from . import AbodeAutomation, AbodeDevice
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Abode switch devices."""
import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Platform uses config entry setup."""
pass
data = hass.data[ABODE_DOMAIN]
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode switch devices."""
data = hass.data[DOMAIN]
devices = []
# Get all regular switches that are not excluded or marked as lights
for device in data.abode.get_devices(generic_type=CONST.TYPE_SWITCH):
if data.is_excluded(device) or data.is_light(device):
continue
devices.append(AbodeSwitch(data, device))
# Get all Abode automations that can be enabled/disabled
for automation in data.abode.get_automations(generic_type=CONST.TYPE_AUTOMATION):
if data.is_automation_excluded(automation):
continue
devices.append(
AbodeAutomationSwitch(data, automation, TIMELINE.AUTOMATION_EDIT_GROUP)
)
data.devices.extend(devices)
add_entities(devices)
async_add_entities(devices)
class AbodeSwitch(AbodeDevice, SwitchDevice):

View File

@@ -1,6 +1,7 @@
"""Use serial protocol of Acer projector to obtain state of the projector."""
import logging
import re
import serial
import voluptuous as vol
@@ -73,7 +74,6 @@ class AcerSwitch(SwitchDevice):
def __init__(self, serial_port, name, timeout, write_timeout, **kwargs):
"""Init of the Acer projector."""
import serial
self.ser = serial.Serial(
port=serial_port, timeout=timeout, write_timeout=write_timeout, **kwargs
@@ -90,7 +90,6 @@ class AcerSwitch(SwitchDevice):
def _write_read(self, msg):
"""Write to the projector and read the return."""
import serial
ret = ""
# Sometimes the projector won't answer for no reason or the projector

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Aquesta integraci\u00f3 necessita la versi\u00f3 d'AdGuard Home {minimal_version} o una superior, tens la {current_version}. Actualitza el complement de Hass.io d'AdGuard Home.",
"adguard_home_outdated": "Aquesta integraci\u00f3 necessita la versi\u00f3 d'AdGuard Home {minimal_version} o una superior, tens la {current_version}.",
"existing_instance_updated": "S'ha actualitzat la configuraci\u00f3 existent.",
"single_instance_allowed": "Nom\u00e9s es permet una \u00fanica configuraci\u00f3 d'AdGuard Home."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "This integration requires AdGuard Home {minimal_version} or higher, you have {current_version}. Please update your Hass.io AdGuard Home add-on.",
"adguard_home_outdated": "This integration requires AdGuard Home {minimal_version} or higher, you have {current_version}.",
"existing_instance_updated": "Updated existing configuration.",
"single_instance_allowed": "Only a single configuration of AdGuard Home is allowed."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Esta integraci\u00f3n requiere AdGuard Home {minimal_version} o superior, usted tiene {current_version}. Por favor, actualice su complemento Hass.io AdGuard Home.",
"adguard_home_outdated": "Esta integraci\u00f3n requiere AdGuard Home {minimal_version} o superior, usted tiene {current_version}.",
"existing_instance_updated": "Se ha actualizado la configuraci\u00f3n existente.",
"single_instance_allowed": "S\u00f3lo se permite una \u00fanica configuraci\u00f3n de AdGuard Home."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Cette int\u00e9gration n\u00e9cessite AdGuard Home {minimal_version} ou une version ult\u00e9rieure, vous disposez de {current_version}. Veuillez mettre \u00e0 jour votre compl\u00e9ment Hass.io AdGuard Home.",
"adguard_home_outdated": "Cette int\u00e9gration n\u00e9cessite AdGuard Home {minimal_version} ou une version ult\u00e9rieure, vous disposez de {current_version}.",
"existing_instance_updated": "La configuration existante a \u00e9t\u00e9 mise \u00e0 jour.",
"single_instance_allowed": "Une seule configuration d'AdGuard Home est autoris\u00e9e."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "\uc774 \ud1b5\ud569 \uad6c\uc131\uc694\uc18c\ub294 AdGuard Home {minimal_version} \uc774\uc0c1\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \ud604\uc7ac \ubc84\uc804\uc740 {current_version} \uc785\ub2c8\ub2e4. Hass.io AdGuard Home \uc560\ub4dc\uc628\uc744 \uc5c5\ub370\uc774\ud2b8 \ud574\uc8fc\uc138\uc694.",
"adguard_home_outdated": "\uc774 \ud1b5\ud569 \uad6c\uc131\uc694\uc18c\ub294 AdGuard Home {minimal_version} \uc774\uc0c1\uc774 \ud544\uc694\ud569\ub2c8\ub2e4. \ud604\uc7ac \ubc84\uc804\uc740 {current_version} \uc785\ub2c8\ub2e4.",
"existing_instance_updated": "\uae30\uc874 \uad6c\uc131\uc744 \uc5c5\ub370\uc774\ud2b8\ud588\uc2b5\ub2c8\ub2e4.",
"single_instance_allowed": "\ud558\ub098\uc758 AdGuard Home \ub9cc \uad6c\uc131 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "D\u00ebs Integratioun ben\u00e9idegt AdgGuard Home {minimal_version} oder m\u00e9i, dir hutt {current_version}. Aktualis\u00e9iert w.e.g. \u00e4ren Hass.io AdGuard Home Add-on.",
"adguard_home_outdated": "D\u00ebs Integratioun ben\u00e9idegt AdgGuard Home {minimal_version} oder m\u00e9i, dir hutt {current_version}.",
"existing_instance_updated": "D\u00e9i bestehend Konfiguratioun ass ge\u00e4nnert.",
"single_instance_allowed": "N\u00ebmmen eng eenzeg Konfiguratioun vun AdGuard Home ass erlaabt."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Deze integratie vereist AdGuard Home {minimal_version} of hoger, u heeft {current_version}. Update uw Hass.io AdGuard Home-add-on.",
"adguard_home_outdated": "Deze integratie vereist AdGuard Home {minimal_version} of hoger, u heeft {current_version}.",
"existing_instance_updated": "Bestaande configuratie bijgewerkt.",
"single_instance_allowed": "Slechts \u00e9\u00e9n configuratie van AdGuard Home is toegestaan."
},

View File

@@ -6,6 +6,7 @@
"username": "Brukarnamn"
}
}
}
},
"title": "AdGuard Home"
}
}

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Denne integrasjonen krever AdGuard Home {minimal_version} eller h\u00f8yere, du har {current_version}. Vennligst oppdater Hass.io AdGuard Home-tillegget.",
"adguard_home_outdated": "Denne integrasjonen krever AdGuard Home {minimal_version} eller h\u00f8yere, du har {current_version}.",
"existing_instance_updated": "Oppdatert eksisterende konfigurasjon.",
"single_instance_allowed": "Kun en konfigurasjon av AdGuard Hjemer tillatt."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Ta integracja wymaga AdGuard Home {minimal_version} lub nowszej wersji, masz {current_version}. Zaktualizuj sw\u00f3j dodatek Hass.io AdGuard Home.",
"adguard_home_outdated": "Ta integracja wymaga AdGuard Home {minimal_version} lub nowszej wersji, masz {current_version}.",
"existing_instance_updated": "Zaktualizowano istniej\u0105c\u0105 konfiguracj\u0119.",
"single_instance_allowed": "Dozwolona jest tylko jedna konfiguracja AdGuard Home."
},

View File

@@ -0,0 +1,12 @@
{
"config": {
"step": {
"user": {
"data": {
"host": "Servidor",
"port": "Porta"
}
}
}
}
}

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "\u042d\u0442\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 AdGuard Home \u0432\u0435\u0440\u0441\u0438\u0438 {current_version}. \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f {minimal_version}, \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0430\u044f. \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 Hass.io.",
"adguard_home_outdated": "\u042d\u0442\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 AdGuard Home \u0432\u0435\u0440\u0441\u0438\u0438 {current_version}. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0432\u0435\u0440\u0441\u0438\u044e {minimal_version} \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0443\u044e.",
"existing_instance_updated": "\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430.",
"single_instance_allowed": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Za to integracijo je potrebna AdGuard Home {minimal_version} ali vi\u0161ja, vi imate {current_version}. Prosimo posodobite va\u0161 hass.io AdGuard Home dodatek.",
"adguard_home_outdated": "Za to integracijo je potrebna AdGuard Home {minimal_version} ali vi\u0161ja, vi imate {current_version}.",
"existing_instance_updated": "Posodobljena obstoje\u010da konfiguracija.",
"single_instance_allowed": "Dovoljena je samo ena konfiguracija AdGuard Home."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "\u6574\u5408\u9700\u8981 AdGuard Home {minimal_version} \u6216\u66f4\u65b0\u7248\u672c\uff0c\u60a8\u76ee\u524d\u4f7f\u7528\u7248\u672c\u70ba {current_version}\u3002\u8acb\u66f4\u65b0 Hass.io AdGuard Home \u5143\u4ef6\u3002",
"adguard_home_outdated": "\u6574\u5408\u9700\u8981 AdGuard Home {minimal_version} \u6216\u66f4\u65b0\u7248\u672c\uff0c\u60a8\u76ee\u524d\u4f7f\u7528\u7248\u672c\u70ba {current_version}\u3002",
"existing_instance_updated": "\u5df2\u66f4\u65b0\u73fe\u6709\u8a2d\u5b9a\u3002",
"single_instance_allowed": "\u50c5\u5141\u8a31\u8a2d\u5b9a\u4e00\u7d44 AdGuard Home\u3002"
},

View File

@@ -1,8 +1,9 @@
"""Support for AdGuard Home."""
from distutils.version import LooseVersion
import logging
from typing import Any, Dict
from adguardhome import AdGuardHome, AdGuardHomeError
from adguardhome import AdGuardHome, AdGuardHomeConnectionError, AdGuardHomeError
import voluptuous as vol
from homeassistant.components.adguard.const import (
@@ -10,6 +11,7 @@ from homeassistant.components.adguard.const import (
DATA_ADGUARD_CLIENT,
DATA_ADGUARD_VERION,
DOMAIN,
MIN_ADGUARD_HOME_VERSION,
SERVICE_ADD_URL,
SERVICE_DISABLE_URL,
SERVICE_ENABLE_URL,
@@ -27,6 +29,7 @@ from homeassistant.const import (
CONF_USERNAME,
CONF_VERIFY_SSL,
)
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity import Entity
@@ -64,6 +67,17 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
hass.data.setdefault(DOMAIN, {})[DATA_ADGUARD_CLIENT] = adguard
try:
version = await adguard.version()
except AdGuardHomeConnectionError as exception:
raise ConfigEntryNotReady from exception
if LooseVersion(MIN_ADGUARD_HOME_VERSION) > LooseVersion(version):
_LOGGER.error(
"This integration requires AdGuard Home v0.99.0 or higher to work correctly"
)
raise ConfigEntryNotReady
for component in "sensor", "switch":
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, component)

View File

@@ -1,11 +1,12 @@
"""Config flow to configure the AdGuard Home integration."""
from distutils.version import LooseVersion
import logging
from adguardhome import AdGuardHome, AdGuardHomeConnectionError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components.adguard.const import DOMAIN
from homeassistant.components.adguard.const import DOMAIN, MIN_ADGUARD_HOME_VERSION
from homeassistant.config_entries import ConfigFlow
from homeassistant.const import (
CONF_HOST,
@@ -83,11 +84,20 @@ class AdGuardHomeFlowHandler(ConfigFlow):
)
try:
await adguard.version()
version = await adguard.version()
except AdGuardHomeConnectionError:
errors["base"] = "connection_error"
return await self._show_setup_form(errors)
if LooseVersion(MIN_ADGUARD_HOME_VERSION) > LooseVersion(version):
return self.async_abort(
reason="adguard_home_outdated",
description_placeholders={
"current_version": version,
"minimal_version": MIN_ADGUARD_HOME_VERSION,
},
)
return self.async_create_entry(
title=user_input[CONF_HOST],
data={
@@ -156,11 +166,20 @@ class AdGuardHomeFlowHandler(ConfigFlow):
)
try:
await adguard.version()
version = await adguard.version()
except AdGuardHomeConnectionError:
errors["base"] = "connection_error"
return await self._show_hassio_form(errors)
if LooseVersion(MIN_ADGUARD_HOME_VERSION) > LooseVersion(version):
return self.async_abort(
reason="adguard_home_addon_outdated",
description_placeholders={
"current_version": version,
"minimal_version": MIN_ADGUARD_HOME_VERSION,
},
)
return self.async_create_entry(
title=self._hassio_discovery["addon"],
data={

View File

@@ -7,6 +7,8 @@ DATA_ADGUARD_VERION = "adguard_version"
CONF_FORCE = "force"
MIN_ADGUARD_HOME_VERSION = "v0.99.0"
SERVICE_ADD_URL = "add_url"
SERVICE_DISABLE_URL = "disable_url"
SERVICE_ENABLE_URL = "enable_url"

View File

@@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/adguard",
"requirements": [
"adguardhome==0.2.1"
"adguardhome==0.3.0"
],
"dependencies": [],
"codeowners": [

View File

@@ -23,8 +23,10 @@
"connection_error": "Failed to connect."
},
"abort": {
"single_instance_allowed": "Only a single configuration of AdGuard Home is allowed.",
"existing_instance_updated": "Updated existing configuration."
"adguard_home_outdated": "This integration requires AdGuard Home {minimal_version} or higher, you have {current_version}.",
"adguard_home_addon_outdated": "This integration requires AdGuard Home {minimal_version} or higher, you have {current_version}. Please update your Hass.io AdGuard Home add-on.",
"existing_instance_updated": "Updated existing configuration.",
"single_instance_allowed": "Only a single configuration of AdGuard Home is allowed."
}
}
}
}

View File

@@ -7,6 +7,8 @@ from collections import namedtuple
import asyncio
import async_timeout
import pyads
import voluptuous as vol
from homeassistant.const import (
@@ -78,7 +80,6 @@ SCHEMA_SERVICE_WRITE_DATA_BY_NAME = vol.Schema(
def setup(hass, config):
"""Set up the ADS component."""
import pyads
conf = config[DOMAIN]
@@ -161,7 +162,6 @@ class AdsHub:
def shutdown(self, *args, **kwargs):
"""Shutdown ADS connection."""
import pyads
_LOGGER.debug("Shutting down ADS")
for notification_item in self._notification_items.values():
@@ -187,7 +187,6 @@ class AdsHub:
def write_by_name(self, name, value, plc_datatype):
"""Write a value to the device."""
import pyads
with self._lock:
try:
@@ -197,7 +196,6 @@ class AdsHub:
def read_by_name(self, name, plc_datatype):
"""Read a value from the device."""
import pyads
with self._lock:
try:
@@ -207,7 +205,6 @@ class AdsHub:
def add_device_notification(self, name, plc_datatype, callback):
"""Add a notification to the ADS devices."""
import pyads
attr = pyads.NotificationAttrib(ctypes.sizeof(plc_datatype))

View File

@@ -146,10 +146,10 @@ class AfterShipSensor(Entity):
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
UPDATE_TOPIC, self.force_update
UPDATE_TOPIC, self._force_update
)
async def force_update(self):
async def _force_update(self):
"""Force update of data."""
await self.async_update(no_throttle=True)
await self.async_update_ha_state()

View File

@@ -0,0 +1,22 @@
{
"config": {
"error": {
"auth": "Der API-Schl\u00fcssel ist nicht korrekt.",
"name_exists": "Name existiert bereits",
"wrong_location": "Keine Airly Luftmessstation an diesem Ort"
},
"step": {
"user": {
"data": {
"api_key": "Airly API-Schl\u00fcssel",
"latitude": "Breitengrad",
"longitude": "L\u00e4ngengrad",
"name": "Name der Integration"
},
"description": "Einrichtung der Airly-Luftqualit\u00e4t Integration. Um einen API-Schl\u00fcssel zu generieren, registriere dich auf https://developer.airly.eu/register",
"title": "Airly"
}
},
"title": "Airly"
}
}

View File

@@ -13,6 +13,7 @@
"longitude": "Longitude",
"name": "Nom de l'int\u00e9gration"
},
"description": "Configurez l'int\u00e9gration de la qualit\u00e9 de l'air Airly. Pour g\u00e9n\u00e9rer une cl\u00e9 API, rendez-vous sur https://developer.airly.eu/register.",
"title": "Airly"
}
},

View File

@@ -0,0 +1,22 @@
{
"config": {
"error": {
"auth": "API \ud0a4\uac00 \uc62c\ubc14\ub974\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.",
"name_exists": "\uc774\ub984\uc774 \uc774\ubbf8 \uc874\uc7ac\ud569\ub2c8\ub2e4.",
"wrong_location": "\uc774 \uc9c0\uc5ed\uc5d0\ub294 Airly \uce21\uc815 \uc2a4\ud14c\uc774\uc158\uc774 \uc5c6\uc2b5\ub2c8\ub2e4."
},
"step": {
"user": {
"data": {
"api_key": "Airly API \ud0a4",
"latitude": "\uc704\ub3c4",
"longitude": "\uacbd\ub3c4",
"name": "\ud1b5\ud569 \uad6c\uc131\uc694\uc18c\uc758 \uc774\ub984"
},
"description": "Airly \uacf5\uae30 \ud488\uc9c8 \ud1b5\ud569 \uad6c\uc131\uc694\uc18c\ub97c \uc124\uc815\ud569\ub2c8\ub2e4. API \ud0a4\ub97c \uc0dd\uc131\ud558\ub824\uba74 https://developer.airly.eu/register \ub85c \uc774\ub3d9\ud574\uc8fc\uc138\uc694",
"title": "Airly"
}
},
"title": "Airly"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"error": {
"auth": "API-sleutel is niet correct.",
"name_exists": "Naam bestaat al.",
"wrong_location": "Geen Airly meetstations in dit gebied."
},
"step": {
"user": {
"data": {
"api_key": "Airly API-sleutel",
"latitude": "Breedtegraad",
"longitude": "Lengtegraad",
"name": "Naam van de integratie"
},
"description": "Airly-integratie van luchtkwaliteit instellen. Ga naar https://developer.airly.eu/register om de API-sleutel te genereren",
"title": "Airly"
}
},
"title": "Airly"
}
}

View File

@@ -0,0 +1,14 @@
{
"config": {
"step": {
"user": {
"data": {
"latitude": "Latitude",
"longitude": "Longitude"
},
"title": ""
}
},
"title": ""
}
}

View File

@@ -0,0 +1,114 @@
"""The Airly component."""
import asyncio
import logging
from datetime import timedelta
import async_timeout
from aiohttp.client_exceptions import ClientConnectorError
from airly import Airly
from airly.exceptions import AirlyError
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import Config, HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import Throttle
from .const import (
ATTR_API_ADVICE,
ATTR_API_CAQI,
ATTR_API_CAQI_DESCRIPTION,
ATTR_API_CAQI_LEVEL,
DATA_CLIENT,
DOMAIN,
NO_AIRLY_SENSORS,
)
_LOGGER = logging.getLogger(__name__)
DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Airly."""
return True
async def async_setup_entry(hass, config_entry):
"""Set up Airly as config entry."""
api_key = config_entry.data[CONF_API_KEY]
latitude = config_entry.data[CONF_LATITUDE]
longitude = config_entry.data[CONF_LONGITUDE]
websession = async_get_clientsession(hass)
airly = AirlyData(websession, api_key, latitude, longitude)
await airly.async_update()
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = airly
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, "air_quality")
)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(config_entry, "sensor")
)
return True
async def async_unload_entry(hass, config_entry):
"""Unload a config entry."""
hass.data[DOMAIN][DATA_CLIENT].pop(config_entry.entry_id)
await hass.config_entries.async_forward_entry_unload(config_entry, "air_quality")
await hass.config_entries.async_forward_entry_unload(config_entry, "sensor")
return True
class AirlyData:
"""Define an object to hold Airly data."""
def __init__(self, session, api_key, latitude, longitude):
"""Initialize."""
self.latitude = latitude
self.longitude = longitude
self.airly = Airly(api_key, session)
self.data = {}
@Throttle(DEFAULT_SCAN_INTERVAL)
async def async_update(self):
"""Update Airly data."""
try:
with async_timeout.timeout(10):
measurements = self.airly.create_measurements_session_point(
self.latitude, self.longitude
)
await measurements.update()
values = measurements.current["values"]
index = measurements.current["indexes"][0]
standards = measurements.current["standards"]
if index["description"] == NO_AIRLY_SENSORS:
_LOGGER.error("Can't retrieve data: no Airly sensors in this area")
return
for value in values:
self.data[value["name"]] = value["value"]
for standard in standards:
self.data[f"{standard['pollutant']}_LIMIT"] = standard["limit"]
self.data[f"{standard['pollutant']}_PERCENT"] = standard["percent"]
self.data[ATTR_API_CAQI] = index["value"]
self.data[ATTR_API_CAQI_LEVEL] = index["level"].lower().replace("_", " ")
self.data[ATTR_API_CAQI_DESCRIPTION] = index["description"]
self.data[ATTR_API_ADVICE] = index["advice"]
_LOGGER.debug("Data retrieved from Airly")
except (
ValueError,
AirlyError,
asyncio.TimeoutError,
ClientConnectorError,
) as error:
_LOGGER.error(error)
self.data = {}

View File

@@ -0,0 +1,138 @@
"""Support for the Airly air_quality service."""
from homeassistant.components.air_quality import (
AirQualityEntity,
ATTR_AQI,
ATTR_PM_10,
ATTR_PM_2_5,
)
from homeassistant.const import CONF_NAME
from .const import (
ATTR_API_ADVICE,
ATTR_API_CAQI,
ATTR_API_CAQI_DESCRIPTION,
ATTR_API_CAQI_LEVEL,
ATTR_API_PM10,
ATTR_API_PM10_LIMIT,
ATTR_API_PM10_PERCENT,
ATTR_API_PM25,
ATTR_API_PM25_LIMIT,
ATTR_API_PM25_PERCENT,
DATA_CLIENT,
DOMAIN,
)
ATTRIBUTION = "Data provided by Airly"
LABEL_ADVICE = "advice"
LABEL_AQI_LEVEL = f"{ATTR_AQI}_level"
LABEL_PM_2_5_LIMIT = f"{ATTR_PM_2_5}_limit"
LABEL_PM_2_5_PERCENT = f"{ATTR_PM_2_5}_percent_of_limit"
LABEL_PM_10_LIMIT = f"{ATTR_PM_10}_limit"
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]
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
async_add_entities([AirlyAirQuality(data, name)], True)
def round_state(func):
"""Round state."""
def _decorator(self):
res = func(self)
if isinstance(res, float):
return round(res)
return res
return _decorator
class AirlyAirQuality(AirQualityEntity):
"""Define an Airly air quality."""
def __init__(self, airly, name):
"""Initialize."""
self.airly = airly
self.data = airly.data
self._name = name
self._pm_2_5 = None
self._pm_10 = None
self._aqi = None
self._icon = "mdi:blur"
self._attrs = {}
@property
def name(self):
"""Return the name."""
return self._name
@property
def icon(self):
"""Return the icon."""
return self._icon
@property
@round_state
def air_quality_index(self):
"""Return the air quality index."""
return self._aqi
@property
@round_state
def particulate_matter_2_5(self):
"""Return the particulate matter 2.5 level."""
return self._pm_2_5
@property
@round_state
def particulate_matter_10(self):
"""Return the particulate matter 10 level."""
return self._pm_10
@property
def attribution(self):
"""Return the attribution."""
return ATTRIBUTION
@property
def state(self):
"""Return the CAQI description."""
return self.data[ATTR_API_CAQI_DESCRIPTION]
@property
def unique_id(self):
"""Return a unique_id for this entity."""
return f"{self.airly.latitude}-{self.airly.longitude}"
@property
def available(self):
"""Return True if entity is available."""
return bool(self.airly.data)
@property
def device_state_attributes(self):
"""Return the state attributes."""
self._attrs[LABEL_ADVICE] = self.data[ATTR_API_ADVICE]
self._attrs[LABEL_AQI_LEVEL] = self.data[ATTR_API_CAQI_LEVEL]
self._attrs[LABEL_PM_2_5_LIMIT] = self.data[ATTR_API_PM25_LIMIT]
self._attrs[LABEL_PM_2_5_PERCENT] = round(self.data[ATTR_API_PM25_PERCENT])
self._attrs[LABEL_PM_10_LIMIT] = self.data[ATTR_API_PM10_LIMIT]
self._attrs[LABEL_PM_10_PERCENT] = round(self.data[ATTR_API_PM10_PERCENT])
return self._attrs
async def async_update(self):
"""Update the entity."""
await self.airly.async_update()
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]

View File

@@ -0,0 +1,114 @@
"""Adds config flow for Airly."""
import async_timeout
import voluptuous as vol
from airly import Airly
from airly.exceptions import AirlyError
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
from .const import DEFAULT_NAME, DOMAIN, NO_AIRLY_SENSORS
@callback
def configured_instances(hass):
"""Return a set of configured Airly instances."""
return set(
entry.data[CONF_NAME] for entry in hass.config_entries.async_entries(DOMAIN)
)
class AirlyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Config flow for Airly."""
VERSION = 1
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
def __init__(self):
"""Initialize."""
self._errors = {}
async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
self._errors = {}
websession = async_get_clientsession(self.hass)
if user_input is not None:
if user_input[CONF_NAME] in configured_instances(self.hass):
self._errors[CONF_NAME] = "name_exists"
api_key_valid = await self._test_api_key(websession, user_input["api_key"])
if not api_key_valid:
self._errors["base"] = "auth"
else:
location_valid = await self._test_location(
websession,
user_input["api_key"],
user_input["latitude"],
user_input["longitude"],
)
if not location_valid:
self._errors["base"] = "wrong_location"
if not self._errors:
return self.async_create_entry(
title=user_input[CONF_NAME], data=user_input
)
return self._show_config_form(
name=DEFAULT_NAME,
api_key="",
latitude=self.hass.config.latitude,
longitude=self.hass.config.longitude,
)
def _show_config_form(self, name=None, api_key=None, latitude=None, longitude=None):
"""Show the configuration form to edit data."""
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{
vol.Required(CONF_API_KEY, default=api_key): str,
vol.Optional(
CONF_LATITUDE, default=self.hass.config.latitude
): cv.latitude,
vol.Optional(
CONF_LONGITUDE, default=self.hass.config.longitude
): cv.longitude,
vol.Optional(CONF_NAME, default=name): str,
}
),
errors=self._errors,
)
async def _test_api_key(self, client, api_key):
"""Return true if api_key is valid."""
with async_timeout.timeout(10):
airly = Airly(api_key, client)
measurements = airly.create_measurements_session_point(
latitude=52.24131, longitude=20.99101
)
try:
await measurements.update()
except AirlyError:
return False
return True
async def _test_location(self, client, api_key, latitude, longitude):
"""Return true if location is valid."""
with async_timeout.timeout(10):
airly = Airly(api_key, client)
measurements = airly.create_measurements_session_point(
latitude=latitude, longitude=longitude
)
await measurements.update()
current = measurements.current
if current["indexes"][0]["description"] == NO_AIRLY_SENSORS:
return False
return True

View File

@@ -0,0 +1,19 @@
"""Constants for Airly integration."""
ATTR_API_ADVICE = "ADVICE"
ATTR_API_CAQI = "CAQI"
ATTR_API_CAQI_DESCRIPTION = "DESCRIPTION"
ATTR_API_CAQI_LEVEL = "LEVEL"
ATTR_API_HUMIDITY = "HUMIDITY"
ATTR_API_PM1 = "PM1"
ATTR_API_PM10 = "PM10"
ATTR_API_PM10_LIMIT = "PM10_LIMIT"
ATTR_API_PM10_PERCENT = "PM10_PERCENT"
ATTR_API_PM25 = "PM25"
ATTR_API_PM25_LIMIT = "PM25_LIMIT"
ATTR_API_PM25_PERCENT = "PM25_PERCENT"
ATTR_API_PRESSURE = "PRESSURE"
ATTR_API_TEMPERATURE = "TEMPERATURE"
DATA_CLIENT = "client"
DEFAULT_NAME = "Airly"
DOMAIN = "airly"
NO_AIRLY_SENSORS = "There are no Airly sensors in this area yet."

View File

@@ -0,0 +1,9 @@
{
"domain": "airly",
"name": "Airly",
"documentation": "https://www.home-assistant.io/integrations/airly",
"dependencies": [],
"codeowners": ["@bieniu"],
"requirements": ["airly==0.0.2"],
"config_flow": true
}

View File

@@ -0,0 +1,150 @@
"""Support for the Airly sensor service."""
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
CONF_NAME,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
PRESSURE_HPA,
TEMP_CELSIUS,
)
from homeassistant.helpers.entity import Entity
from .const import (
ATTR_API_HUMIDITY,
ATTR_API_PM1,
ATTR_API_PRESSURE,
ATTR_API_TEMPERATURE,
DATA_CLIENT,
DOMAIN,
)
ATTRIBUTION = "Data provided by Airly"
ATTR_ICON = "icon"
ATTR_LABEL = "label"
ATTR_UNIT = "unit"
HUMI_PERCENT = "%"
VOLUME_MICROGRAMS_PER_CUBIC_METER = "µg/m³"
SENSOR_TYPES = {
ATTR_API_PM1: {
ATTR_DEVICE_CLASS: None,
ATTR_ICON: "mdi:blur",
ATTR_LABEL: ATTR_API_PM1,
ATTR_UNIT: VOLUME_MICROGRAMS_PER_CUBIC_METER,
},
ATTR_API_HUMIDITY: {
ATTR_DEVICE_CLASS: DEVICE_CLASS_HUMIDITY,
ATTR_ICON: None,
ATTR_LABEL: ATTR_API_HUMIDITY.capitalize(),
ATTR_UNIT: HUMI_PERCENT,
},
ATTR_API_PRESSURE: {
ATTR_DEVICE_CLASS: DEVICE_CLASS_PRESSURE,
ATTR_ICON: None,
ATTR_LABEL: ATTR_API_PRESSURE.capitalize(),
ATTR_UNIT: PRESSURE_HPA,
},
ATTR_API_TEMPERATURE: {
ATTR_DEVICE_CLASS: DEVICE_CLASS_TEMPERATURE,
ATTR_ICON: None,
ATTR_LABEL: ATTR_API_TEMPERATURE.capitalize(),
ATTR_UNIT: TEMP_CELSIUS,
},
}
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]
data = hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id]
sensors = []
for sensor in SENSOR_TYPES:
sensors.append(AirlySensor(data, name, sensor))
async_add_entities(sensors, True)
def round_state(func):
"""Round state."""
def _decorator(self):
res = func(self)
if isinstance(res, float):
return round(res)
return res
return _decorator
class AirlySensor(Entity):
"""Define an Airly sensor."""
def __init__(self, airly, name, kind):
"""Initialize."""
self.airly = airly
self.data = airly.data
self._name = name
self.kind = kind
self._device_class = None
self._state = None
self._icon = None
self._unit_of_measurement = None
self._attrs = {ATTR_ATTRIBUTION: ATTRIBUTION}
@property
def name(self):
"""Return the name."""
return f"{self._name} {SENSOR_TYPES[self.kind][ATTR_LABEL]}"
@property
def state(self):
"""Return the state."""
self._state = self.data[self.kind]
if self.kind in [ATTR_API_PM1, ATTR_API_PRESSURE]:
self._state = round(self._state)
if self.kind in [ATTR_API_TEMPERATURE, ATTR_API_HUMIDITY]:
self._state = round(self._state, 1)
return self._state
@property
def device_state_attributes(self):
"""Return the state attributes."""
return self._attrs
@property
def icon(self):
"""Return the icon."""
self._icon = SENSOR_TYPES[self.kind][ATTR_ICON]
return self._icon
@property
def device_class(self):
"""Return the device_class."""
return SENSOR_TYPES[self.kind][ATTR_DEVICE_CLASS]
@property
def unique_id(self):
"""Return a unique_id for this entity."""
return f"{self.airly.latitude}-{self.airly.longitude}-{self.kind.lower()}"
@property
def unit_of_measurement(self):
"""Return the unit the value is expressed in."""
return SENSOR_TYPES[self.kind][ATTR_UNIT]
@property
def available(self):
"""Return True if entity is available."""
return bool(self.airly.data)
async def async_update(self):
"""Update the sensor."""
await self.airly.async_update()
if self.airly.data:
self.data = self.airly.data

View File

@@ -0,0 +1,22 @@
{
"config": {
"title": "Airly",
"step": {
"user": {
"title": "Airly",
"description": "Set up Airly air quality integration. To generate API key go to https://developer.airly.eu/register",
"data": {
"name": "Name of the integration",
"api_key": "Airly API key",
"latitude": "Latitude",
"longitude": "Longitude"
}
}
},
"error": {
"name_exists": "Name already exists.",
"wrong_location": "No Airly measuring stations in this area.",
"auth": "API key is not correct."
}
}
}

View File

@@ -1,7 +1,9 @@
"""Support for AirVisual air quality sensors."""
from logging import getLogger
from datetime import timedelta
from logging import getLogger
from pyairvisual import Client
from pyairvisual.errors import AirVisualError
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
@@ -14,8 +16,8 @@ from homeassistant.const import (
CONF_LONGITUDE,
CONF_MONITORED_CONDITIONS,
CONF_SCAN_INTERVAL,
CONF_STATE,
CONF_SHOW_ON_MAP,
CONF_STATE,
)
from homeassistant.helpers import aiohttp_client, config_validation as cv
from homeassistant.helpers.entity import Entity
@@ -97,7 +99,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Configure the platform and add the sensors."""
from pyairvisual import Client
city = config.get(CONF_CITY)
state = config.get(CONF_STATE)
@@ -249,7 +250,6 @@ class AirVisualData:
async def _async_update(self):
"""Update AirVisual data."""
from pyairvisual.errors import AirVisualError
try:
if self.city and self.state and self.country:

View File

@@ -1,21 +1,22 @@
"""Platform for the Aladdin Connect cover component."""
import logging
from aladdin_connect import AladdinConnectClient
import voluptuous as vol
from homeassistant.components.cover import (
CoverDevice,
PLATFORM_SCHEMA,
SUPPORT_OPEN,
SUPPORT_CLOSE,
SUPPORT_OPEN,
CoverDevice,
)
from homeassistant.const import (
CONF_USERNAME,
CONF_PASSWORD,
CONF_USERNAME,
STATE_CLOSED,
STATE_OPENING,
STATE_CLOSING,
STATE_OPEN,
STATE_OPENING,
)
import homeassistant.helpers.config_validation as cv
@@ -40,7 +41,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Aladdin Connect platform."""
from aladdin_connect import AladdinConnectClient
username = config.get(CONF_USERNAME)
password = config.get(CONF_PASSWORD)

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "Activa {entity_name} fora",
"arm_home": "Activa {entity_name} a casa",
"arm_night": "Activa {entity_name} nocturn",
"disarm": "Desactiva {entity_name}",
"trigger": "Dispara {entity_name}"
}
}
}

View File

@@ -0,0 +1,7 @@
{
"device_automation": {
"action_type": {
"trigger": "Udl\u00f8s {entity_name}"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "Arm {entity_name} away",
"arm_home": "Arm {entity_name} home",
"arm_night": "Arm {entity_name} night",
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "Armar {entity_name} exterior",
"arm_home": "Armar {entity_name} modo casa",
"arm_night": "Armar {entity_name} por la noche",
"disarm": "Desarmar {entity_name}",
"trigger": "Lanzar {entity_name}"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"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",
"disarm": "D\u00e9sarmer {entity_name}",
"trigger": "D\u00e9clencheur {entity_name}"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "Armare {entity_name} uscito",
"arm_home": "Armare {entity_name} casa",
"arm_night": "Armare {entity_name} notte",
"disarm": "Disarmare {entity_name}",
"trigger": "Attivazione {entity_name}"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "{entity_name} \uc678\ucd9c\uacbd\ube44",
"arm_home": "{entity_name} \uc7ac\uc2e4\uacbd\ube44",
"arm_night": "{entity_name} \uc57c\uac04\uacbd\ube44",
"disarm": "{entity_name} \uacbd\ube44\ud574\uc81c",
"trigger": "{entity_name} \ud2b8\ub9ac\uac70"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "{entity_name} fir \u00ebnnerwee uschalten",
"arm_home": "{entity_name} fir doheem uschalten",
"arm_night": "{entity_name} fir Nuecht uschalten",
"disarm": "{entity_name} entsch\u00e4rfen",
"trigger": "{entity_name} ausl\u00e9isen"
}
}
}

View File

@@ -0,0 +1,8 @@
{
"device_automation": {
"action_type": {
"disarm": "Uitschakelen {entity_name}",
"trigger": "Trigger {entity_name}"
}
}
}

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