Compare commits

..

330 Commits

Author SHA1 Message Date
Paulus Schoutsen
b870980456 Merge pull request #26463 from home-assistant/rc
0.98.4
2019-09-05 22:19:39 -07:00
Paulus Schoutsen
f23ab2af8c Bumped version to 0.98.4 2019-09-05 22:10:37 -07:00
Paulus Schoutsen
79045f2da1 Undo accidental Tuya change 2019-09-04 09:23:56 -07:00
Pascal Vizeli
e59eea3044 Merge pull request #26414 from home-assistant/rc
0.98.3
2019-09-04 09:33:30 +02:00
Paulus Schoutsen
b8f9319cb0 Bumped version to 0.98.3 2019-09-03 23:20:25 -07:00
Greg Laabs
860843ada1 Bump ISY994's PyISY dependency to 1.1.2 (#26413)
Fixed a major bug that was responsible for ISY events getting seemingly random delays up to 24 seconds
2019-09-03 23:20:17 -07:00
Paulus Schoutsen
7bccbcbcc3 Fix state report (#26406)
* Fix state report

* Update test
2019-09-03 23:20:17 -07:00
ehendrix23
8cf02e0b22 Update to 0.1.13 (#26402)
Update to 0.1.13
2019-09-03 23:20:16 -07:00
Daniel Høyer Iversen
93e4cd6bb2 Met, check for existing location (#26400) 2019-09-03 23:20:15 -07:00
Paulus Schoutsen
d4905477b8 Allow core config updated (#26398) 2019-09-03 23:20:15 -07:00
Anders Melchiorsen
a980eedd22 Fix race during initial Sonos group construction (#26371)
* Fix race during initial Sonos group construction

* Update homeassistant/components/sonos/media_player.py
2019-09-03 23:20:14 -07:00
Robert Svensson
a74bb3fd5e String has nothing to do with class method naming (#26368) 2019-09-03 23:20:14 -07:00
Fabian Affolter
b50ac6f486 Upgrade pyhaversion to 3.1.0 (#26232) 2019-09-03 23:20:13 -07:00
Paulus Schoutsen
8ae5ece6bb Merge pull request #26345 from home-assistant/rc
0.98.2
2019-09-01 23:18:45 -07:00
Paulus Schoutsen
f6cf4c38e7 Bumped version to 0.98.2 2019-09-01 22:31:00 -07:00
tyjtyj
85a1726e69 Fix google_maps scan interval (#26328)
Reported on 
https://github.com/home-assistant/home-assistant/issues/26275
2019-09-01 22:30:46 -07:00
Robert Svensson
d1e3fbd622 deCONZ - Dont update entry if data is equal 2019-09-01 22:30:45 -07:00
Paulus Schoutsen
309d401e47 Fix alexa bad temp sensors (#26307) 2019-09-01 22:30:45 -07:00
Paulus Schoutsen
795d5405db Fix Alexa Report State (#26305)
* Fix Alexa Report State

* Forgot to save a file
2019-09-01 22:30:44 -07:00
Paul Annekov
732855e86c bump tuyaha 0.0.4 (#26303) 2019-09-01 22:30:44 -07:00
Paulus Schoutsen
47e76fcd5e Expose current direction properly on state machine (#26298)
* Expose current direction properly on state machine

* Fix template fan
2019-09-01 22:30:43 -07:00
Paulus Schoutsen
d1219d0b41 Merge pull request #26276 from home-assistant/rc
0.98.1
2019-08-29 16:03:33 -07:00
Robert Svensson
1ca2f1906a UniFi - dont schedule updates on disabled entities (#26278)
* Dont schedule updates on disabled entities

* Use entity enabled since it is available
2019-08-29 14:04:18 -07:00
Paulus Schoutsen
5413cbd195 Fix partly cloudy (#26277) 2019-08-29 13:23:19 -07:00
mbo18
015adbbac0 Fix missing DarkSky mdi icon (#26274)
* Fix missing DarkSky mdi icon

Fix mdi icon for DarkSky

* fix icon

* Update weather.py
2019-08-29 13:23:19 -07:00
Paulus Schoutsen
5676f6fb86 Bumped version to 0.98.1 2019-08-29 13:06:34 -07:00
David F. Mulcahey
bb52e17364 Fix ZHA state restore by always restoring last seen on devices (#26271)
* fix state restore by always restoring last seen

* cleanup
2019-08-29 12:56:18 -07:00
SukramJ
069e762da0 Fix for 0.98: Don't update disabled entities (Homematic IP Cloud) (#26236)
* Homematic IP Cloud Fix: Don't update disabled entities

* Added enabled to entity.py

* Update test for enabled

* Update entity.py
2019-08-29 12:56:18 -07:00
Eliseo Martelli
5f850a7dc7 Update sensor.py (#26209) 2019-08-29 12:56:17 -07:00
Paulus Schoutsen
04d2dbb573 Add translations 2019-08-29 12:32:46 -07:00
Paulus Schoutsen
688f5b7698 Merge pull request #26254 from home-assistant/rc
0.98.0
2019-08-28 15:21:47 -07:00
Paulus Schoutsen
69ddca6f68 Updated frontend to 20190828.0 2019-08-28 13:44:02 -07:00
Paulus Schoutsen
1c473487b1 Bumped version to 0.98.0 2019-08-28 13:38:56 -07:00
Johann Kellerman
bbc5049816 SMA beta fix #26225 (#26244) 2019-08-28 13:38:51 -07:00
Robert Svensson
d156648c55 deCONZ normalizes cover values to follow zigbee spec (#26240) 2019-08-28 13:38:50 -07:00
Florian Klien
1e61d50fc5 luci device-tracker dependency fix (#26215)
* luci device-tracker dependency fix

fixes issue #25758

* luci device-tracker fix, requirements_all
2019-08-28 13:38:49 -07:00
Paulus Schoutsen
907ffdb762 Update translations 2019-08-28 12:46:02 -07:00
Pascal Vizeli
d7df61f980 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-26 21:12:49 +02:00
Pascal Vizeli
efacfa3696 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-26 21:03:37 +02:00
Pascal Vizeli
60256cca17 Nightly builds (#26204)
* Nightly docker builds / Hass.io dev HA

* use same style

* Finish nightly build

* Update builder version

* Fix style

* fix style part 2

* Last one

* Fix order
2019-08-26 10:50:41 +00:00
Paulus Schoutsen
9ad1a1ca15 Bumped version to 0.98.0b2 2019-08-25 22:37:34 -07:00
David F. Mulcahey
9d51262559 bump quirks version (#26198) 2019-08-25 22:37:29 -07:00
Andrew Sayre
677995a05a Update pyheos to 0.6.0 (#26191) 2019-08-25 22:37:28 -07:00
Aaron Bach
afab0a9568 Fix possible KeyError in SimpliSafe (#26190) 2019-08-25 22:37:27 -07:00
Chao
b64ac5be85 fix issue setting scan_interval (#26165)
I was getting the following error when i set the scan_interval
```
    self.scan_interval = timedelta(seconds=config.get(CONF_SCAN_INTERVAL, 60))
TypeError: unsupported type for timedelta seconds component: datetime.timedelta
```
it turns out `config.get(CONF_SCAN_INTERVAL)` already returns `timedelta`

```('scan_interval', datetime.timedelta(seconds=180))```
2019-08-25 22:37:27 -07:00
Jeff Irion
ee03f5d7c1 Bump androidtv to 0.0.24 (#26158)
* Bump androidtv to 0.0.24

* Add unique ID for Fire TV (not just Android TV)
2019-08-25 22:37:26 -07:00
On Freund
45a454ba53 CoolMaster: Change auto to heat_cool (#26144) 2019-08-25 22:37:25 -07:00
Paulus Schoutsen
65cf5a6ef5 Reload config entry when entity enabled in entity registry, remove entity if disabled. (#26120)
* Reload config entry when disabled_by updated in entity registry

* Add types

* Remove entities that get disabled

* Remove unnecessary domain checks.

* Attach handler in async_setup

* Remove unused var

* Type

* Fix test

* Fix tests
2019-08-25 22:37:25 -07:00
Paulus Schoutsen
05ed3c44ea Updated frontend to 20190825.0 2019-08-25 22:25:05 -07:00
Pascal Vizeli
e4906c277a Update azure-pipelines-release.yml for Azure Pipelines 2019-08-23 13:55:23 +02:00
Paulus Schoutsen
c7477f00f5 Bumped version to 0.98.0b1 2019-08-22 15:09:26 -07:00
Paul Annekov
4d656e130d Fix tuya switch state (#26145)
* bump tuyaha 0.0.3

* bump tuyaha 0.0.3
2019-08-22 15:09:09 -07:00
Paulus Schoutsen
7b62516e69 Log warning if disabled entities receive updates. (#26143)
* Log warning if disabled entities receive updates.

* Fix test

* Always set entity ID on disabled entities
2019-08-22 15:09:08 -07:00
Phil Cole
a582110629 Nissanleaf login fix (#26139)
* Upgrade to pycarwings2.9 per 25 July 2019 API change

* Remove rest of location tracker. Fix get_status_from_update call.
2019-08-22 15:09:08 -07:00
SukramJ
08471e3e52 Splitt device_state_attributes between device and group for Homematic IP Cloud (#26137)
* splitt device_state_attributes between device and group

* readd device_state_attributes for access point
2019-08-22 15:09:07 -07:00
Jeff Irion
49bc3d3769 Load user-provided descriptions for python_scripts (#26069)
* Load user-provided descriptions for python_scripts

* Import SERVICE_DESCRIPTION_CACHE

* Use async_set_service_schema to register service descriptions

* Add python_script tests for loading service descriptions

* Use async/await in test
2019-08-22 15:09:06 -07:00
Paulus Schoutsen
8856a1cda6 Updated frontend to 20190822.0 2019-08-22 15:06:37 -07:00
Pascal Vizeli
5f8c3e6235 Update azure-pipelines-release.yml 2019-08-22 17:50:51 +02:00
Pascal Vizeli
82e5a38403 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-22 17:47:04 +02:00
Pascal Vizeli
44a528dee2 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-22 17:35:22 +02:00
Pascal Vizeli
a71a029262 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-22 09:29:03 +02:00
Pascal Vizeli
e53ecfb5d5 Update azure-pipelines-release.yml for Azure Pipelines (#26128)
* Update azure-pipelines-release.yml for Azure Pipelines

* Update azure-pipelines-release.yml
2019-08-22 09:14:38 +02:00
Paulus Schoutsen
23cf8414b8 Bumped version to 0.98.0b0 2019-08-21 16:20:08 -07:00
Paulus Schoutsen
c90e8ba7de Merge remote-tracking branch 'origin/master' into dev 2019-08-21 16:18:42 -07:00
Franck Nijhof
12f964ca57 Statistics sensors repect given name (#26119) 2019-08-21 15:54:04 -07:00
Paulus Schoutsen
f9e518d868 Fix tests leaving files behind (#26121) 2019-08-21 15:53:10 -07:00
Paulus Schoutsen
4a6f722b6d Updated frontend to 20190821.0 2019-08-21 15:16:34 -07:00
Jeff Irion
7090970436 Add descriptive fields to script config (#26056)
* Add descriptive fields to script config

* Add script descriptions to hass.data["service_description_cache"]

* Import SERVICE_DESCRIPTION_CACHE

* Register script descriptions via async_set_service_schema

* Add scripts test for loading and reloading service descriptions

* Minor cleanup

* Clean up script schema
2019-08-21 14:08:46 -07:00
Steven Rollason
9bcb48985b Template binary sensor attributes (#22664)
* Added attribute support to template binary sensor with tests

Added attribute support to template binary sensor with tests

* fix dictionary update

fix dictionary update

* Fixed whitespace and line length issues

* Fixed indentation

* Simplify applying of attribute templates based on feedback

* Syntax and whitespace fixes

* Black formatting

* Black formatting on tests

* Check attribute_templates is not None

* Fixed test

* Added test for failure to render template

* Test fix

* Updated test

* Removed whitespace and applied Black formatting

* Fixed test assertion

* Updated test

* Code improvements folloing comments

Using chain to iterate over templates and attribute_templates
Replacing dict() with {}
Rmoving unused constant

* Applied Black formatting

* Fixed removed code

* Default attribute_templates to empty dict

* Black formatting

* Fixed imports
2019-08-21 14:07:27 -07:00
Robert Svensson
588eac82c7 UniFi config entry options (#26113)
Introduce config entry options for Unifi integration
Allow configuration.yaml options to be imported to new options
2019-08-21 22:22:42 +02:00
Anders Melchiorsen
7ab36e0381 Update eternalegypt to 0.0.10 (#26117) 2019-08-21 20:54:20 +02:00
SukramJ
95f660f0b4 remove ATTR_ID for groups (#26114) 2019-08-21 10:58:34 -07:00
Sylvia van Os
ce54ae3171 Update PyEssent (#26115) 2019-08-21 10:58:03 -07:00
Ville Skyttä
9b1315d8e5 Check and fix test suite leaving files behind (#25981)
* azure: run check_dirty at end of tests

* Fix ps4 media player tests to not write to files

* .gitignore coverage.xml and test-results.xml
2019-08-21 19:50:26 +03:00
Ville Skyttä
e033e46161 Remove coveralls test dependency (#26110)
Outdated and unused.
2019-08-21 19:49:46 +03:00
Ville Skyttä
48e9e53f66 Upgrade pytest to 5.1.1 (#26112)
https://docs.pytest.org/en/latest/changelog.html#pytest-5-1-0-2019-08-15
https://docs.pytest.org/en/latest/changelog.html#pytest-5-1-1-2019-08-20
2019-08-21 19:49:25 +03:00
Ville Skyttä
8f044cf52f Upgrade pydocstyle to 4.0.1 (#26111)
https://github.com/PyCQA/pydocstyle/blob/4.0.1/docs/release_notes.rst#401---august-14th-2019
2019-08-21 19:48:46 +03:00
Josef Schlehofer
39d62b43ac Upgrade ruamel_yaml to 0.15.100 (#26095) 2019-08-21 09:13:40 -07:00
David F. Mulcahey
46bfd5e9c8 bump quirks (#26106) 2019-08-21 09:13:04 -07:00
croghostrider
08d797edba check if a light supports brightness (#26055)
Fix black

Fix black
2019-08-21 08:42:26 -07:00
Pascal Vizeli
cf505c65b4 Update azure-pipelines-release.yml for Azure Pipelines 2019-08-21 17:12:31 +02:00
SukramJ
f80c9c93ca Add support for warning attributes to Homematic IP Cloud (#26103)
* add supported optional features

* use recommendations
2019-08-21 16:31:55 +02:00
Gerard
38ce4039c3 Update bimmer_connected to 0.6.0 (#26098)
* Update bimmer_connected to 0.6.0

* Correct file properties
2019-08-21 09:11:06 +02:00
Paulus Schoutsen
2fbe01fb33 Updated frontend to 20190820.1 2019-08-20 16:20:38 -07:00
Alexei Chetroi
21a946009d Bump up zha dependencies. (#26097) 2019-08-20 16:06:38 -07:00
Rick van Hattem
000d3d4fde [bugfix] Exception if vendor's servers are currently unavailable (#26093) 2019-08-20 23:27:59 +02:00
Paulus Schoutsen
5c91a6cd48 Fix open-ui cli arg (#26091)
* Fix open-ui cli command

* Align add_job typing with async_add_job
2019-08-20 21:43:50 +02:00
Sander
f34b84a5cf add id to state attributes (#26086) 2019-08-20 10:59:01 -07:00
Ville Skyttä
4bce1efeee Test with 3.6.0 in Travis (#26039)
https://github.com/home-assistant/home-assistant/pull/26030#issuecomment-522298190
2019-08-20 10:55:40 -07:00
Joakim Sørensen
d96edea6e2 Remove the googlehome integration (#26035) 2019-08-20 10:54:54 -07:00
ahertz
7fd53ac912 Sonos playlists play media (#26054)
* Add handling for Sonos playlists in media_player.play_media

* Avoid breaking change by falling back to previous behavior

* Use the proper MEDIA_TYPE_PLAYLIST constant.

* Addressed comments, restricting media_type to music or playlist
2019-08-20 10:53:45 -07:00
Paulus Schoutsen
cf2d927f14 Use init_subclass for Config Entries (#26059)
* Use init_subclass for Config Entries

* Ignore type
2019-08-20 10:46:51 -07:00
David Bonnes
33c35a6c3c Bump geniushub client (#26084)
* bump geniushub client

* delint

* remove unsused lint hints
2019-08-20 10:43:39 -07:00
Pascal Vizeli
97d3f49bb8 Docker ADR (#26085)
* Migrate Docker image to Hass.io / Multiarch

* Fix sudo

* Update CODEOWNERS

* Fix manifest

* Add more logic

* fix handling

* Move dockerfile

* Modify options
2019-08-20 10:37:55 -07:00
legacycode
daa0330da4 Update pylacrosse library to version 0.4.0 (#26088)
* Updated pylacrosse library to version 0.4.0. Adding support for remote serial port.

* Generated new requirements_all.txt file.
2019-08-20 10:35:39 -07:00
Petr Vraník
0e4504296e Update pyrainbird to version 0.2.1 to fix zone number (#26064)
* Update pyrainbird to version 0.2.0 to fix zone number issue:

- home-assistant/home-assistant/issues/24519
- jbarrancos/pyrainbird/issues/5
- https://community.home-assistant.io/t/rainbird-zone-switches-5-8-dont-correspond/104705

* requirements_all.txt regenerated

* code formatting

* code formatting

* response checking

* fixed switch state

* pyrainbird version bump

* formatting

* version bump

* if instead elif
2019-08-20 18:26:15 +02:00
Paulus Schoutsen
a347a41d3c Add strings for traccar config flow (#26089)
* Add strings for traccar config flow

* Update strings.json
2019-08-20 09:19:00 -07:00
Pascal Vizeli
178d0d2099 Update devcontainer.json 2019-08-20 17:49:21 +02:00
Chris Thornton
c5ca431894 Add path option to SABnzbd component (#25908)
* Add path option to SABnzbd component

Adds an optional `path` setting to the SABnzbd component. This allows support for SABnzbd installs that use a different `url_base` (typically a reverse proxied configuration; see https://sabnzbd.org/wiki/configuration/2.3/special).

This change passes the `path` along to pysabnzbd as its `web_root`, which in turn uses the path to build up it's api URLs.

* Use dict.get for Sabnzbd web_root path config
2019-08-20 12:01:19 +02:00
Tomas Kislan
eee2b2d543 Add Minio component (#23567)
* Add minio implementation

* Static check changes

* Added docstrings

* Update docstrings

* Update docstrings

* Fix linter errors

* Finally fix all docstring errors

* Create services.yaml

* Update CODEOWNERS

* Final changes

* Remove double underscores

* Minor changes

* Update config.yml

* Review changes

* Added tests

* Fix lint errors

* Move tests from unittest to pytest

* Add minio as test requirement

* Update test_minio_helper.py

* Better event thread handling, added hass test

* Update tests

* Fixed lint errors

* Update test_minio.py

* Review changes

* More review changes

* Removed tests

* Applied code style changes

* Reformat test code
2019-08-20 11:56:11 +02:00
Paulus Schoutsen
93a800a612 Convert progress API to WS (#26082) 2019-08-20 00:17:52 -07:00
Paulus Schoutsen
1fe3b147fa Updated frontend to 20190820.0 2019-08-20 00:15:53 -07:00
Paulus Schoutsen
a1dbdbba6a Save config entry after updating system options (#26077) 2019-08-19 18:45:17 -05:00
Johann Kellerman
d1483b6f29 pysma library update 0.3.4 (#26075) 2019-08-19 18:44:19 -05:00
Robert Svensson
e41c002f70 Add config entry options support to deCONZ (#26049) 2019-08-19 14:42:21 -07:00
Johann Kellerman
b867e3314b SMA simplify config (#25880) 2019-08-19 22:10:35 +02:00
flebourse
45aec2ea40 huawei_lte: support out of range values in default sensor formatter (#26052)
* Update sensor.py

Change regexp to cope with out of range values, ie "rssi" : ">=-51dBm".

* Add tests for format_default

* Fix black formatting
2019-08-19 20:34:33 +03:00
Jonathan Keljo
a38bdc4deb Remove reference to typing.Deque (added in Python 3.6.1) (#26030)
* Remove reference to typing.Deque (added in Python 3.6.1)

* Silence mypy

* Type as collections.deque
2019-08-19 20:08:07 +03:00
Pascal Vizeli
1077ec1704 Add packages version to Tensoflow for wheels packages (#26068)
* Add packages version to Tensoflow for wheels packages

* Uncomment tensorflow

* fix string

* Revert version
2019-08-19 16:56:57 +02:00
Philipp Danner
75e18d4282 Add Keba charging station/wallbox as component (#24484)
* Add Keba charging station wallbox component

* Added start/stop commands (ena 0 and ena 1)

* added refresh_interval parameter and fixed authorization

* fixed max line length

* deactivate failsafe mode if not set in configuration

* extracted I/O code to pypi library

* updated services.yaml

* pinned version of requirements

* fixed typos, indent and comments

* simplified sensor generation, fixed unique_id and name of sensors

* cleaned up data extraction

* flake8 fixes

* added fast polling, fixed unique_id, code cleanup

* updated requirements

* fixed pylint

* integrated code styling suggestions

* fixed pylint

* code style changes according to suggestions and pylint fixes

* formatted with black

* clarefied variables

* Update homeassistant/components/keba/__init__.py

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

* Update homeassistant/components/keba/__init__.py

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

* Update homeassistant/components/keba/__init__.py

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

* Update homeassistant/components/keba/__init__.py

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

* fixed behaviour if no charging station was found

* fix pylint

* Update homeassistant/components/keba/__init__.py

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
2019-08-19 14:29:26 +02:00
Fredrik Erlandsson
15ab004e98 fix alarm webhooks (#26062) 2019-08-19 14:00:47 +02:00
Pascal Vizeli
6b80df9652 Bump nabucasa-cloud to 0.17 (#26066) 2019-08-19 12:15:41 +02:00
Pascal Vizeli
34f7bb5b8c Revert "Fix bmw_connected_drive and eq3btsmart components by updating their dependencies (#26012)" (#26065)
This reverts commit 9e5243929e.
2019-08-19 12:09:56 +02:00
Paulus Schoutsen
3463cc9cbd Make sure config flows extend ConfigFlow base class (#26051) 2019-08-18 11:36:23 -07:00
Robert Dunmire III
d4981a1143 Fix Mikrotik ARP ping (#25965)
* Reuse ssl_wraper

* Fix arp_ping

* Restore debug log

* Fix attributes
2019-08-18 17:14:54 +02:00
ThaSiouL
10d63e46d7 Fritz device tracker: set 'scanning' log to debug (#26043)
Changed the logging level for the polling of the fritz device tracker from info to debug.  The message was logged up to 6 times per minute and bloated the log file.
2019-08-18 18:08:26 +03:00
Sebastian Muszynski
2a39d1209c Add support of new Xiaomi Aqara Curtain models (#25942)
* Add support of new Xiaomi Aqara Curtain models (curtain.aq2, curtain.hagl04) (Closes: #25711)

* Fix requirements_all
2019-08-18 12:14:07 +03:00
Joakim Sørensen
ef8bc78c53 Remove the ruter integration (#26041) 2019-08-18 10:55:19 +02:00
Robert Svensson
a2589f56e1 Add system options to config entries (#25926)
* Add system options to config entries

* For feedback

* Follow most of balloobs comments

* Fix balloobs comments

* Improvements

* Fix second round of Balloobs comments

* Fix third round

* Add system options to mock config entry

* Fix integration tests

* Fix the last failing tests

* Fix disabled string

* Fix failing disabled_by tests

* New tests

* Config entry WS API tests

* Fix comments
2019-08-17 21:34:11 -07:00
michaeldavie
fc716a45c9 Updates to Environment Canada components (#25973)
* Bump env_canada to 0.0.21

* Add timestamp attribute to camera

* Bump env_canada to 0.0.23

* Clean up displayed values

* Validate radar station code

* Bump env_canada to 0.0.24

* Black

* Remove default "None" from sensor

* Switch to cv.matches_regex
2019-08-17 21:19:44 -07:00
Jay
6907e8e9dc Upgrade Dialogflow to work with V2 API (#25975)
* Handle v1 and v2 dialog api requests

* Stylistic changes
2019-08-17 21:19:13 -07:00
Jonathan Keljo
65aa4148a4 Upgrade sisyphus-control to 2.2.1 (#26033)
This picks up a bugfix for a crash on shutdown, so that the `sisyphus`
component can now shut down cleanly.
2019-08-17 21:16:13 -07:00
Ville Skyttä
4bcee4f7ce Run flake8 on pre-commit (#26028) 2019-08-17 21:15:55 -07:00
Jc2k
2bd832cd7a Skip homekit_controller polls when system is overloaded and still trying to process the previous one (#25968)
* Skip async_update if there are signs of backpressure

* Black

* Only warn once

* Log on recovery

* Formatting fix
2019-08-17 21:14:46 -07:00
Jonathan Keljo
8da1879599 Fix background crash in sisyphus integration (#26032)
I think I was thinking in another language, since this was not valid Python. Result was that the thread that maintained the SocketIO connection to the table would die early on, so no status updates were actually flowing from the table.
2019-08-17 21:32:01 -05:00
Fabian Affolter
88ff25b509 Update hole to 0.5.0 (#26022) 2019-08-17 21:28:46 -05:00
Ville Skyttä
fed789c770 Upgrade pre-commit to 1.18.2 (#26029)
https://github.com/pre-commit/pre-commit/blob/v1.18.2/CHANGELOG.md
2019-08-17 16:47:55 -06:00
Dima Zavin
6bf35232b9 Don't force a query to the main lutron repeater on update (#25939)
We only want to force a query if we don't have any previous state.
Otherwise, we should be tracking the state via continuous status
updates.

For lights (not switches) the extra query was also superfluous since
it was already querying on startup.

We should probably have a timeout on that so at some point we'll
requery in case remote end disconnected/rebooted, etc. Leaving for
another PR.
2019-08-17 23:50:15 +02:00
Ville Skyttä
9dff2e188b Tone down huawei_lte logging (#26020)
* Tone down huawei_lte logging

Refs https://github.com/home-assistant/home-assistant/pull/23809

* Fix import order
2019-08-17 21:50:41 +03:00
Oncleben31
ca74a23cf1 Fix unnecessary db entries for metro_france (#25957)
* fix #25911 avoid db unecessary entries

* use UTC timestamp for forecast

* simplify forecast timestamp
2019-08-17 11:47:28 +02:00
Fabian Affolter
c55241960c Upgrade voluptuous-serialize to 2.2.0 (#26008) 2019-08-17 11:40:50 +03:00
Paulus Schoutsen
eba6caf8a1 Entity registry api update disable (#26015)
* Clean up entity registry WS commands

* Allow updating disabled_by in entity registry

* Allow changing disabled_by via API

* Update tests/components/config/test_entity_registry.py

Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com>
2019-08-16 16:22:45 -07:00
Matthias Alphart
d4046cb6e4 Update KNX services.yaml (#26014)
Fixes wrong (outdated?) services.yaml for knx integration.
2019-08-17 01:22:12 +02:00
Paulus Schoutsen
8b66c11706 Fix config entry has options check (#25976)
* Fix config entry has options check

* Register webhook/discovery config flows with classes

* Fix types

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
2019-08-16 16:19:19 -07:00
Paulus Schoutsen
57ef721d5d Hue tweak registered device type + discovery exception (#25977)
* Include location name in create user

* Guard against no host in context

* Fix tests and typing
2019-08-16 16:19:00 -07:00
Paulus Schoutsen
6c292846be Allow entities to indicate they should be disabled by default (#26011) 2019-08-16 16:17:16 -07:00
Fabian Affolter
b5893a8a6e Upgrade beautifulsoup4 to 4.8.0 (#26006) 2019-08-16 16:16:46 -07:00
Fabian Affolter
2fdbb3b4df Upgrade pysnmp to 4.4.11 (#26010) 2019-08-16 16:16:04 -07:00
Fabian Affolter
b5061939c7 Upgrade luftdaten to 0.6.3 (#26009) 2019-08-16 16:15:44 -07:00
OliverRepo
9e5243929e Fix bmw_connected_drive and eq3btsmart components by updating their dependencies (#26012)
* Fix bmw_connected_drive by upgrading bimmer_connected module depencies

* Fix broken eq3btsmart by upgrading python-eq3bt module dependcies

* Run Development Checklist
2019-08-16 14:47:21 -07:00
Fabian Affolter
e21a677239 Upgrade pillow to 6.1.0 (#26005) 2019-08-16 13:49:28 -07:00
Fabian Affolter
b43ef6c0cf Upgrade pyyaml to 5.1.2 (#25994) 2019-08-16 13:48:44 -07:00
Fabian Affolter
2a2f7626de Upgrade voluptuous to 0.11.7 (#26007) 2019-08-16 21:31:28 +02:00
Robert Svensson
5ca6c990cf UniFi - add ap_mac to attributes (#26004) 2019-08-16 20:29:38 +02:00
Fabian Affolter
1be6a7b7ee Upgrade importlib-metadata to 0.19 (#26003) 2019-08-16 11:02:24 -07:00
Fabian Affolter
4c16531df5 Upgrade python-slugify to 3.0.3 (#25995) 2019-08-16 19:28:52 +03:00
Fabian Affolter
87f1a8ed0c Upgrade numpy to 1.17.0 (#25998) 2019-08-16 08:36:57 -07:00
Erik Montnemery
fad54cd6d8 Ensure sun conditions are using the right date (#23664)
* Ensure sun conditions are using the right date
2019-08-16 17:34:56 +02:00
Paulus Schoutsen
ce35f64d59 Guard against unavailable climate entities (#25978) 2019-08-16 16:17:43 +02:00
Fabian Affolter
715bb286c4 Upgrade shodan to 1.15.0 (#25990) 2019-08-16 16:17:02 +02:00
Fabian Affolter
74b6b8a9f6 Upgrade restrictedpython to 4.0 (#25993) 2019-08-16 16:16:42 +02:00
Fabian Affolter
3307b4421e Upgrade sqlalchemy to 1.3.7 (#25997) 2019-08-16 16:15:58 +02:00
Fabian Affolter
7fbdbb773c Upgrade pytz to >=2019.02 (#25991) 2019-08-16 16:15:12 +02:00
Fabian Affolter
1f28d8e742 Upgrade Mastodon.py to 1.4.6 (#25989) 2019-08-16 16:14:32 +02:00
Fabian Affolter
9b0e1a6620 Upgrade youtube_dl to 2019.08.13 (#25987) 2019-08-16 16:13:40 +02:00
Kareem Straker
8c419d7228 Update pyvera to 0.3.4 (#25986) 2019-08-16 16:13:02 +02:00
Paulus Schoutsen
23f26712f0 Fix ecobee preset and add climate mode back (#25970)
* Fix ecobee preset and add climate mode back

* Fix test
2019-08-16 10:29:25 +03:00
zhumuht
90d493a51a Add broadlink switch retry time option (#25873)
* add broadlink switch retry time in configuration

* add broadlink switch retry time in configuration

* formatted code by black tool

* Change retry default value to 2 to keep the current behavior
2019-08-16 10:26:11 +03:00
Anders Melchiorsen
26c99454a6 Add netgear_lte.disconnect_lte service (#25967) 2019-08-15 15:59:08 -07:00
Abílio Costa
a64dccc80b edp_redy: remove component (#25971)
The service has moved to a new portal and the previous API does not work
anymore.
2019-08-15 15:53:12 -07:00
Keith Pine
1bfe752dfa Remove zwave.update_config service call (#25959)
The python-openzwave API which provides the implementation of the config update
does not actually work in the homeassistant fork. To avoid confusion, remove
the service call for now.
2019-08-15 14:22:13 -07:00
Paulus Schoutsen
8a1ab8c0b5 Tweaks to options flow (#25969) 2019-08-15 14:11:55 -07:00
Paulus Schoutsen
9b3aa9bbd1 Remove uvloop from default install and warn about stream+shell_command (#25929)
* Add warning about uvloop and shell_command

* Remove uvloop from docker files"

* Add ffmpeg
2019-08-15 14:11:39 -07:00
Paulus Schoutsen
6d1d95394c Updated frontend to 20190815.0 2019-08-15 14:04:17 -07:00
Paulus Schoutsen
df3fbc5715 Update translations 2019-08-15 14:04:03 -07:00
Ville Skyttä
aa508b5106 Complete some incomplete type hints in helpers (#25953) 2019-08-15 08:53:25 -07:00
Alex Fung
3525728abc Fix Tile Errors (#25866)
* Fix Tile Errors

* Black formatting
2019-08-15 06:52:38 -06:00
zewelor
53ad33e84a Add volumio shuffle support (#25871)
* Add volumio shuffle support

* Black reformat

* Update homeassistant/components/volumio/media_player.py

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
2019-08-15 07:41:54 -04:00
Andrew Chatham
944ac4f3c2 Expose Lutron RA2 occupancy sensors (#25854)
* Expose Lutron RA2 motion sensors

* Remove unused _LOGGER

* Remove unused logging import
2019-08-15 07:40:39 -04:00
Aaron Bach
b8bd97b3fa Bump aioambient to 0.3.2 (#25956) 2019-08-15 03:56:53 +02:00
Aaron Bach
a71e8851ae Bump simplisafe-python to 4.3.0 (#25955) 2019-08-14 18:03:11 -06:00
Anders Melchiorsen
cbcf49a3ba Improve Sonos error handling on slow networks (#25902) 2019-08-14 09:17:58 -07:00
Phil Bruckner
bd8461b899 Handle more Life360 errors in config flow & bump package to 4.1.1 (#25930) 2019-08-14 09:15:37 -07:00
Jc2k
002f74c76b Update homekit_controller import style (#25940) 2019-08-14 09:14:15 -07:00
Ville Skyttä
d8e2518e0d Use canonical pre-commit black URL (#25948) 2019-08-14 09:13:24 -07:00
Jeff Irion
3b8668b2df Bump androidtv to 0.0.23 (#25950)
* Bump androidtv to 0.0.23

* Bump androidtv to 0.0.23

* Add missing space in logging statement
2019-08-14 09:12:32 -07:00
Twan Coenraad
76b781829e Add OTGW domestic hot water enable option as service (#25849) 2019-08-14 15:35:05 +02:00
Malte Franken
45bbd080f1 Bump version of library aio_geojson_geonetnz_quakes to v0.9 (#25946) 2019-08-14 15:32:18 +02:00
Niels Mündler
dc62671575 Update syncthru library to fix issue (#25924) 2019-08-13 12:09:07 -07:00
Diogo Gomes
1f2bab8e67 Fix Filter Sensor - check existing entity history (#25870)
* make sure we have entity history

* increase coverage

* increase coverage

* no need for list comprehension

* increase coverage
2019-08-13 11:07:05 -07:00
Teemu R
e0ea5f2b04 eq3bt: handle zero (closed valve) as a valid mode. fixes #25333 (#25905) 2019-08-13 10:25:27 +02:00
Jc2k
34cde21876 Fix for HomeKit controller state not updating after put (#25903) 2019-08-13 10:09:55 +02:00
Alexei Chetroi
61b687edec Bump ZHA dependencies. (#25898) 2019-08-12 18:34:16 -04:00
Paulus Schoutsen
172bbf806d Add reproduce state support to input_boolean (#25858)
* Add reproduce state support to input_boolean

* Catch unknown state
2019-08-12 16:45:04 +02:00
Paulus Schoutsen
6f357cb23e First pass fixing tests that raise exceptions caught by asyncio.gather (#25860)
* First pass fixing tests that raise exceptions caught by asyncio.gather

* Fix demo test

* lint
2019-08-12 16:42:12 +02:00
Pascal Vizeli
76f2e6015f Update devcontainer.json 2019-08-12 11:15:39 +02:00
Paulus Schoutsen
c58f3a4b4a Merge pull request #25884 from home-assistant/rc
0.97.2
2019-08-11 21:58:28 -07:00
Paulus Schoutsen
b38c40fb98 Updated frontend to 20190811.0 2019-08-11 21:17:32 -07:00
ejaviga
5f0334d208 Tado AIR_CONDITIONING module was not working propertly (#25677)
* Tado AIR_CONDITIONING module was not working propertly

AIR_CONDITIONING modules differs from HEATING module int he parameters.

* Tado Cooling Sensor was not read proprtly

* TADO correct file permissions

* Tado: Fix compilation error

* Fix Lint errors

* Fix Black formatting

* TADO More AC functionality

Also Black formatting

* Tado Fix Lint

* Tado Fix Lint II
2019-08-11 21:02:16 -07:00
Paulus Schoutsen
38c67389b2 Bumped version to 0.97.2 2019-08-11 20:49:31 -07:00
Pascal Vizeli
38412fd880 Fix issue with nuki new available state (#25881) 2019-08-11 20:49:22 -07:00
Robert Svensson
f03538f866 UniFi - Use state to know if device is online (#25876) 2019-08-11 20:49:21 -07:00
Andrew Sayre
a061310e78 Always populate hvac_modes in SmartThings climate platform (#25859)
* Always return list for hvac_modes

* Use climate constants
2019-08-11 20:49:20 -07:00
tombbo
0c815ea843 Fix KNX Climate mode change callback (#25851)
- fix KNX Climate not updating UI after receiving mode change telegram
  from KNX bus
2019-08-11 20:49:20 -07:00
cgtobi
9afb6c3876 Fix Netatmo climate issue (#25830)
* Bump pyatmo to v2.2.1

* Fix issue 25778
2019-08-11 20:49:19 -07:00
Brandon Davidson
0eb93db67e Update pyvera to 0.3.3 (#25820)
Fixes #24987
2019-08-11 20:49:18 -07:00
Cameron Morris
48e42d8595 Fix eco preset for Wink Air Conditioner (#25763)
* Add preset support for device
* Provide mappings between preset changes
2019-08-11 20:49:18 -07:00
Pascal Vizeli
af70b6da20 Fix issue with nuki new available state (#25881) 2019-08-11 20:48:56 -07:00
Paulus Schoutsen
87119472a3 Update translations 2019-08-11 20:42:50 -07:00
Quentame
ec2ce31204 Fix script/translations_develop launch + clean some unused error i18n (#25459)
* Fix : script/translations_develop launch + clean some unused error i18n

* Respecting strings.json order property

title
step
error
abort

* Review from @fredrike : remove Telldus Live all_configured
2019-08-11 20:40:18 -07:00
Ville Skyttä
b738082dad Type check various base components (#25878)
* Type check various component base classes, disabling bunch of checks for now

* Type hint fixes

* Help mypy out some

* Add more type hints
2019-08-11 20:38:18 -07:00
Paulus Schoutsen
cf90e49b50 Make reproduce state use platform instead of rely on function (#25856)
* Make reproduce state use platform instead of rely on function

* Fix types

* address comment Martin.
2019-08-11 20:03:21 -07:00
Robert Svensson
ab7db5fbd0 UniFi - Use state to know if device is online (#25876) 2019-08-11 22:40:44 +02:00
Andrew Sayre
b8460bb331 Always populate hvac_modes in SmartThings climate platform (#25859)
* Always return list for hvac_modes

* Use climate constants
2019-08-11 06:47:36 +02:00
Johann Kellerman
8b9d0593b1 Allow components with empty list config (i.e. person) in packages (#25827)
* Fix #23424

* mypy Lists
2019-08-10 16:30:33 -07:00
Antonio Pérez
ce0edf8360 Fix configuration field name (#25840) 2019-08-10 15:01:19 -07:00
Oncleben31
3648db7214 Add pip-wheel-metadata in .gitignore (#25832)
When developing in a container with VSC, the folder `pip-wheel-metadata` is created during the container building process.
2019-08-10 14:55:58 -07:00
MatsNl
a6f1773492 Update sensor.py (#25825)
exclude "unknown" values from measurements
2019-08-10 14:45:47 -07:00
Jeff Irion
68ee828674 Move Kodi services from 'media_player' domain to 'kodi' (#25753)
* Create const.py

* Register services to 'kodi' domain, not 'media_player'

* Add const.py to .coveragerc

* 'DATA_KODI' -> 'DOMAIN'

* Move the Kodi services descriptions to the Kodi component

* Register Kodi services in __init__.py

* Finish registering Kodi services in __init__.py

* Remove logging statement intended only for testing

* Combine homeassistant.const imports

* Add __init__.py to .coveragerc
2019-08-10 14:31:04 -07:00
Jeff Irion
ff92307d65 Bump androidtv to 0.0.22 (#25848) 2019-08-10 15:25:03 -05:00
tombbo
9041201c76 Fix KNX Climate mode change callback (#25851)
- fix KNX Climate not updating UI after receiving mode change telegram
  from KNX bus
2019-08-10 15:24:03 -05:00
Thomas Lovén
e7e083c547 Websocket call for rendering jinja2 templates subscription (#25614)
* Websocket call for rendering jinja2 templates

* Address review comments

* Address review comments

* Allow MATCH_ALL, but ignore it.

* Always register unsub method.
2019-08-10 12:46:49 -07:00
cgtobi
d89e8ead61 Fix Netatmo climate issue (#25830)
* Bump pyatmo to v2.2.1

* Fix issue 25778
2019-08-10 15:49:29 +02:00
Per Osbäck
e9705af055 Prometheus metrics naming based on device_class and unit_of_measurement (#24103)
* - Change how we extract the metrics for sensors
- Add component filtering as seen in influxdb
- Add metric override as seen in influxdb
- Add more unit tests with actual device data

* Extract sensor metric logic to separate handlers

* Update prometheus dependency

* Format using black

* Format using black

* Fix flake8

* Move sensor metric handler list to init

* Use f strings instead of .format
2019-08-10 14:35:04 +02:00
Robert Dunmire III
2e4905981e Fix device re-connect when API connection lost (#25842) 2019-08-10 13:53:20 +02:00
Malte Franken
9e6732e530 GeoNet NZ Quakes feed integration (#25736)
* initial working version

* support configured unit system and convert distance automatically

* properly unloading integration when removed and stopping refreshes

* ran isort

* fixed pylint

* introduced time filter of seven days into past

* adding unit tests

* fixed lint

* removed unused code

* added test case

* added test case for config flow

* fixed lint

* fixed comment

* removed unused test code

* increased test coverage

* fixed filtering by time

* changed wording in config flow

* reformatted with black

* removed unused logger

* fixed black

* changed default mmi

* reduced the options in the config flow form; fixed a few schema options and processing of data

* moved unsubscribing signals

* fixed minimum magnitude and modified tests

* fixed radius in imperial unit system

* increased test coverage

* simplified code

* fixed lint

* changed string formatting; simplified code

* removed unused strings

* added translation
2019-08-10 12:50:27 +02:00
Pascal Vizeli
e685f077ae Update Dockerfile 2019-08-10 12:27:32 +02:00
Pascal Vizeli
12f4076f70 Update Dockerfile 2019-08-10 12:15:36 +02:00
Cameron Morris
f30e54f01e Fix eco preset for Wink Air Conditioner (#25763)
* Add preset support for device
* Provide mappings between preset changes
2019-08-09 17:05:05 -07:00
Tomi Lehto
b79f1336be Fix 64-bit modbus sensor register reads (#25672)
* Fix 64-bit modbus sensor register reads

When reading four 16-bit modbus registers as a sensor value,
slave output is stored first as 64-bit integer, but before returning
that value is converted to double precision floating point. This
causes rounding errors for integer values bigger than 2^53.

After this change floating point conversion is done only if user
has configured scaling or offset using floating points.

* Formatting

* Review fixes
2019-08-09 17:03:12 -07:00
David F. Mulcahey
fafd228418 Refactor ZHA device initialized logic (#25796)
* refactor device initialized
* better names and update tests
* clean up last seen logic
* logging consistency
2019-08-09 18:52:47 -04:00
escoand
dc5c1783dc Webhook for Traccar (#24762)
* add initial traccar webhook support

* remove unused import

* add tests but disabled atm

* remove translations

* add timestamp parameter

* use post for tests

* rename config_flow

* format using black

* format tests using black

* Use str instead of float

* fix most comments

* check id

* add two device test

* reformat

* fix failuers

* Update tests/components/traccar/test_init.py

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

* Update tests/components/traccar/test_init.py

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

* Update tests/components/traccar/test_init.py

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

* Update tests/components/traccar/test_init.py

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

* black
2019-08-10 00:14:03 +02:00
Thomas Lovén
60dfa38717 Add error handling to !include command in yaml (#25801)
* Catch errors if !include file is not found

* Address review comments

* Add line number to error message
2019-08-09 13:21:08 -07:00
Brandon Davidson
f58106c7b7 Update pyvera to 0.3.3 (#25820)
Fixes #24987
2019-08-09 13:20:26 -07:00
Paulus Schoutsen
7cbb818dc3 Merge pull request #25819 from home-assistant/rc
0.97.1
2019-08-09 13:17:39 -07:00
Santobert
77d984e980 Add script to install locale (#25791) 2019-08-09 13:17:12 -07:00
Santobert
a66814c772 Add script to install locale (#25791) 2019-08-09 21:08:35 +02:00
Andrew Sayre
e57ecc9d7d Fix brightness type (#25818) 2019-08-09 11:42:09 -07:00
Andrew Sayre
6909235d8a Fix brightness type (#25818) 2019-08-09 11:41:50 -07:00
Paulus Schoutsen
e1fee1bd45 Bumped version to 0.97.1 2019-08-09 11:17:31 -07:00
Nikolay Vasilchuk
20e279a7ac Fix deconz allow_clip_sensor and allow_deconz_groups options (#25811) 2019-08-09 11:17:24 -07:00
jjlawren
34b5083c27 Don't track unstable attributes (#25787) 2019-08-09 11:17:23 -07:00
Finbarr Brady
ebf8d5fc66 Update Cisco Mobility Express module version (#25770)
* Update manifest.json

* Update requirements_all.txt
2019-08-09 11:17:22 -07:00
Dustin Essington
e355012229 Update HIBP sensor to use API v3 and API Key (#25699)
* Update HIBP sensor to use API v3 and API Key

* ran black code formatter

* fixed stray , that was invalid in multiple json formatters
2019-08-09 11:17:21 -07:00
Tomi Lehto
5b516fc0cd Add arcus trigonometry functions to templates (#25510) 2019-08-09 11:16:47 -07:00
Dustin Essington
a0494e44eb Update HIBP sensor to use API v3 and API Key (#25699)
* Update HIBP sensor to use API v3 and API Key

* ran black code formatter

* fixed stray , that was invalid in multiple json formatters
2019-08-09 10:54:33 -07:00
Nikolay Vasilchuk
8b6ddc22a5 Fix deconz allow_clip_sensor and allow_deconz_groups options (#25811) 2019-08-09 19:31:58 +02:00
miroslawkrol
ecddeb2dd1 Fix Broadlink MP1 unavailable error (#25806) 2019-08-09 18:21:18 +03:00
Franck Nijhof
e47ed0e182 Deprecates linksys_ap integration (ADR-0004) (#25804) 2019-08-09 16:47:08 +02:00
Finbarr Brady
4349b8640e Update Cisco Mobility Express module version (#25770)
* Update manifest.json

* Update requirements_all.txt
2019-08-08 22:59:33 +02:00
jjlawren
8f2f770837 Don't track unstable attributes (#25787) 2019-08-08 14:43:53 -05:00
Robert Dunmire III
4bcef25486 Add Mikrotik hub and rework device tracker (#25664)
* Add const.py for Mikrotik hub

* Add Mikrotik hub component

* Rework device tracker to use hub

* Fix validation errors

* Fix line spacing

* Bump librouteros version to 2.3.0

* Bump librouteros version to 2.3.0

* Used black code formatter

* Fix validation errors

* Fix errors

* Fix errors

* Renamed MikrotikAPI to MikrotikClient

* Fix method

* Fix device_tracker and rename ssl to use_ssl

* Moved device tracker functions into device tracker

* Fix missing constants

* Fix device tracker host_name

* Fix errors

* Fix device tracker typo

* Adding device tracker attributes

* Change attributes order

* Change attributes order

* Add one more attribute

* Reformat black

* Exclude Mikrotik modules

* Remove async calls

* Remove unused import

* Adding scan interval to device tracker

* Fix errors and update code

* Fix error

* Fix missing period

* Update device tracker to use setup_scanner

* Fix hass.data HOSTS

* Fix errors

* Fix errors

* Fixes and updates

* Fixing and reworking

* Fixes

* Fix constant INFO

* get_hostname fix and return value
2019-08-08 13:58:13 +02:00
Pascal Vizeli
0fa1e3ac92 Update azure-pipelines-release.yml 2019-08-08 11:32:52 +02:00
Joakim Plate
d1b9ebc7b2 Integration requirement check refactor (#25626)
* Factor out code getting requirements for integration

* Have process requirements raise an exception

* One more lint fix

* Blackify

* Catch new exception

* Let RequirementsNotFound be a HomeAssistantError

* Correct another test

* Split catching of exceptions and avoid complete log
2019-08-07 15:35:50 -07:00
Santobert
c3455efc11 Updater component is always available and shows on/off depending on whether an update is available or not (#25418)
* Updater Component is always available and shows on/off wether an update is available

* Use == instead of is to compare strings

* Edit log message  when local version is newer

* One more commit to trigger CI

* Add binary sensor

* Remove ATTR

* Use dispatcher

* Use callback instead of async

* Make flake happy

* Fix callback

* discover binary sensor

* flake

* Fix discovery

* prepared tests, TODO

* Fix tests

* Test release notes

* Add one more test

* Add another test

* Add docstring

* Revert "Add another test"

This reverts commit 3f896a4e3b.

* Remove unused file

* Update docstrings

* mock time

* Test renaming entity

* Add test_rename_entity

* Improve test_rename_entity
2019-08-07 15:28:22 -07:00
Pascal Vizeli
1739f50b59 Update azure-pipelines-wheels.yml for Azure Pipelines 2019-08-07 21:58:11 +02:00
Franck Nijhof
07499faa9c Deprecates srp_energy integration (ADR-0004) (#25754) 2019-08-07 21:41:44 +02:00
Paulus Schoutsen
dffdbda8e2 Merge pull request #25756 from home-assistant/rc
0.97.0
2019-08-07 11:23:42 -07:00
Paulus Schoutsen
a20c631410 Update requirements 2019-08-07 10:35:24 -07:00
Paulus Schoutsen
0f8f4f4b54 Bumped version to 0.97.0 2019-08-07 09:25:10 -07:00
Robert Svensson
609118d3ac Fix last seen not available on certain devices (#25735) 2019-08-07 09:23:24 -07:00
Paulus Schoutsen
52de2f4ffb Revert emulated hue changes (#25732) 2019-08-07 09:23:23 -07:00
David Bonnes
a1302a9dfb initial commit (#25731) 2019-08-07 09:23:23 -07:00
Tsvi Mostovicz
3a78250cad Bump hdate==0.9.0 (use pytz instead of dateutil) (#25726)
Use new hdate version of library which uses pytz for timezones.
dateutil expects /usr/share/timezone files, as these are not available
in the docker image and in HASSIO, the timezone offsets are broken.

This should fix
 - #23032
 - #18731
2019-08-07 09:23:22 -07:00
Franck Nijhof
84f464d089 Deprecates fedex integration (ADR-0004) (#25745) 2019-08-07 15:26:43 +02:00
Franck Nijhof
b696f9ce5e Deprecates ups integration (ADR-0004) (#25746) 2019-08-07 13:41:35 +02:00
Franck Nijhof
d3aac13065 Deprecates sytadin integration (ADR-0004) (#25742) 2019-08-07 13:40:47 +02:00
Franck Nijhof
2b6674b27f Deprecates usps integration (ADR-0004) (#25743) 2019-08-07 13:40:30 +02:00
Alexei Chetroi
c3c45f8198 Manufacturer specific channel for SmartThings. (#25739)
* Manufacturer specific channel for SmartThings.
* Lint.
2019-08-06 20:59:18 -04:00
Erik Montnemery
e0be4efe3e Add test case to identify missing MQTT configuration abbreviations (#25616)
* Add missing abbreviations

* Move abbreviations to own file, add script to find missing abbreviations

* Move check from script to test case

* Lint

* Rewrite to use pathlib

* Lint
2019-08-06 17:32:15 -07:00
eyager1
506350da11 Implement "Aux Heat" support for Zwave Climate (#25694)
* Remove "Aux Heat" from Zwave climate mappings

* Implement Aux Heat support for zwave climate

* Pylint fix.

* Pylint fix 2nd try
2019-08-06 17:24:17 -07:00
Alexei Chetroi
152a9eb466 Use more decorators for ZHA Core registries. (#25737)
* Move ZIGBEE_CHANNEL_REGISTRY to ZHA core registries.
* Refactor more ZHA Core registries to use decorator.
* Cleanup.
* Use relative imports for component.
* Flake8.
* Make pylint happy again.
2019-08-06 20:01:14 -04:00
Ross Dargan
98eb8efc6b Add ring light platform (#25733)
* Add support for turning a flood light on and off

* changes following black

* update following code review, and test fix

* fix naming
2019-08-06 14:55:54 -07:00
Robert Svensson
c76531a366 Fix last seen not available on certain devices (#25735) 2019-08-06 14:55:36 -07:00
Paulus Schoutsen
e24d3f15fd Revert emulated hue changes (#25732) 2019-08-06 13:46:07 -05:00
Tsvi Mostovicz
54d6acf87a Bump hdate==0.9.0 (use pytz instead of dateutil) (#25726)
Use new hdate version of library which uses pytz for timezones.
dateutil expects /usr/share/timezone files, as these are not available
in the docker image and in HASSIO, the timezone offsets are broken.

This should fix
 - #23032
 - #18731
2019-08-06 11:03:52 -05:00
David Bonnes
a76bb5e82c initial commit (#25731) 2019-08-06 11:03:08 -05:00
Paulus Schoutsen
778cd7da32 Updated frontend to 20190805.0 2019-08-06 08:54:28 -07:00
Ross Dargan
9e8df936ac Add ring switch platform (#25612)
* Add in a switch platform to ring.

* Changes following code review

* remove tests for now

* remove the request to call update

* support the new type of test

* update after running black

* fix comment

* fixes following code review

* Remove ring cache file

* patch out io code

* Move the patches to within a fixture

* missing period
2019-08-06 14:39:07 +02:00
Robert Svensson
7ff7c7b9f5 UniFi - handle device not having a name (#25713)
* Handle device not having a name
2019-08-06 07:00:06 +02:00
Sébastien RAMAGE
5b02555255 Add zigate support to zha (#25552)
* Add zigpy-zigate support
* update requirements
* fix
* update
* fix flake8
* update requirements
* fix
* update
* add test to make codecov happy
* fix flake8
* Try to add test
* add test
* remove unneeded test
* exclude registries.py from coverage
exclude homeassistant/components/zha/core/registries.py  since untestable

* Fix merge: black formatting and flake8.
2019-08-05 18:05:07 -04:00
Alexei Chetroi
8dbac9176e Refactor ZHA Zigbee channel registry. (#25716)
* Update test to catch regression.

* Refactor ZHA Core channels.

Use channel decorator for Zigbee channel registry.

* Update tests.

* Pylint
2019-08-05 15:40:29 -06:00
Jesse Rizzo
8241193fa8 Bump envoy_reader to 0.8.6, fix missing dependency (#25679)
* Bump envoy_reader to 0.8.6, fix missing dependency

* Bump envoy_reader to 0.8.6, fix missing dependency
2019-08-05 23:15:42 +02:00
Paulus Schoutsen
7a90808e52 Add service to reload scenes from configuration.yaml (#25680)
* Allow reloading scenes

* Update requirements

* address comments

* fix typing

* fix tests

* Update homeassistant/components/homeassistant/scene.py

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

* Address comments
2019-08-05 23:04:19 +02:00
Jeff Irion
0449132c35 Bump androidtv to 0.0.21; add 'state_detection_rules' config parameter (#25647)
* Bump androidtv to 0.0.19; add 'state_detection_rules' config parameter

* Bump androidtv to 0.0.20

* Add detailed config check for 'state_detection_rules'

* Linting

* Remove unused variable

* Bump androidtv to 0.0.21, move config validation into backend package

* dict() -> {}

Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
2019-08-05 18:58:41 +02:00
David F. Mulcahey
b073d87e08 stagger device init to avoid flooding network (#25709) 2019-08-05 10:14:19 -04:00
David F. Mulcahey
20b54c22f7 don't mark devices unavailable without ping try (#25710) 2019-08-05 09:50:48 -04:00
David F. Mulcahey
ac5fcff1cd fix unique id in cluster channels (#25707) 2019-08-05 08:47:42 -04:00
jaminh
5e00b546eb Zwave Climate: Fan state attribute missing (#25287) (#25573)
Add fan state back in to device state attributes
Change fan state to fan action
2019-08-05 12:25:48 +02:00
Pascal Vizeli
cecfb2d657 Update azure-pipelines-wheels.yml for Azure Pipelines 2019-08-05 08:54:44 +02:00
Paulus Schoutsen
57f84cbbaa Update HTTP defaults (#25702)
* Update HTTP defaults

* Fix tests
2019-08-05 08:24:54 +02:00
Paulus Schoutsen
6b511789d6 Updated frontend to 20190804.0 2019-08-04 22:30:31 -07:00
ktnrg45
069c1863eb PS4 Merge async_setup_platform into async_setup_entry (#25689)
* Merge async_setup_platform into async_setup_entry

* Pass async_setup_platform

* blank line

* add test setup platform

* white space
2019-08-04 22:01:40 -06:00
Charles Garwood
0a87a4bfda Add usb_path to Z-Wave network_status websocket response (#25617)
* Add usb stick path to zwave network_status websocket response

* Move to separate websocket command

* Return additional config options

* add tests
2019-08-04 17:21:37 -06:00
Jeff Irion
70dfe42adb Make myself the codeowner for androidtv (#25697) 2019-08-05 01:03:37 +02:00
Alexei Chetroi
f7cfe908f7 Refactor ZHA Zigbee Cluster report configuration (#25589)
* Move ZCL report configs to ZHA core channels.

* Refactor ZCL report configuratopm and cluster binding.

* Tests for ZHA channel configuration.

* Update tests.

* Remove INPUT_BIND_ONLY_CLUSTER ZHA core registry.

We always need bind a cluster, but not always need to configure
attribute reporting. No reporting is done on ZCL "client" clusters.

* Lint

* Black
2019-08-04 18:20:03 -04:00
Pascal Vizeli
03aec33f9e Fix roku lxml requirement (#25696) 2019-08-05 00:13:27 +02:00
Aaron Bach
3839eb0197 Fix issue with incorrect Notion bridge IDs (#25683)
* Fix issue with incorrect Notion bridge IDs

* Less aggressive

* Member comments
2019-08-05 00:11:28 +02:00
David Bonnes
b0c79c271d Bump geniushub client, handle dead devices, handle raise_for_status (#25687)
* Initial commit

* tweak error logging

* bump client

* correct regression

* small coding tweak

* debug logging to one entry

* refactor for self.data['attr']

* bump client

* small tidy-up
2019-08-05 00:06:36 +02:00
Tom
0d95ad3857 Plugwise haanna 0.10.1 (#25693)
* Update module dependency (py3.6 fix)

* Update module dependency (py3.6 fix) - update requirements
2019-08-04 19:17:30 +02:00
Ville Skyttä
49a5dda7a8 Upgrade pydocstyle to 4.0.0, do not run in tox (#25667)
* Upgrade pydocstyle to 4.0.0 and flake8-docstrings to 1.3.1

http://www.pydocstyle.org/en/4.0.0/release_notes.html#july-6th-2019

* Address pydocstyle D413's

* tox: do not run pydocstyle

Does not seem to add any value over flake8-docstrings (and would have
needed a D202 exclusion).
2019-08-04 17:05:43 +02:00
Pascal Vizeli
c748d8c0bd Merge branch 'dev' of https://github.com/home-assistant/home-assistant into dev 2019-08-04 17:04:32 +02:00
Pascal Vizeli
739e8ffee8 Add schedules to yml 2019-08-04 17:04:29 +02:00
Robert Svensson
576291779e UniFi - reverse connectivity logic (#25691)
* Make connectivity control in line with other implementations
2019-08-04 16:57:36 +02:00
Robert Svensson
5a90b49e27 In some circumstances device.last_seen can be None (#25690) 2019-08-04 16:12:16 +02:00
Pascal Vizeli
f8bd9dbe3e Azure ci templates (#25688)
* Use templates for Azure-CI steps

* Migrate ci

* fix endpoint
2019-08-04 14:32:35 +02:00
SukramJ
73f5575708 Add PRESET_AWAY to HomematicIP Cloud climate (#25641)
* enable climate away_mode and home.refresh

* Add Party eco modes
2019-08-03 18:49:34 +02:00
Robert Svensson
93dfd613aa Options to not track wired clients (#25669) 2019-08-02 23:51:06 +02:00
Ville Skyttä
a54ade1189 Spelling fixes (#25666) 2019-08-02 23:20:06 +02:00
Anders Melchiorsen
2f7c57b257 Revert flux_led to 0.89 (#25653)
* Revert Black

* Revert "Introduce support for color temperature (#25503)"

This reverts commit e1d884a484.

* Revert "Fix flux_led only-white controllers (#22210)"

This reverts commit 48138189b3.

* Revert "Fix MagicHome LEDs with flux_led component (#20733)"

This reverts commit 1444a684e0.

* Re-Black

* Use mode detection for scanned bulbs
2019-08-02 17:00:22 +02:00
Ville Skyttä
a2f9a5287d Azure mypy related tweaks (#25663)
* Revert "Add some debugging to azure mypy job (#25632)"

This reverts commit 767b8e9f25.

No longer needed.

* Install setup.py dependencies for mypy in Azure

For better coverage, and to match what tox does.
2019-08-02 16:59:47 +02:00
Alexei Chetroi
0c561aec4f isort ZHA imports. (#25660) 2019-08-02 10:37:21 -04:00
johnnychicago
10adae4b3b Add ELECTRICITY_IMPORTED_TOTAL obis to dsmr (#25655) 2019-08-02 14:07:33 +02:00
Alexei Chetroi
77e4ff94fd ZHA code cleanup. (#25644)
* isort ZHA imports.

* Sort zha channel registry.

* Sort ZHA core registry.

* Sort ZHA core consts.
2019-08-02 06:05:23 -04:00
Robert Svensson
39257164a9 UniFi - allow configuration to not track clients or devices (#25642)
* Allow configuration to not track clients or devices
2019-08-02 10:13:00 +02:00
Santobert
944cd70753 Feature zwave preset modes (#25537)
* Initial commit

* Add some more code

* Local tests passing

* Remove unnecessary line

* Add preset attributes to __init__

* Remove some more debugger lines

* Add some tests

* Fix comparision to None

* Improve test coverage

* Use unknown modes as presets

* Bugfixes and test improvements

* Add tests for unknown preset modes

* linting

* Improve mappings

* Move PRESET_MANUFACTURER_SPECIFIC to zwave

* Replace isinstance with cast

* Add test for hvac_action

* hvac_mode is never None

* Improved mapping of current mode to hvac/preset modes

* Fix bugs where hvac_mode is None

* Add default hvac mode

* Fixed default hvac mode

* Fix linting

* Make flake happy

* Another linting

* Make black happy

* Complete list of default hvac modes

* Add mapping to heat/cool eco

* Fixed another bug where mapping goes wrong
2019-08-02 10:00:33 +02:00
Maikel Punie
7ee3dd137b Fix velbus codeowner (#25649) 2019-08-02 09:49:24 +02:00
SukramJ
8a57255796 Add HmIP-SCI to Homematic IP Cloud, Fix HmIP-SWDM (#25639)
* Add HmIP-SCI to Homematic IP Cloud

* Bump upstream dependency

* Fix HmIP-SWDM
2019-08-01 18:43:08 -05:00
Paulus Schoutsen
b5e296238f Add preset to be away and eco (#25643) 2019-08-01 18:32:43 -05:00
Paulus Schoutsen
f4fce8fcc3 Updated frontend to 20190801.0 2019-08-01 13:34:28 -07:00
Tom
9f3e388b04 Add Plugwise component (#25533)
* Added Plugwise component

* pylint fixes

* Additional pylints (local tox not noticing these)

* Changes according to review

* CI flake8 correction

* Applying Black

* Review changes, without exception and schema

* Review changes, exception improvement

* Review changes, exception correctio and schema cleanup

* Further cleaning as per review

* Removed blank line

* Add debugging to API init

* Add debugging to API init without dot
2019-08-01 22:22:57 +02:00
Niels Mündler
87bc2134ad Add each fronius sensor as own template (#25608)
* Fix formatting in history test

* Add each sensor as own template

* Make adapters non-entities

* Externalize and organize data fetching, improve system view

* Small fixes

Rename fetching adapters to adapters
throw away non-working system overviews
slightly change naming
remove scan_interval from schema
formatting

* Scan interval is already timedelta and unnecessary return

* Formatting

* Ensure better codestyle by storing cell variables explicitely in different places
2019-08-01 22:18:52 +02:00
Paulus Schoutsen
35400b0db1 Upgrade hass-nabucasa to 0.16 (#25636) 2019-08-01 13:03:45 -07:00
Martin Eberhardt
c3cdd3e7d2 Fix handling of empty results from Rejseplanen (#25610)
* Improve handling of empty results from Rejseplanen (Fixes #25566)

* Exclude attributes with null value

* Add period back into docstring

* Fix formatting
2019-08-01 22:02:11 +02:00
Oncleben31
f7a47c6cab Meteofrance improve log error messages (#25630)
* Improve log error messages

* remove unique_id not ready yet
2019-08-01 12:45:16 -07:00
Jc2k
a177ef02e3 Bump homekit_python to 0.15 (#25631) 2019-08-01 12:44:30 -07:00
Ville Skyttä
767b8e9f25 Add some debugging to azure mypy job (#25632) 2019-08-01 12:44:02 -07:00
Paulus Schoutsen
a398b39e12 Expose comfort presets as HA presets (#25491)
* Expose comfort presets as HA presets

* Fix bugs

* Handle unavailable

* log level debug on update

* Lint
2019-08-01 12:32:48 -07:00
Paulus Schoutsen
3649a1b5e9 Filter out empty results in history API (#25633) 2019-08-01 11:52:57 -07:00
Ville Skyttä
c2556d90ea Huawei LTE sensor unique id improvements (#25609)
* Convert sensor setup to async

* Improve sensor unique ids

* Save some indent levels, use f-string formatting

* Require getmac in tests

* Fix RouterData init in tests

* Make discovery_info optional in async_setup_platform signature
2019-08-01 19:22:04 +03:00
Jc2k
36129af447 Fix polling HomeKit devices with multiple services per accessory (#25629) 2019-08-01 16:35:19 +01:00
Ville Skyttä
6b22dbcd0b Blacken top level *.py (#25621)
* Blacken top level *.py

* Tolerate double quotes too in setup.py dependency extraction
2019-08-01 08:30:49 -07:00
Robert Svensson
ceac35797e Handle disabled devices (#25625) 2019-08-01 17:22:08 +02:00
Joakim Plate
84abb57ebc Fix test_install_existing_package (#25627)
homeassistant.util.package.install_package is not
a corutine.
2019-08-01 09:37:37 -05:00
tleegaard
61c6838fa2 Add support for HomeKit CO2 sensors (#25603) 2019-08-01 11:24:46 +01:00
Pascal Vizeli
b97bef3ac8 Remove liner for editor. Not need with black 2019-08-01 11:41:29 +02:00
Ville Skyttä
f9b1a52259 Move mypy settings to setup.cfg (#25611) 2019-08-01 07:53:53 +02:00
Ville Skyttä
cfd600d72e script/test: fix tox env (#25620) 2019-08-01 08:45:58 +03:00
David F. Mulcahey
3bd7b15b3d bump quirks (#25618) 2019-07-31 21:33:12 -06:00
Paulus Schoutsen
78a0e21557 Version bump to 0.98.0.dev0 2019-07-31 16:22:05 -07:00
650 changed files with 13915 additions and 5482 deletions

View File

@@ -158,7 +158,6 @@ omit =
homeassistant/components/ecovacs/*
homeassistant/components/eddystone_temperature/sensor.py
homeassistant/components/edimax/switch.py
homeassistant/components/edp_redy/*
homeassistant/components/egardia/*
homeassistant/components/eight_sleep/*
homeassistant/components/eliqonline/sensor.py
@@ -242,7 +241,6 @@ omit =
homeassistant/components/google_cloud/tts.py
homeassistant/components/google_maps/device_tracker.py
homeassistant/components/google_travel_time/sensor.py
homeassistant/components/googlehome/*
homeassistant/components/gpmdp/media_player.py
homeassistant/components/gpsd/sensor.py
homeassistant/components/greeneye_monitor/*
@@ -309,6 +307,7 @@ omit =
homeassistant/components/joaoapps_join/*
homeassistant/components/juicenet/*
homeassistant/components/kankun/switch.py
homeassistant/components/keba/*
homeassistant/components/keenetic_ndms2/device_tracker.py
homeassistant/components/keyboard/*
homeassistant/components/keyboard_remote/*
@@ -317,6 +316,8 @@ omit =
homeassistant/components/knx/*
homeassistant/components/knx/climate.py
homeassistant/components/knx/cover.py
homeassistant/components/kodi/__init__.py
homeassistant/components/kodi/const.py
homeassistant/components/kodi/media_player.py
homeassistant/components/kodi/notify.py
homeassistant/components/konnected/*
@@ -374,8 +375,9 @@ omit =
homeassistant/components/metoffice/weather.py
homeassistant/components/microsoft/tts.py
homeassistant/components/miflora/sensor.py
homeassistant/components/mikrotik/device_tracker.py
homeassistant/components/mikrotik/*
homeassistant/components/mill/climate.py
homeassistant/components/minio/*
homeassistant/components/mitemp_bt/sensor.py
homeassistant/components/mjpeg/camera.py
homeassistant/components/mobile_app/*
@@ -467,6 +469,7 @@ omit =
homeassistant/components/plaato/*
homeassistant/components/plex/media_player.py
homeassistant/components/plex/sensor.py
homeassistant/components/plugwise/*
homeassistant/components/plum_lightpad/*
homeassistant/components/pocketcasts/sensor.py
homeassistant/components/point/*
@@ -532,7 +535,6 @@ omit =
homeassistant/components/rtorrent/sensor.py
homeassistant/components/russound_rio/media_player.py
homeassistant/components/russound_rnet/media_player.py
homeassistant/components/ruter/sensor.py
homeassistant/components/sabnzbd/*
homeassistant/components/satel_integra/*
homeassistant/components/scrape/sensor.py
@@ -740,6 +742,7 @@ omit =
homeassistant/components/zha/core/device.py
homeassistant/components/zha/core/gateway.py
homeassistant/components/zha/core/helpers.py
homeassistant/components/zha/core/registries.py
homeassistant/components/zha/device_entity.py
homeassistant/components/zha/entity.py
homeassistant/components/zha/light.py

View File

@@ -2,11 +2,12 @@
{
"name": "Home Assistant Dev",
"context": "..",
"dockerFile": "Dockerfile",
"dockerFile": "../Dockerfile.dev",
"postCreateCommand": "pip3 install -e .",
"appPort": 8123,
"runArgs": [
"-e", "GIT_EDTIOR='code --wait'"
"-e",
"GIT_EDITOR=\"code --wait\""
],
"extensions": [
"ms-python.python",
@@ -22,7 +23,6 @@
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"editor.rulers": [80],
"terminal.integrated.shell.linux": "/bin/bash",
"yaml.customTags": [
"!secret scalar",
@@ -32,4 +32,4 @@
"!include_dir_merge_named scalar"
]
}
}
}

6
.gitignore vendored
View File

@@ -50,6 +50,7 @@ develop-eggs
.installed.cfg
lib
lib64
pip-wheel-metadata
# Logs
*.log
@@ -58,9 +59,11 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
coverage.xml
nosetests.xml
htmlcov/
test-reports/
test-results.xml
# Translations
*.mo
@@ -121,3 +124,6 @@ desktop.ini
# monkeytype
monkeytype.sqlite3
# This is left behind by Azure Restore Cache
tmp_cache

View File

@@ -1,8 +1,15 @@
repos:
- repo: https://github.com/python/black
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
args:
- --safe
- --quiet
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.3.1
- pydocstyle==4.0.0

View File

@@ -16,14 +16,18 @@ addons:
matrix:
fast_finish: true
include:
- python: "3.6"
- python: "3.6.0"
env: TOXENV=lint
- python: "3.6"
dist: trusty
- python: "3.6.0"
env: TOXENV=pylint
- python: "3.6"
dist: trusty
- python: "3.6.0"
env: TOXENV=typing
- python: "3.6"
dist: trusty
- python: "3.6.0"
env: TOXENV=py36
dist: trusty
- python: "3.7"
env: TOXENV=py37

View File

@@ -9,10 +9,6 @@ homeassistant/*.py @home-assistant/core
homeassistant/helpers/* @home-assistant/core
homeassistant/util/* @home-assistant/core
# Virtualization
Dockerfile @home-assistant/docker
virtualization/Docker/* @home-assistant/docker
# Other code
homeassistant/scripts/check_config.py @kellerza
@@ -24,6 +20,7 @@ homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/ambiclimate/* @danielhiversen
homeassistant/components/ambient_station/* @bachya
homeassistant/components/androidtv/* @JeffLIrion
homeassistant/components/apache_kafka/* @bachya
homeassistant/components/api/* @home-assistant/core
homeassistant/components/aprs/* @PhilRW
@@ -43,6 +40,7 @@ homeassistant/components/azure_event_hub/* @eavanvalkenburg
homeassistant/components/bitcoin/* @fabaff
homeassistant/components/bizkaibus/* @UgaitzEtxebarria
homeassistant/components/blink/* @fronzbot
homeassistant/components/bmw_connected_drive/* @gerard33
homeassistant/components/braviatv/* @robbiet480
homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/brunt/* @eavanvalkenburg
@@ -73,7 +71,6 @@ homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dweet/* @fabaff
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/edp_redy/* @abmantis
homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/elv/* @majuss
@@ -101,13 +98,13 @@ homeassistant/components/fronius/* @nielstron
homeassistant/components/frontend/* @home-assistant/frontend
homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/geniushub/* @zxdavb
homeassistant/components/geonetnz_quakes/* @exxamalte
homeassistant/components/gitter/* @fabaff
homeassistant/components/glances/* @fabaff
homeassistant/components/gntp/* @robbiet480
homeassistant/components/google_cloud/* @lufton
homeassistant/components/google_translate/* @awarecan
homeassistant/components/google_travel_time/* @robbiet480
homeassistant/components/googlehome/* @ludeeus
homeassistant/components/gpsd/* @fabaff
homeassistant/components/group/* @home-assistant/core
homeassistant/components/gtfs/* @robbiet480
@@ -142,6 +139,7 @@ homeassistant/components/ipma/* @dgomes
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/jewish_calendar/* @tsvi
homeassistant/components/keba/* @dannerph
homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/* @armills
homeassistant/components/konnected/* @heythisisnate
@@ -171,6 +169,7 @@ homeassistant/components/meteoalarm/* @rolfberkenbosch
homeassistant/components/miflora/* @danielhiversen @ChristianKuehnel
homeassistant/components/mill/* @danielhiversen
homeassistant/components/min_max/* @fabaff
homeassistant/components/minio/* @tkislan
homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/* @fabaff
@@ -181,6 +180,7 @@ homeassistant/components/nello/* @pschmitt
homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
homeassistant/components/netdata/* @fabaff
homeassistant/components/netgear_lte/* @amelchio
homeassistant/components/nextbus/* @vividboarder
homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/* @thibmaek
@@ -203,6 +203,7 @@ homeassistant/components/philips_js/* @elupus
homeassistant/components/pi_hole/* @fabaff
homeassistant/components/plaato/* @JohNan
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/plugwise/* @laetificat @CoMPaTech
homeassistant/components/point/* @fredrike
homeassistant/components/ps4/* @ktnrg45
homeassistant/components/ptvsd/* @swamp-ig
@@ -220,7 +221,6 @@ homeassistant/components/repetier/* @MTrab
homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/* @pschmitt
homeassistant/components/ruter/* @ludeeus
homeassistant/components/scene/* @home-assistant/core
homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
@@ -286,7 +286,7 @@ homeassistant/components/updater/* @home-assistant/core
homeassistant/components/upnp/* @robbiet480
homeassistant/components/uptimerobot/* @ludeeus
homeassistant/components/utility_meter/* @dgomes
homeassistant/components/velbus/* @ceral2nd
homeassistant/components/velbus/* @cereal2nd
homeassistant/components/velux/* @Julius2342
homeassistant/components/version/* @fabaff
homeassistant/components/vesync/* @markperdue @webdjoe

View File

@@ -1,37 +0,0 @@
# Notice:
# When updating this file, please also update virtualization/Docker/Dockerfile.dev
# This way, the development image and the production image are kept in sync.
FROM python:3.7-buster
LABEL maintainer="Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>"
# Uncomment any of the following lines to disable the installation.
#ENV INSTALL_TELLSTICK no
#ENV INSTALL_OPENALPR no
#ENV INSTALL_FFMPEG no
#ENV INSTALL_LIBCEC no
#ENV INSTALL_SSOCR no
#ENV INSTALL_DLIB no
#ENV INSTALL_IPERF3 no
VOLUME /config
WORKDIR /usr/src/app
# Copy build scripts
COPY virtualization/Docker/ virtualization/Docker/
RUN virtualization/Docker/setup_docker_prereqs
# Install hass component dependencies
COPY requirements_all.txt requirements_all.txt
RUN pip3 install --no-cache-dir -r requirements_all.txt && \
pip3 install --no-cache-dir mysqlclient psycopg2 uvloop==0.12.2 cchardet cython tensorflow
# Copy source
COPY . .
EXPOSE 8123
EXPOSE 8300
EXPOSE 51827
CMD [ "python", "-m", "homeassistant", "--config", "/config" ]

View File

@@ -16,14 +16,15 @@ RUN apt-get update \
WORKDIR /usr/src
# Setup hass-release
RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
&& cd hass-release \
&& pip3 install -e .
WORKDIR /workspace
WORKDIR /workspaces
# Install Python dependencies from requirements.txt if it exists
COPY requirements_test_all.txt homeassistant/package_constraints.txt /workspace/
COPY requirements_test_all.txt homeassistant/package_constraints.txt /workspaces/
RUN pip3 install -r requirements_test_all.txt -c package_constraints.txt
# Set the default shell to bash instead of sh

View File

@@ -18,9 +18,12 @@ resources:
image: homeassistant/ci-azure:3.6
- container: 37
image: homeassistant/ci-azure:3.7
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'
variables:
- name: ArtifactFeed
value: '2df3ae11-3bf6-49bc-a809-ba0d340d6a6d'
- name: PythonMain
value: '36'
- group: codecov
@@ -95,42 +98,23 @@ stages:
python.container: '37'
container: $[ variables['python.container'] ]
steps:
- script: |
python --version > .cache
displayName: 'Set python $(python.container) for requirement cache'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: 'Restore artifacts based on Requirements'
inputs:
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_test_all.txt, .cache, homeassistant/package_constraints.txt'
targetfolder: './venv'
vstsFeed: '$(ArtifactFeed)'
- script: |
set -e
python -m venv venv
build: |
set -e
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools pytest-azurepipelines -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
displayName: 'Create Virtual Environment & Install Requirements'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
# Explicit Cache Save (instead of using RestoreAndSaveCache)
# Dont wait with cache save for all the other task in this job to complete (±30 minutes), other parallel jobs might utilize this
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: 'Save artifacts based on Requirements'
inputs:
keyfile: 'requirements_test_all.txt, .cache, homeassistant/package_constraints.txt'
targetfolder: './venv'
vstsFeed: '$(ArtifactFeed)'
- script: |
. venv/bin/activate
pip install -e .
displayName: 'Install Home Assistant for python $(python.container)'
. venv/bin/activate
pip install -U pip setuptools pytest-azurepipelines -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
pytest --timeout=9 --durations=10 --junitxml=test-results.xml -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']))
- script: |
@@ -139,6 +123,7 @@ stages:
. venv/bin/activate
pytest --timeout=9 --durations=10 --junitxml=test-results.xml --cov --cov-report=xml -qq -o console_output_style=count -p no:sugar tests
codecov --token $(codecovToken)
script/check_dirty
displayName: 'Run pytest for python $(python.container) / coverage'
condition: and(succeeded(), eq(variables['python.container'], variables['PythonMain']))
- task: PublishTestResults@2
@@ -162,35 +147,17 @@ stages:
vmImage: 'ubuntu-latest'
container: $[ variables['PythonMain'] ]
steps:
- script: |
python --version > .cache
displayName: 'Set python $(PythonMain) for requirement cache'
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
displayName: 'Restore artifacts based on Requirements'
inputs:
- template: templates/azp-step-cache.yaml@azure
parameters:
keyfile: 'requirements_all.txt, requirements_test.txt, .cache, homeassistant/package_constraints.txt'
targetfolder: './venv'
vstsFeed: '$(ArtifactFeed)'
- script: |
set -e
python -m venv venv
build: |
set -e
python -m venv venv
. venv/bin/activate
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
displayName: 'Create Virtual Environment & Install Requirements'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
displayName: 'Save artifacts based on Requirements'
inputs:
keyfile: 'requirements_all.txt, requirements_test.txt, .cache, homeassistant/package_constraints.txt'
targetfolder: './venv'
vstsFeed: '$(ArtifactFeed)'
- script: |
. venv/bin/activate
pip install -e .
displayName: 'Install Home Assistant for python $(PythonMain)'
. venv/bin/activate
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
pylint homeassistant
@@ -204,6 +171,7 @@ stages:
python -m venv venv
. venv/bin/activate
pip install -e .
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
displayName: 'Setup Env'
- script: |

View File

@@ -3,37 +3,39 @@
trigger:
tags:
include:
- '*'
- '*'
pr: none
schedules:
- cron: "0 1 * * *"
displayName: "nightly builds"
branches:
include:
- dev
always: true
variables:
- name: versionBuilder
value: '5.2'
value: '6.3'
- group: docker
- group: github
- group: twine
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'
stages:
- stage: 'Validate'
jobs:
- job: 'VersionValidate'
- template: templates/azp-job-version.yaml@azure
parameters:
ignoreDev: true
- job: 'Permission'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UsePythonVersion@0
displayName: 'Use Python 3.7'
inputs:
versionSpec: '3.7'
- script: |
setup_version="$(python setup.py -V)"
branch_version="$(Build.SourceBranchName)"
if [ "${setup_version}" != "${branch_version}" ]; then
echo "Version of tag ${branch_version} don't match with ${setup_version}!"
exit 1
fi
displayName: 'Check version of branch/tag'
- script: |
sudo apt-get install -y --no-install-recommends \
jq curl
@@ -48,10 +50,12 @@ stages:
echo "${created_by} is not allowed to create an release!"
exit 1
displayName: 'Check rights'
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
- stage: 'Build'
jobs:
- job: 'ReleasePython'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
pool:
vmImage: 'ubuntu-latest'
steps:
@@ -66,7 +70,7 @@ stages:
- script: |
export TWINE_USERNAME="$(twineUser)"
export TWINE_PASSWORD="$(twinePassword)"
twine upload dist/* --skip-existing
displayName: 'Upload pypi'
- job: 'ReleaseDocker'
@@ -92,26 +96,29 @@ stages:
buildArch: 'aarch64'
buildMachine: 'qemuarm-64,raspberrypi3-64,raspberrypi4-64,odroid-c2,orangepi-prime'
steps:
- script: sudo docker login -u $(dockerUser) -p $(dockerPassword)
- template: templates/azp-step-ha-version.yaml@azure
- script: |
docker login -u $(dockerUser) -p $(dockerPassword)
displayName: 'Docker hub login'
- script: sudo docker pull homeassistant/amd64-builder:$(versionBuilder)
- script: docker pull homeassistant/amd64-builder:$(versionBuilder)
displayName: 'Install Builder'
- script: |
set -e
sudo docker run --rm --privileged \
-v ~/.docker:/root/.docker \
docker run --rm --privileged \
-v ~/.docker:/root/.docker:rw \
-v /run/docker.sock:/run/docker.sock:rw \
-v $(pwd):/homeassistant:ro \
homeassistant/amd64-builder:$(versionBuilder) \
--homeassistant $(Build.SourceBranchName) "--$(buildArch)" \
--homeassistant $(homeassistantRelease) "--$(buildArch)" \
-r https://github.com/home-assistant/hassio-homeassistant \
-t generic --docker-hub homeassistant
sudo docker run --rm --privileged \
docker run --rm --privileged \
-v ~/.docker:/root/.docker \
-v /run/docker.sock:/run/docker.sock:rw \
homeassistant/amd64-builder:$(versionBuilder) \
--homeassistant-machine "$(Build.SourceBranchName)=$(buildMachine)" \
--homeassistant-machine "$(homeassistantRelease)=$(buildMachine)" \
-r https://github.com/home-assistant/hassio-homeassistant \
-t machine --docker-hub homeassistant
displayName: 'Build Release'
@@ -122,6 +129,7 @@ stages:
pool:
vmImage: 'ubuntu-latest'
steps:
- template: templates/azp-step-ha-version.yaml@azure
- script: |
sudo apt-get install -y --no-install-recommends \
git jq curl
@@ -135,7 +143,7 @@ stages:
- script: |
set -e
version="$(Build.SourceBranchName)"
version="$(homeassistantRelease)"
git clone https://github.com/home-assistant/hassio-version
cd hassio-version
@@ -144,11 +152,11 @@ stages:
beta_version="$(jq --raw-output '.homeassistant.default' beta.json)"
stable_version="$(jq --raw-output '.homeassistant.default' stable.json)"
if [[ "$version" =~ b ]]; then
if [[ "$version" =~ d ]]; then
sed -i "s|$dev_version|$version|g" dev.json
elif [[ "$version" =~ b ]]; then
sed -i "s|$beta_version|$version|g" beta.json
else
sed -i "s|$dev_version|$version|g" dev.json
sed -i "s|$beta_version|$version|g" beta.json
sed -i "s|$stable_version|$version|g" stable.json
fi
@@ -156,3 +164,72 @@ stages:
git commit -am "Bump Home Assistant $version"
git push
displayName: 'Update version files'
- job: 'ReleaseDocker'
pool:
vmImage: 'ubuntu-latest'
steps:
- template: templates/azp-step-ha-version.yaml@azure
- script: |
docker login -u $(dockerUser) -p $(dockerPassword)
displayName: 'Docker login'
- script: |
set -e
export DOCKER_CLI_EXPERIMENTAL=enabled
function create_manifest() {
local tag_l=$1
local tag_r=$2
docker manifest create homeassistant/home-assistant:${tag_l} \
homeassistant/amd64-homeassistant:${tag_r} \
homeassistant/i386-homeassistant:${tag_r} \
homeassistant/armhf-homeassistant:${tag_r} \
homeassistant/armv7-homeassistant:${tag_r} \
homeassistant/aarch64-homeassistant:${tag_r}
docker manifest annotate homeassistant/home-assistant:${tag_l} \
homeassistant/amd64-homeassistant:${tag_r} \
--os linux --arch amd64
docker manifest annotate homeassistant/home-assistant:${tag_l} \
homeassistant/i386-homeassistant:${tag_r} \
--os linux --arch 386
docker manifest annotate homeassistant/home-assistant:${tag_l} \
homeassistant/armhf-homeassistant:${tag_r} \
--os linux --arch arm --variant=v6
docker manifest annotate homeassistant/home-assistant:${tag_l} \
homeassistant/armv7-homeassistant:${tag_r} \
--os linux --arch arm --variant=v7
docker manifest annotate homeassistant/home-assistant:${tag_l} \
homeassistant/aarch64-homeassistant:${tag_r} \
--os linux --arch arm64 --variant=v8
docker manifest push --purge homeassistant/home-assistant:${tag_l}
}
docker pull homeassistant/amd64-homeassistant:$(homeassistantRelease)
docker pull homeassistant/i386-homeassistant:$(homeassistantRelease)
docker pull homeassistant/armhf-homeassistant:$(homeassistantRelease)
docker pull homeassistant/armv7-homeassistant:$(homeassistantRelease)
docker pull homeassistant/aarch64-homeassistant:$(homeassistantRelease)
# Create version tag
create_manifest "$(homeassistantRelease)" "$(homeassistantRelease)"
# Create general tags
if [[ "$(homeassistantRelease)" =~ d ]]; then
create_manifest "dev" "$(homeassistantRelease)"
elif [[ "$(homeassistantRelease)" =~ b ]]; then
create_manifest "beta" "$(homeassistantRelease)"
create_manifest "rc" "$(homeassistantRelease)"
else
create_manifest "stable" "$(homeassistantRelease)"
create_manifest "latest" "$(homeassistantRelease)"
create_manifest "beta" "$(homeassistantRelease)"
create_manifest "rc" "$(homeassistantRelease)"
fi
displayName: 'Create Meta-Image'

View File

@@ -9,91 +9,61 @@ trigger:
include:
- requirements_all.txt
pr: none
schedules:
- cron: '0 */8 * * *'
displayName: 'daily builds'
branches:
include:
- dev
always: true
variables:
- name: versionWheels
value: '1.0-3.7-alpine3.10'
- group: wheels
value: '1.1-3.7-alpine3.10'
resources:
repositories:
- repository: azure
type: github
name: 'home-assistant/ci-azure'
endpoint: 'home-assistant'
jobs:
- template: templates/azp-job-wheels.yaml@azure
parameters:
builderVersion: '$(versionWheels)'
builderApk: 'build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;linux-headers;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev'
wheelsRequirement: 'requirements_wheels.txt'
wheelsRequirementDiff: 'requirements_diff.txt'
preBuild:
- script: |
cp requirements_all.txt requirements_wheels.txt
if [[ "$(Build.Reason)" =~ (Schedule|Manual) ]]; then
touch requirements_diff.txt
else
curl -s -o requirements_diff.txt https://raw.githubusercontent.com/home-assistant/home-assistant/master/requirements_all.txt
fi
- job: 'Wheels'
timeoutInMinutes: 360
pool:
vmImage: 'ubuntu-latest'
strategy:
maxParallel: 5
matrix:
amd64:
buildArch: 'amd64'
i386:
buildArch: 'i386'
armhf:
buildArch: 'armhf'
armv7:
buildArch: 'armv7'
aarch64:
buildArch: 'aarch64'
steps:
- script: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
qemu-user-static \
binfmt-support \
curl
sudo mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc
sudo update-binfmts --enable qemu-arm
sudo update-binfmts --enable qemu-aarch64
displayName: 'Initial cross build'
- script: |
mkdir -p .ssh
echo -e "-----BEGIN RSA PRIVATE KEY-----\n$(wheelsSSH)\n-----END RSA PRIVATE KEY-----" >> .ssh/id_rsa
ssh-keyscan -H $(wheelsHost) >> .ssh/known_hosts
chmod 600 .ssh/*
displayName: 'Install ssh key'
- script: sudo docker pull homeassistant/$(buildArch)-wheels:$(versionWheels)
displayName: 'Install wheels builder'
- script: |
cp requirements_all.txt requirements_wheels.txt
if [[ "$(Build.Reason)" =~ (Schedule|Manual) ]]; then
touch requirements_diff.txt
else
curl -s -o requirements_diff.txt https://raw.githubusercontent.com/home-assistant/home-assistant/master/requirements_all.txt
fi
requirement_files="requirements_wheels.txt requirements_diff.txt"
for requirement_file in ${requirement_files}; do
sed -i "s|# pytradfri|pytradfri|g" ${requirement_file}
sed -i "s|# pybluez|pybluez|g" ${requirement_file}
sed -i "s|# bluepy|bluepy|g" ${requirement_file}
sed -i "s|# beacontools|beacontools|g" ${requirement_file}
sed -i "s|# RPi.GPIO|RPi.GPIO|g" ${requirement_file}
sed -i "s|# raspihats|raspihats|g" ${requirement_file}
sed -i "s|# rpi-rf|rpi-rf|g" ${requirement_file}
sed -i "s|# blinkt|blinkt|g" ${requirement_file}
sed -i "s|# fritzconnection|fritzconnection|g" ${requirement_file}
sed -i "s|# pyuserinput|pyuserinput|g" ${requirement_file}
sed -i "s|# evdev|evdev|g" ${requirement_file}
sed -i "s|# smbus-cffi|smbus-cffi|g" ${requirement_file}
sed -i "s|# i2csense|i2csense|g" ${requirement_file}
sed -i "s|# python-eq3bt|python-eq3bt|g" ${requirement_file}
sed -i "s|# pycups|pycups|g" ${requirement_file}
sed -i "s|# homekit|homekit|g" ${requirement_file}
sed -i "s|# decora_wifi|decora_wifi|g" ${requirement_file}
sed -i "s|# decora|decora|g" ${requirement_file}
sed -i "s|# PySwitchbot|PySwitchbot|g" ${requirement_file}
sed -i "s|# pySwitchmate|pySwitchmate|g" ${requirement_file}
sed -i "s|# face_recognition|face_recognition|g" ${requirement_file}
done
displayName: 'Prepare requirements files for Hass.io'
- script: |
sudo docker run --rm -v $(pwd):/data:ro -v $(pwd)/.ssh:/root/.ssh:rw \
homeassistant/$(buildArch)-wheels:$(versionWheels) \
--apk "build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;autoconf;automake;cups-dev;linux-headers;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev" \
--index $(wheelsIndex) \
--requirement requirements_wheels.txt \
--requirement-diff requirements_diff.txt \
--upload rsync \
--remote wheels@$(wheelsHost):/opt/wheels
displayName: 'Run wheels build'
requirement_files="requirements_wheels.txt requirements_diff.txt"
for requirement_file in ${requirement_files}; do
sed -i "s|# pytradfri|pytradfri|g" ${requirement_file}
sed -i "s|# pybluez|pybluez|g" ${requirement_file}
sed -i "s|# bluepy|bluepy|g" ${requirement_file}
sed -i "s|# beacontools|beacontools|g" ${requirement_file}
sed -i "s|# RPi.GPIO|RPi.GPIO|g" ${requirement_file}
sed -i "s|# raspihats|raspihats|g" ${requirement_file}
sed -i "s|# rpi-rf|rpi-rf|g" ${requirement_file}
sed -i "s|# blinkt|blinkt|g" ${requirement_file}
sed -i "s|# fritzconnection|fritzconnection|g" ${requirement_file}
sed -i "s|# pyuserinput|pyuserinput|g" ${requirement_file}
sed -i "s|# evdev|evdev|g" ${requirement_file}
sed -i "s|# smbus-cffi|smbus-cffi|g" ${requirement_file}
sed -i "s|# i2csense|i2csense|g" ${requirement_file}
sed -i "s|# python-eq3bt|python-eq3bt|g" ${requirement_file}
sed -i "s|# pycups|pycups|g" ${requirement_file}
sed -i "s|# homekit|homekit|g" ${requirement_file}
sed -i "s|# decora_wifi|decora_wifi|g" ${requirement_file}
sed -i "s|# decora|decora|g" ${requirement_file}
sed -i "s|# PySwitchbot|PySwitchbot|g" ${requirement_file}
sed -i "s|# pySwitchmate|pySwitchmate|g" ${requirement_file}
sed -i "s|# face_recognition|face_recognition|g" ${requirement_file}
done
displayName: 'Prepare requirements files for Hass.io'

View File

@@ -10,12 +10,7 @@ import threading
from typing import List, Dict, Any, TYPE_CHECKING # noqa pylint: disable=unused-import
from homeassistant import monkey_patch
from homeassistant.const import (
__version__,
EVENT_HOMEASSISTANT_START,
REQUIRED_PYTHON_VER,
RESTART_EXIT_CODE,
)
from homeassistant.const import __version__, REQUIRED_PYTHON_VER, RESTART_EXIT_CODE
if TYPE_CHECKING:
from homeassistant import core
@@ -309,23 +304,10 @@ async def setup_and_run_hass(config_dir: str, args: argparse.Namespace) -> int:
log_no_color=args.log_no_color,
)
if args.open_ui:
# Imported here to avoid importing asyncio before monkey patch
from homeassistant.util.async_ import run_callback_threadsafe
if args.open_ui and hass.config.api is not None:
import webbrowser
def open_browser(_: Any) -> None:
"""Open the web interface in a browser."""
if hass.config.api is not None:
import webbrowser
webbrowser.open(hass.config.api.base_url)
run_callback_threadsafe(
hass.loop,
hass.bus.async_listen_once,
EVENT_HOMEASSISTANT_START,
open_browser,
)
hass.add_job(webbrowser.open, hass.config.api.base_url)
return await hass.async_run()

View File

@@ -458,7 +458,7 @@ class AuthManager:
result["data"]
)
if flow.context is not None and flow.context.get("credential_only"):
if flow.context.get("credential_only"):
result["result"] = credentials
return result

View File

@@ -164,14 +164,9 @@ async def _load_mfa_module(hass: HomeAssistant, module_name: str) -> types.Modul
processed = hass.data[DATA_REQS] = set()
# https://github.com/python/mypy/issues/1424
req_success = await requirements.async_process_requirements(
await requirements.async_process_requirements(
hass, module_path, module.REQUIREMENTS # type: ignore
)
if not req_success:
raise HomeAssistantError(
"Unable to process requirements of mfa module {}".format(module_name)
)
processed.add(module_name)
return module

View File

@@ -7,6 +7,7 @@ from typing import ( # noqa: F401
Dict,
List,
Mapping,
Optional,
Set,
Tuple,
Union,
@@ -31,7 +32,7 @@ _LOGGER = logging.getLogger(__name__)
class AbstractPermissions:
"""Default permissions class."""
_cached_entity_func = None
_cached_entity_func: Optional[Callable[[str, str], bool]] = None
def _entity_func(self) -> Callable[[str, str], bool]:
"""Return a function that can test entity access."""

View File

@@ -165,15 +165,10 @@ async def load_auth_provider_module(
# https://github.com/python/mypy/issues/1424
reqs = module.REQUIREMENTS # type: ignore
req_success = await requirements.async_process_requirements(
await requirements.async_process_requirements(
hass, "auth provider {}".format(provider), reqs
)
if not req_success:
raise HomeAssistantError(
"Unable to process requirements of auth provider {}".format(provider)
)
processed.add(provider)
return module

View File

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

View File

@@ -20,7 +20,8 @@
"username": "Nombre de usuario",
"verify_ssl": "AdGuard Home utiliza un certificado adecuado"
},
"description": "Configure su instancia de AdGuard Home para permitir la supervisi\u00f3n y el control."
"description": "Configure su instancia de AdGuard Home para permitir la supervisi\u00f3n y el control.",
"title": "Enlace su AdGuard Home."
}
},
"title": "AdGuard Home"

View File

@@ -1,13 +1,15 @@
{
"config": {
"abort": {
"existing_instance_updated": "La configuration existante a \u00e9t\u00e9 mise \u00e0 jour."
"existing_instance_updated": "La configuration existante a \u00e9t\u00e9 mise \u00e0 jour.",
"single_instance_allowed": "Une seule configuration d'AdGuard Home est autoris\u00e9e."
},
"error": {
"connection_error": "\u00c9chec de connexion."
},
"step": {
"hassio_confirm": {
"description": "Voulez-vous configurer Home Assistant pour qu'il se connecte \u00e0 AdGuard Home fourni par le module compl\u00e9mentaire Hass.io: {addon} ?",
"title": "AdGuard Home via le module compl\u00e9mentaire Hass.io"
},
"user": {
@@ -16,9 +18,13 @@
"password": "Mot de passe",
"port": "Port",
"ssl": "AdGuard Home utilise un certificat SSL",
"username": "Nom d'utilisateur"
}
"username": "Nom d'utilisateur",
"verify_ssl": "AdGuard Home utilise un certificat appropri\u00e9"
},
"description": "Configurez votre instance AdGuard Home pour permettre la surveillance et le contr\u00f4le.",
"title": "Liez votre AdGuard Home."
}
}
},
"title": "AdGuard Home"
}
}

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"existing_instance_updated": "Postoje\u0107a konfiguracija je a\u017eurirana."
}
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"error": {
"connection_error": "Gagal terhubung."
},
"step": {
"user": {
"data": {
"password": "Kata sandi",
"port": "Port"
}
}
}
}
}

View File

@@ -56,6 +56,11 @@ class Auth:
return await self._async_request_new_token(lwa_params)
@callback
def async_invalidate_access_token(self):
"""Invalidate access token."""
self._prefs[STORAGE_ACCESS_TOKEN] = None
async def async_get_access_token(self):
"""Perform access token or token refresh request."""
async with self._get_token_lock:

View File

@@ -11,6 +11,7 @@ from homeassistant.const import (
STATE_ON,
STATE_UNAVAILABLE,
STATE_UNLOCKED,
STATE_UNKNOWN,
)
import homeassistant.components.climate.const as climate
from homeassistant.components import light, fan, cover
@@ -443,7 +444,17 @@ class AlexaTemperatureSensor(AlexaCapibility):
if self.entity.domain == climate.DOMAIN:
unit = self.hass.config.units.temperature_unit
temp = self.entity.attributes.get(climate.ATTR_CURRENT_TEMPERATURE)
return {"value": float(temp), "scale": API_TEMP_UNITS[unit]}
if temp in (STATE_UNAVAILABLE, STATE_UNKNOWN):
return None
try:
temp = float(temp)
except ValueError:
_LOGGER.warning("Invalid temp value %s for %s", temp, self.entity.entity_id)
return None
return {"value": temp, "scale": API_TEMP_UNITS[unit]}
class AlexaContactSensor(AlexaCapibility):
@@ -591,4 +602,12 @@ class AlexaThermostatController(AlexaCapibility):
if temp is None:
return None
return {"value": float(temp), "scale": API_TEMP_UNITS[unit]}
try:
temp = float(temp)
except ValueError:
_LOGGER.warning(
"Invalid temp value %s for %s in %s", temp, name, self.entity.entity_id
)
return None
return {"value": temp, "scale": API_TEMP_UNITS[unit]}

View File

@@ -1,4 +1,6 @@
"""Config helpers for Alexa."""
from homeassistant.core import callback
from .state_report import async_enable_proactive_mode
@@ -55,11 +57,17 @@ class AbstractConfig:
unsub_func()
self._unsub_proactive_report = None
@callback
def should_expose(self, entity_id):
"""If an entity should be exposed."""
# pylint: disable=no-self-use
return False
@callback
def async_invalidate_access_token(self):
"""Invalidate access token."""
raise NotImplementedError
async def async_get_access_token(self):
"""Get an access token."""
raise NotImplementedError

View File

@@ -47,7 +47,7 @@ CONF_DISPLAY_CATEGORIES = "display_categories"
API_TEMP_UNITS = {TEMP_FAHRENHEIT: "FAHRENHEIT", TEMP_CELSIUS: "CELSIUS"}
# Needs to be ordered dict for `async_api_set_thermostat_mode` which does a
# reverse mapping of this dict and we want to map the first occurrance of OFF
# reverse mapping of this dict and we want to map the first occurrence of OFF
# back to HA state.
API_THERMOSTAT_MODES = OrderedDict(
[

View File

@@ -264,7 +264,9 @@ class ClimateCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
# If we support two modes, one being off, we allow turning on too.
if climate.HVAC_MODE_OFF in self.entity.attributes[climate.ATTR_HVAC_MODES]:
if climate.HVAC_MODE_OFF in self.entity.attributes.get(
climate.ATTR_HVAC_MODES, []
):
yield AlexaPowerController(self.entity)
yield AlexaThermostatController(self.hass, self.entity)

View File

@@ -163,7 +163,7 @@ class AlexaResponse:
The Alexa response includes a list of properties which provides
feedback on how states have changed. For example if a user asks,
"Alexa, set theromstat to 20 degrees", the API expects a response with
"Alexa, set thermostat to 20 degrees", the API expects a response with
the new value of the property, and Alexa will respond to the user
"Thermostat set to 20 degrees".

View File

@@ -57,6 +57,11 @@ class AlexaConfig(AbstractConfig):
"""If an entity should be exposed."""
return self._config[CONF_FILTER](entity_id)
@core.callback
def async_invalidate_access_token(self):
"""Invalidate access token."""
self._auth.async_invalidate_access_token()
async def async_get_access_token(self):
"""Get an access token."""
return await self._auth.async_get_access_token()

View File

@@ -51,7 +51,9 @@ async def async_enable_proactive_mode(hass, smart_home_config):
)
async def async_send_changereport_message(hass, config, alexa_entity):
async def async_send_changereport_message(
hass, config, alexa_entity, *, invalidate_access_token=True
):
"""Send a ChangeReport message for an Alexa entity.
https://developer.amazon.com/docs/smarthome/state-reporting-for-a-smart-home-skill.html#report-state-with-changereport-events
@@ -88,21 +90,33 @@ async def async_send_changereport_message(hass, config, alexa_entity):
except (asyncio.TimeoutError, aiohttp.ClientError):
_LOGGER.error("Timeout sending report to Alexa.")
return None
return
response_text = await response.text()
_LOGGER.debug("Sent: %s", json.dumps(message_serialized))
_LOGGER.debug("Received (%s): %s", response.status, response_text)
if response.status != 202:
response_json = json.loads(response_text)
_LOGGER.error(
"Error when sending ChangeReport to Alexa: %s: %s",
response_json["payload"]["code"],
response_json["payload"]["description"],
if response.status == 202:
return
response_json = json.loads(response_text)
if (
response_json["payload"]["code"] == "INVALID_ACCESS_TOKEN_EXCEPTION"
and not invalidate_access_token
):
config.async_invalidate_access_token()
return await async_send_changereport_message(
hass, config, alexa_entity, invalidate_access_token=False
)
_LOGGER.error(
"Error when sending ChangeReport to Alexa: %s: %s",
response_json["payload"]["code"],
response_json["payload"]["description"],
)
async def async_send_add_or_update_message(hass, config, entity_ids):
"""Send an AddOrUpdateReport message for entities.

View File

@@ -45,7 +45,7 @@ SUPPORTED_VOICES = [
"Ruben",
"Lotte", # Dutch
"Russell",
"Nicole", # English Austrailian
"Nicole", # English Australian
"Brian",
"Amy",
"Emma", # English

View File

@@ -7,6 +7,17 @@
},
"create_entry": {
"default": "Autenticaci\u00f3n exitosa con Ambiclimate"
}
},
"error": {
"follow_link": "Por favor, siga el enlace y autent\u00edquese antes de presionar Enviar",
"no_token": "No autenticado con Ambiclimate"
},
"step": {
"auth": {
"description": "Por favor, siga este [link]('authorization_url') y <b>Permitir</b> acceso a su cuenta de Ambiclimate, luego vuelva y presione <b>Enviar</b> a continuaci\u00f3n.\n(Aseg\u00farese de que la url de devoluci\u00f3n de llamada especificada es {cb_url})",
"title": "Autenticaci\u00f3n de Ambiclimate"
}
},
"title": "Ambiclimate"
}
}

View File

@@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/components/ambient_station",
"requirements": [
"aioambient==0.3.1"
"aioambient==0.3.2"
],
"dependencies": [],
"codeowners": [

View File

@@ -3,8 +3,8 @@
"name": "Androidtv",
"documentation": "https://www.home-assistant.io/components/androidtv",
"requirements": [
"androidtv==0.0.18"
"androidtv==0.0.24"
],
"dependencies": [],
"codeowners": []
"codeowners": ["@JeffLIrion"]
}

View File

@@ -3,6 +3,9 @@ import functools
import logging
import voluptuous as vol
from androidtv import setup, ha_state_detection_rules_validator
from androidtv.constants import APPS, KEYS
from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
@@ -64,6 +67,7 @@ CONF_ADB_SERVER_IP = "adb_server_ip"
CONF_ADB_SERVER_PORT = "adb_server_port"
CONF_APPS = "apps"
CONF_GET_SOURCES = "get_sources"
CONF_STATE_DETECTION_RULES = "state_detection_rules"
CONF_TURN_ON_COMMAND = "turn_on_command"
CONF_TURN_OFF_COMMAND = "turn_off_command"
@@ -99,6 +103,9 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
vol.Optional(CONF_APPS, default=dict()): vol.Schema({cv.string: cv.string}),
vol.Optional(CONF_TURN_ON_COMMAND): cv.string,
vol.Optional(CONF_TURN_OFF_COMMAND): cv.string,
vol.Optional(CONF_STATE_DETECTION_RULES, default={}): vol.Schema(
{cv.string: ha_state_detection_rules_validator(vol.Invalid)}
),
}
)
@@ -114,8 +121,6 @@ ANDROIDTV_STATES = {
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Android TV / Fire TV platform."""
from androidtv import setup
hass.data.setdefault(ANDROIDTV_DOMAIN, {})
host = "{0}:{1}".format(config[CONF_HOST], config[CONF_PORT])
@@ -125,12 +130,19 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
adb_log = "using Python ADB implementation "
if CONF_ADBKEY in config:
aftv = setup(
host, config[CONF_ADBKEY], device_class=config[CONF_DEVICE_CLASS]
host,
config[CONF_ADBKEY],
device_class=config[CONF_DEVICE_CLASS],
state_detection_rules=config[CONF_STATE_DETECTION_RULES],
)
adb_log += "with adbkey='{0}'".format(config[CONF_ADBKEY])
else:
aftv = setup(host, device_class=config[CONF_DEVICE_CLASS])
aftv = setup(
host,
device_class=config[CONF_DEVICE_CLASS],
state_detection_rules=config[CONF_STATE_DETECTION_RULES],
)
adb_log += "without adbkey authentication"
else:
# Use "pure-python-adb" (communicate with ADB server)
@@ -139,6 +151,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
adb_server_ip=config[CONF_ADB_SERVER_IP],
adb_server_port=config[CONF_ADB_SERVER_PORT],
device_class=config[CONF_DEVICE_CLASS],
state_detection_rules=config[CONF_STATE_DETECTION_RULES],
)
adb_log = "using ADB server at {0}:{1}".format(
config[CONF_ADB_SERVER_IP], config[CONF_ADB_SERVER_PORT]
@@ -182,7 +195,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
device_name = config[CONF_NAME] if CONF_NAME in config else "Fire TV"
add_entities([device])
_LOGGER.debug("Setup %s at %s%s", device_name, host, adb_log)
_LOGGER.debug("Setup %s at %s %s", device_name, host, adb_log)
hass.data[ANDROIDTV_DOMAIN][host] = device
if hass.services.has_service(ANDROIDTV_DOMAIN, SERVICE_ADB_COMMAND):
@@ -251,14 +264,15 @@ class ADBDevice(MediaPlayerDevice):
def __init__(self, aftv, name, apps, turn_on_command, turn_off_command):
"""Initialize the Android TV / Fire TV device."""
from androidtv.constants import APPS, KEYS
self.aftv = aftv
self._name = name
self._apps = APPS
self._apps = APPS.copy()
self._apps.update(apps)
self._keys = KEYS
self._device_properties = self.aftv.device_properties
self._unique_id = self._device_properties.get("serialno")
self.turn_on_command = turn_on_command
self.turn_off_command = turn_off_command
@@ -327,6 +341,11 @@ class ADBDevice(MediaPlayerDevice):
"""Return the state of the player."""
return self._state
@property
def unique_id(self):
"""Return the device unique id."""
return self._unique_id
@adb_decorator()
def media_play(self):
"""Send play command."""
@@ -401,9 +420,7 @@ class AndroidTVDevice(ADBDevice):
super().__init__(aftv, name, apps, turn_on_command, turn_off_command)
self._device = None
self._device_properties = self.aftv.device_properties
self._is_volume_muted = None
self._unique_id = self._device_properties.get("serialno")
self._volume_level = None
@adb_decorator(override_available=True)
@@ -443,11 +460,6 @@ class AndroidTVDevice(ADBDevice):
"""Flag media player features that are supported."""
return SUPPORT_ANDROIDTV
@property
def unique_id(self):
"""Return the device unique id."""
return self._unique_id
@property
def volume_level(self):
"""Return the volume level."""

View File

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

View File

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

View File

@@ -1,17 +0,0 @@
{
"config": {
"abort": {
"one": "Een",
"other": "Ander"
},
"error": {
"one": "Een",
"other": "Ander"
},
"step": {
"one": "Een",
"other": "Ander"
},
"title": "Arcam FMJ"
}
}

View File

@@ -1,23 +0,0 @@
{
"config": {
"abort": {
"few": "kilka",
"many": "wiele",
"one": "jeden",
"other": "inne"
},
"error": {
"few": "kilka",
"many": "wiele",
"one": "jeden",
"other": "inne"
},
"step": {
"few": "kilka",
"many": "wiele",
"one": "jeden",
"other": "inne"
},
"title": "Arcam FMJ"
}
}

View File

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

View File

@@ -124,7 +124,7 @@ class ArcamFmj(MediaPlayerDevice):
return support
async def async_added_to_hass(self):
"""Once registed add listener for events."""
"""Once registered, add listener for events."""
await self._state.start()
@callback

View File

@@ -1,8 +1,5 @@
{
"config": {
"title": "Arcam FMJ",
"step": {},
"error": {},
"abort": {}
"title": "Arcam FMJ"
}
}

View File

@@ -16,9 +16,13 @@
"description": "Se ha enviado una contrase\u00f1a \u00fanica a trav\u00e9s de **notify.{notify_service}**. Por favor ingr\u00e9selo a continuaci\u00f3n:",
"title": "Verificar la configuracion"
}
}
},
"title": "Notificar contrase\u00f1a de un solo uso"
},
"totp": {
"error": {
"invalid_code": "C\u00f3digo no v\u00e1lido, por favor vuelva a intentarlo. Si recibe este error constantemente, aseg\u00farese de que el reloj de su sistema Home Assistant sea exacto."
},
"step": {
"init": {
"description": "Para activar la autenticaci\u00f3n de dos factores utilizando contrase\u00f1as de un solo uso basadas en el tiempo, escanee el c\u00f3digo QR con su aplicaci\u00f3n de autenticaci\u00f3n. Si no tiene uno, le recomendamos [Autenticador de Google] (https://support.google.com/accounts/answer/1066447) o [Authy] (https://authy.com/). \n\n {qr_code} \n \n Despu\u00e9s de escanear el c\u00f3digo, ingrese el c\u00f3digo de seis d\u00edgitos de su aplicaci\u00f3n para verificar la configuraci\u00f3n. Si tiene problemas para escanear el c\u00f3digo QR, realice una configuraci\u00f3n manual con el c\u00f3digo ** ` {code} ` **.",

View File

@@ -31,7 +31,7 @@ async def async_setup(hass):
"""Init mfa setup flow manager."""
async def _async_create_setup_flow(handler, context, data):
"""Create a setup flow. hanlder is a mfa module."""
"""Create a setup flow. handler is a mfa module."""
mfa_module = hass.auth.get_auth_mfa_module(handler)
if mfa_module is None:
raise ValueError("Mfa module {} is not found".format(handler))

View File

@@ -30,6 +30,10 @@ from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.loader import bind_hass
from homeassistant.util.dt import parse_datetime, utcnow
# mypy: allow-incomplete-defs, allow-untyped-calls, allow-untyped-defs
# mypy: no-check-untyped-defs, no-warn-return-any
DOMAIN = "automation"
ENTITY_ID_FORMAT = DOMAIN + ".{}"

View File

@@ -5,6 +5,8 @@ from homeassistant.const import CONF_DOMAIN, CONF_PLATFORM
from homeassistant.loader import async_get_integration
# mypy: allow-untyped-defs, no-check-untyped-defs
TRIGGER_SCHEMA = vol.Schema(
{vol.Required(CONF_PLATFORM): "device", vol.Required(CONF_DOMAIN): str},
extra=vol.ALLOW_EXTRA,

View File

@@ -7,6 +7,9 @@ from homeassistant.core import callback
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers import config_validation as cv
# mypy: allow-untyped-defs
CONF_EVENT_TYPE = "event_type"
CONF_EVENT_DATA = "event_data"

View File

@@ -13,6 +13,9 @@ from homeassistant.const import (
from homeassistant.helpers import condition, config_validation as cv
from homeassistant.helpers.config_validation import entity_domain
# mypy: allow-untyped-defs, no-check-untyped-defs
EVENT_ENTER = "enter"
EVENT_LEAVE = "leave"
DEFAULT_EVENT = EVENT_ENTER

View File

@@ -6,6 +6,9 @@ import voluptuous as vol
from homeassistant.core import callback, CoreState
from homeassistant.const import CONF_PLATFORM, CONF_EVENT, EVENT_HOMEASSISTANT_STOP
# mypy: allow-untyped-defs
EVENT_START = "start"
EVENT_SHUTDOWN = "shutdown"
_LOGGER = logging.getLogger(__name__)

View File

@@ -9,6 +9,9 @@ import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.helpers.event import track_point_in_utc_time
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
CONF_NUMBER = "number"

View File

@@ -8,6 +8,9 @@ from homeassistant.components import mqtt
from homeassistant.const import CONF_PLATFORM, CONF_PAYLOAD
import homeassistant.helpers.config_validation as cv
# mypy: allow-untyped-defs
CONF_ENCODING = "encoding"
CONF_TOPIC = "topic"
DEFAULT_ENCODING = "utf-8"

View File

@@ -16,6 +16,9 @@ from homeassistant.const import (
from homeassistant.helpers.event import async_track_state_change, async_track_same_state
from homeassistant.helpers import condition, config_validation as cv, template
# mypy: allow-untyped-defs, no-check-untyped-defs
TRIGGER_SCHEMA = vol.All(
vol.Schema(
{

View File

@@ -9,6 +9,9 @@ from homeassistant.const import MATCH_ALL, CONF_PLATFORM, CONF_FOR
from homeassistant.helpers import config_validation as cv, template
from homeassistant.helpers.event import async_track_state_change, async_track_same_state
# mypy: allow-untyped-calls, allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
CONF_ENTITY_ID = "entity_id"

View File

@@ -14,6 +14,9 @@ from homeassistant.const import (
from homeassistant.helpers.event import async_track_sunrise, async_track_sunset
import homeassistant.helpers.config_validation as cv
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = vol.Schema(

View File

@@ -10,6 +10,9 @@ from homeassistant.helpers import condition
from homeassistant.helpers.event import async_track_same_state, async_track_template
from homeassistant.helpers import config_validation as cv, template
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = IF_ACTION_SCHEMA = vol.Schema(

View File

@@ -8,6 +8,9 @@ from homeassistant.const import CONF_AT, CONF_PLATFORM
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
TRIGGER_SCHEMA = vol.Schema(

View File

@@ -8,6 +8,9 @@ from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.event import async_track_time_change
# mypy: allow-untyped-defs, no-check-untyped-defs
CONF_HOURS = "hours"
CONF_MINUTES = "minutes"
CONF_SECONDS = "seconds"

View File

@@ -11,6 +11,9 @@ import homeassistant.helpers.config_validation as cv
from . import DOMAIN as AUTOMATION_DOMAIN
# mypy: allow-untyped-defs
DEPENDENCIES = ("webhook",)
_LOGGER = logging.getLogger(__name__)

View File

@@ -12,6 +12,9 @@ from homeassistant.const import (
from homeassistant.helpers.event import async_track_state_change
from homeassistant.helpers import condition, config_validation as cv, location
# mypy: allow-untyped-defs, no-check-untyped-defs
EVENT_ENTER = "enter"
EVENT_LEAVE = "leave"
DEFAULT_EVENT = EVENT_ENTER

View File

@@ -2,10 +2,13 @@
"config": {
"abort": {
"already_configured": "El dispositivo ya est\u00e1 configurado",
"bad_config_file": "Datos err\u00f3neos del archivo de configuraci\u00f3n"
"bad_config_file": "Datos err\u00f3neos del archivo de configuraci\u00f3n",
"link_local_address": "Las direcciones locales de enlace no son compatibles",
"not_axis_device": "El dispositivo descubierto no es un dispositivo de Axis"
},
"error": {
"already_configured": "El dispositivo ya est\u00e1 configurado",
"already_in_progress": "El flujo de configuraci\u00f3n para el dispositivo ya est\u00e1 en progreso.",
"device_unavailable": "El dispositivo no est\u00e1 disponible",
"faulty_credentials": "Credenciales de usuario incorrectas"
},
@@ -15,8 +18,10 @@
"password": "Contrase\u00f1a",
"port": "Puerto",
"username": "Nombre de usuario"
}
},
"title": "Configurar dispositivo Axis"
}
}
},
"title": "Dispositivo Axis"
}
}

View File

@@ -3,10 +3,12 @@
"abort": {
"already_configured": "L'appareil est d\u00e9j\u00e0 configur\u00e9",
"bad_config_file": "Mauvaises donn\u00e9es du fichier de configuration",
"link_local_address": "Les adresses locales ne sont pas prises en charge"
"link_local_address": "Les adresses locales ne sont pas prises en charge",
"not_axis_device": "L'appareil d\u00e9couvert n'est pas un appareil Axis"
},
"error": {
"already_configured": "L'appareil est d\u00e9j\u00e0 configur\u00e9",
"already_in_progress": "Le flux de configuration de l'appareil est d\u00e9j\u00e0 en cours.",
"device_unavailable": "L'appareil n'est pas disponible",
"faulty_credentials": "Mauvaises informations d'identification de l'utilisateur"
},

View File

@@ -13,6 +13,9 @@ from homeassistant.helpers.config_validation import ( # noqa
PLATFORM_SCHEMA_BASE,
)
# mypy: allow-untyped-defs, no-check-untyped-defs
DOMAIN = "binary_sensor"
SCAN_INTERVAL = timedelta(seconds=30)

View File

@@ -143,7 +143,10 @@ class BMWConnectedDriveAccount:
for listener in self._update_listeners:
listener()
except IOError as exception:
_LOGGER.error("Error updating the vehicle state")
_LOGGER.error(
"Could not connect to the BMW Connected Drive portal. "
"The vehicle state could not be updated."
)
_LOGGER.exception(exception)
def add_update_listener(self, listener):

View File

@@ -9,17 +9,17 @@ from . import DOMAIN as BMW_DOMAIN
_LOGGER = logging.getLogger(__name__)
SENSOR_TYPES = {
"lids": ["Doors", "opening"],
"windows": ["Windows", "opening"],
"door_lock_state": ["Door lock state", "safety"],
"lights_parking": ["Parking lights", "light"],
"condition_based_services": ["Condition based services", "problem"],
"check_control_messages": ["Control messages", "problem"],
"lids": ["Doors", "opening", "mdi:car-door"],
"windows": ["Windows", "opening", "mdi:car-door"],
"door_lock_state": ["Door lock state", "safety", "mdi:car-key"],
"lights_parking": ["Parking lights", "light", "mdi:car-parking-lights"],
"condition_based_services": ["Condition based services", "problem", "mdi:wrench"],
"check_control_messages": ["Control messages", "problem", "mdi:car-tire-alert"],
}
SENSOR_TYPES_ELEC = {
"charging_status": ["Charging status", "power"],
"connection_status": ["Connection status", "plug"],
"charging_status": ["Charging status", "power", "mdi:ev-station"],
"connection_status": ["Connection status", "plug", "mdi:car-electric"],
}
SENSOR_TYPES_ELEC.update(SENSOR_TYPES)
@@ -35,24 +35,28 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
if vehicle.has_hv_battery:
_LOGGER.debug("BMW with a high voltage battery")
for key, value in sorted(SENSOR_TYPES_ELEC.items()):
device = BMWConnectedDriveSensor(
account, vehicle, key, value[0], value[1]
)
devices.append(device)
if key in vehicle.available_attributes:
device = BMWConnectedDriveSensor(
account, vehicle, key, value[0], value[1], value[2]
)
devices.append(device)
elif vehicle.has_internal_combustion_engine:
_LOGGER.debug("BMW with an internal combustion engine")
for key, value in sorted(SENSOR_TYPES.items()):
device = BMWConnectedDriveSensor(
account, vehicle, key, value[0], value[1]
)
devices.append(device)
if key in vehicle.available_attributes:
device = BMWConnectedDriveSensor(
account, vehicle, key, value[0], value[1], value[2]
)
devices.append(device)
add_entities(devices, True)
class BMWConnectedDriveSensor(BinarySensorDevice):
"""Representation of a BMW vehicle binary sensor."""
def __init__(self, account, vehicle, attribute: str, sensor_name, device_class):
def __init__(
self, account, vehicle, attribute: str, sensor_name, device_class, icon
):
"""Constructor."""
self._account = account
self._vehicle = vehicle
@@ -61,6 +65,7 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
self._unique_id = "{}-{}".format(self._vehicle.vin, self._attribute)
self._sensor_name = sensor_name
self._device_class = device_class
self._icon = icon
self._state = None
@property
@@ -81,6 +86,11 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
"""Return the name of the binary sensor."""
return self._name
@property
def icon(self):
"""Icon to use in the frontend, if any."""
return self._icon
@property
def device_class(self):
"""Return the class of the binary sensor."""
@@ -112,23 +122,19 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
for report in vehicle_state.condition_based_services:
result.update(self._format_cbs_report(report))
elif self._attribute == "check_control_messages":
check_control_messages = vehicle_state.check_control_messages
if not check_control_messages:
result["check_control_messages"] = "OK"
else:
check_control_messages = vehicle_state.has_check_control_messages
if check_control_messages:
cbs_list = []
for message in check_control_messages:
cbs_list.append(message["ccmDescriptionShort"])
result["check_control_messages"] = cbs_list
else:
result["check_control_messages"] = "OK"
elif self._attribute == "charging_status":
result["charging_status"] = vehicle_state.charging_status.value
# pylint: disable=protected-access
result["last_charging_end_result"] = vehicle_state._attributes[
"lastChargingEndResult"
]
if self._attribute == "connection_status":
# pylint: disable=protected-access
result["connection_status"] = vehicle_state._attributes["connectionStatus"]
result["last_charging_end_result"] = vehicle_state.last_charging_end_result
elif self._attribute == "connection_status":
result["connection_status"] = vehicle_state.connection_status
return sorted(result.items())
@@ -166,8 +172,7 @@ class BMWConnectedDriveSensor(BinarySensorDevice):
# device class plug: On means device is plugged in,
# Off means device is unplugged
if self._attribute == "connection_status":
# pylint: disable=protected-access
self._state = vehicle_state._attributes["connectionStatus"] == "CONNECTED"
self._state = vehicle_state.connection_status == "CONNECTED"
def _format_cbs_report(self, report):
result = {}

View File

@@ -1,11 +1,12 @@
{
"domain": "bmw_connected_drive",
"name": "Bmw connected drive",
"name": "BMW Connected Drive",
"documentation": "https://www.home-assistant.io/components/bmw_connected_drive",
"requirements": [
"bimmer_connected==0.5.3"
"bimmer_connected==0.6.0"
],
"dependencies": [],
"codeowners": [
"@gerard33"
]
}
}

View File

@@ -51,14 +51,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
for account in accounts:
for vehicle in account.account.vehicles:
for attribute_name in vehicle.drive_train_attributes:
device = BMWConnectedDriveSensor(
account, vehicle, attribute_name, attribute_info
)
devices.append(device)
device = BMWConnectedDriveSensor(
account, vehicle, "mileage", attribute_info
)
devices.append(device)
if attribute_name in vehicle.available_attributes:
device = BMWConnectedDriveSensor(
account, vehicle, attribute_name, attribute_info
)
devices.append(device)
add_entities(devices, True)

View File

@@ -34,7 +34,9 @@ TIME_BETWEEN_UPDATES = timedelta(seconds=5)
DEFAULT_NAME = "Broadlink switch"
DEFAULT_TIMEOUT = 10
DEFAULT_RETRY = 2
CONF_SLOTS = "slots"
CONF_RETRY = "retry"
RM_TYPES = [
"rm",
@@ -82,6 +84,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
vol.Optional(CONF_FRIENDLY_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_TYPE, default=SWITCH_TYPES[0]): vol.In(SWITCH_TYPES),
vol.Optional(CONF_TIMEOUT, default=DEFAULT_TIMEOUT): cv.positive_int,
vol.Optional(CONF_RETRY, default=DEFAULT_RETRY): cv.positive_int,
}
)
@@ -96,6 +99,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
friendly_name = config.get(CONF_FRIENDLY_NAME)
mac_addr = binascii.unhexlify(config.get(CONF_MAC).encode().replace(b":", b""))
switch_type = config.get(CONF_TYPE)
retry_times = config.get(CONF_RETRY)
def _get_mp1_slot_name(switch_friendly_name, slot):
"""Get slot name."""
@@ -116,21 +120,26 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
broadlink_device,
device_config.get(CONF_COMMAND_ON),
device_config.get(CONF_COMMAND_OFF),
retry_times,
)
)
elif switch_type in SP1_TYPES:
broadlink_device = broadlink.sp1((ip_addr, 80), mac_addr, None)
switches = [BroadlinkSP1Switch(friendly_name, broadlink_device)]
switches = [BroadlinkSP1Switch(friendly_name, broadlink_device, retry_times)]
elif switch_type in SP2_TYPES:
broadlink_device = broadlink.sp2((ip_addr, 80), mac_addr, None)
switches = [BroadlinkSP2Switch(friendly_name, broadlink_device)]
switches = [BroadlinkSP2Switch(friendly_name, broadlink_device, retry_times)]
elif switch_type in MP1_TYPES:
switches = []
broadlink_device = broadlink.mp1((ip_addr, 80), mac_addr, None)
parent_device = BroadlinkMP1Switch(broadlink_device)
parent_device = BroadlinkMP1Switch(broadlink_device, retry_times)
for i in range(1, 5):
slot = BroadlinkMP1Slot(
_get_mp1_slot_name(friendly_name, i), broadlink_device, i, parent_device
_get_mp1_slot_name(friendly_name, i),
broadlink_device,
i,
parent_device,
retry_times,
)
switches.append(slot)
@@ -146,7 +155,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
class BroadlinkRMSwitch(SwitchDevice, RestoreEntity):
"""Representation of an Broadlink switch."""
def __init__(self, name, friendly_name, device, command_on, command_off):
def __init__(
self, name, friendly_name, device, command_on, command_off, retry_times
):
"""Initialize the switch."""
self.entity_id = ENTITY_ID_FORMAT.format(slugify(name))
self._name = friendly_name
@@ -155,6 +166,8 @@ class BroadlinkRMSwitch(SwitchDevice, RestoreEntity):
self._command_off = command_off
self._device = device
self._is_available = False
self._retry_times = retry_times
_LOGGER.debug("_retry_times : %s", self._retry_times)
async def async_added_to_hass(self):
"""Call when entity about to be added to hass."""
@@ -190,17 +203,17 @@ class BroadlinkRMSwitch(SwitchDevice, RestoreEntity):
def turn_on(self, **kwargs):
"""Turn the device on."""
if self._sendpacket(self._command_on):
if self._sendpacket(self._command_on, self._retry_times):
self._state = True
self.schedule_update_ha_state()
def turn_off(self, **kwargs):
"""Turn the device off."""
if self._sendpacket(self._command_off):
if self._sendpacket(self._command_off, self._retry_times):
self._state = False
self.schedule_update_ha_state()
def _sendpacket(self, packet, retry=2):
def _sendpacket(self, packet, retry):
"""Send packet to device."""
if packet is None:
_LOGGER.debug("Empty packet")
@@ -211,12 +224,13 @@ class BroadlinkRMSwitch(SwitchDevice, RestoreEntity):
if retry < 1:
_LOGGER.error("Error during sending a packet: %s", error)
return False
if not self._auth():
if not self._auth(self._retry_times):
return False
return self._sendpacket(packet, retry - 1)
return True
def _auth(self, retry=2):
def _auth(self, retry):
_LOGGER.debug("_auth : retry=%s", retry)
try:
auth = self._device.auth()
except OSError:
@@ -231,14 +245,14 @@ class BroadlinkRMSwitch(SwitchDevice, RestoreEntity):
class BroadlinkSP1Switch(BroadlinkRMSwitch):
"""Representation of an Broadlink switch."""
def __init__(self, friendly_name, device):
def __init__(self, friendly_name, device, retry_times):
"""Initialize the switch."""
super().__init__(friendly_name, friendly_name, device, None, None)
super().__init__(friendly_name, friendly_name, device, None, None, retry_times)
self._command_on = 1
self._command_off = 0
self._load_power = None
def _sendpacket(self, packet, retry=2):
def _sendpacket(self, packet, retry):
"""Send packet to device."""
try:
self._device.set_power(packet)
@@ -246,7 +260,7 @@ class BroadlinkSP1Switch(BroadlinkRMSwitch):
if retry < 1:
_LOGGER.error("Error during sending a packet: %s", error)
return False
if not self._auth():
if not self._auth(self._retry_times):
return False
return self._sendpacket(packet, retry - 1)
return True
@@ -275,10 +289,11 @@ class BroadlinkSP2Switch(BroadlinkSP1Switch):
def update(self):
"""Synchronize state with switch."""
self._update()
self._update(self._retry_times)
def _update(self, retry=2):
def _update(self, retry):
"""Update the state of the device."""
_LOGGER.debug("_update : retry=%s", retry)
try:
state = self._device.check_power()
load_power = self._device.get_energy()
@@ -287,7 +302,7 @@ class BroadlinkSP2Switch(BroadlinkSP1Switch):
_LOGGER.error("Error during updating the state: %s", error)
self._is_available = False
return
if not self._auth():
if not self._auth(self._retry_times):
return
return self._update(retry - 1)
if state is None and retry > 0:
@@ -300,9 +315,9 @@ class BroadlinkSP2Switch(BroadlinkSP1Switch):
class BroadlinkMP1Slot(BroadlinkRMSwitch):
"""Representation of a slot of Broadlink switch."""
def __init__(self, friendly_name, device, slot, parent_device):
def __init__(self, friendly_name, device, slot, parent_device, retry_times):
"""Initialize the slot of switch."""
super().__init__(friendly_name, friendly_name, device, None, None)
super().__init__(friendly_name, friendly_name, device, None, None, retry_times)
self._command_on = 1
self._command_off = 0
self._slot = slot
@@ -313,7 +328,7 @@ class BroadlinkMP1Slot(BroadlinkRMSwitch):
"""Return true if unable to access real state of entity."""
return False
def _sendpacket(self, packet, retry=2):
def _sendpacket(self, packet, retry):
"""Send packet to device."""
try:
self._device.set_power(self._slot, packet)
@@ -322,7 +337,7 @@ class BroadlinkMP1Slot(BroadlinkRMSwitch):
_LOGGER.error("Error during sending a packet: %s", error)
self._is_available = False
return False
if not self._auth():
if not self._auth(self._retry_times):
return False
return self._sendpacket(packet, max(0, retry - 1))
self._is_available = True
@@ -337,15 +352,20 @@ class BroadlinkMP1Slot(BroadlinkRMSwitch):
"""Trigger update for all switches on the parent device."""
self._parent_device.update()
self._state = self._parent_device.get_outlet_status(self._slot)
if self._state is None:
self._is_available = False
else:
self._is_available = True
class BroadlinkMP1Switch:
"""Representation of a Broadlink switch - To fetch states of all slots."""
def __init__(self, device):
def __init__(self, device, retry_times):
"""Initialize the switch."""
self._device = device
self._states = None
self._retry_times = retry_times
def get_outlet_status(self, slot):
"""Get status of outlet from cached status list."""
@@ -356,9 +376,9 @@ class BroadlinkMP1Switch:
@Throttle(TIME_BETWEEN_UPDATES)
def update(self):
"""Fetch new state data for this device."""
self._update()
self._update(self._retry_times)
def _update(self, retry=2):
def _update(self, retry):
"""Update the state of the device."""
try:
states = self._device.check_power()
@@ -366,14 +386,14 @@ class BroadlinkMP1Switch:
if retry < 1:
_LOGGER.error("Error during updating the state: %s", error)
return
if not self._auth():
if not self._auth(self._retry_times):
return
return self._update(max(0, retry - 1))
if states is None and retry > 0:
return self._update(max(0, retry - 1))
self._states = states
def _auth(self, retry=2):
def _auth(self, retry):
"""Authenticate the device."""
try:
auth = self._device.auth()

View File

@@ -108,11 +108,11 @@ SENSOR_TYPES = {
"rainchance_3d": ["Rainchance 3d", "%", "mdi:weather-pouring"],
"rainchance_4d": ["Rainchance 4d", "%", "mdi:weather-pouring"],
"rainchance_5d": ["Rainchance 5d", "%", "mdi:weather-pouring"],
"sunchance_1d": ["Sunchance 1d", "%", "mdi:weather-partlycloudy"],
"sunchance_2d": ["Sunchance 2d", "%", "mdi:weather-partlycloudy"],
"sunchance_3d": ["Sunchance 3d", "%", "mdi:weather-partlycloudy"],
"sunchance_4d": ["Sunchance 4d", "%", "mdi:weather-partlycloudy"],
"sunchance_5d": ["Sunchance 5d", "%", "mdi:weather-partlycloudy"],
"sunchance_1d": ["Sunchance 1d", "%", "mdi:weather-partly-cloudy"],
"sunchance_2d": ["Sunchance 2d", "%", "mdi:weather-partly-cloudy"],
"sunchance_3d": ["Sunchance 3d", "%", "mdi:weather-partly-cloudy"],
"sunchance_4d": ["Sunchance 4d", "%", "mdi:weather-partly-cloudy"],
"sunchance_5d": ["Sunchance 5d", "%", "mdi:weather-partly-cloudy"],
"windforce_1d": ["Wind force 1d", "Bft", "mdi:weather-windy"],
"windforce_2d": ["Wind force 2d", "Bft", "mdi:weather-windy"],
"windforce_3d": ["Wind force 3d", "Bft", "mdi:weather-windy"],

View File

@@ -17,6 +17,9 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.template import DATE_STR_FORMAT
from homeassistant.util import dt
# mypy: allow-untyped-defs, no-check-untyped-defs
_LOGGER = logging.getLogger(__name__)
DOMAIN = "calendar"

View File

@@ -52,6 +52,9 @@ from homeassistant.setup import async_when_setup
from .const import DOMAIN, DATA_CAMERA_PREFS
from .prefs import CameraPreferences
# mypy: allow-untyped-calls, allow-untyped-defs
_LOGGER = logging.getLogger(__name__)
SERVICE_ENABLE_MOTION = "enable_motion_detection"
@@ -311,7 +314,7 @@ class Camera(Entity):
"""Initialize a camera."""
self.is_streaming = False
self.content_type = DEFAULT_CONTENT_TYPE
self.access_tokens = collections.deque([], 2)
self.access_tokens: collections.deque = collections.deque([], 2)
self.async_update_token()
@property

View File

@@ -1,6 +1,9 @@
"""Preference management for camera component."""
from .const import DOMAIN, PREF_PRELOAD_STREAM
# mypy: allow-untyped-defs, no-check-untyped-defs
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 1
_UNDEF = object()

View File

@@ -0,0 +1,10 @@
{
"config": {
"step": {
"confirm": {
"title": "Google Cast"
}
},
"title": "Google Cast"
}
}

View File

@@ -3,7 +3,7 @@
"name": "Cisco mobility express",
"documentation": "https://www.home-assistant.io/components/cisco_mobility_express",
"requirements": [
"ciscomobilityexpress==0.3.1"
"ciscomobilityexpress==0.3.3"
],
"dependencies": [],
"codeowners": ["@fbradyirl"]

View File

@@ -70,7 +70,6 @@ from .const import (
SUPPORT_TARGET_TEMPERATURE_RANGE,
SUPPORT_TARGET_TEMPERATURE,
)
from .reproduce_state import async_reproduce_states # noqa
DEFAULT_MIN_TEMP = 7
DEFAULT_MAX_TEMP = 35

View File

@@ -108,7 +108,7 @@ ATTR_TARGET_TEMP_STEP = "target_temp_step"
DEFAULT_MIN_TEMP = 7
DEFAULT_MAX_TEMP = 35
DEFAULT_MIN_HUMITIDY = 30
DEFAULT_MIN_HUMIDITY = 30
DEFAULT_MAX_HUMIDITY = 99
DOMAIN = "climate"

View File

@@ -5,7 +5,6 @@ from typing import Iterable, Optional
from homeassistant.const import ATTR_TEMPERATURE
from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.loader import bind_hass
from .const import (
ATTR_AUX_HEAT,
@@ -69,7 +68,6 @@ async def _async_reproduce_states(
await call_service(SERVICE_SET_HUMIDITY, [ATTR_HUMIDITY])
@bind_hass
async def async_reproduce_states(
hass: HomeAssistantType, states: Iterable[State], context: Optional[Context] = None
) -> None:

View File

@@ -7,6 +7,7 @@ import aiohttp
import async_timeout
from hass_nabucasa import cloud_api
from homeassistant.core import callback
from homeassistant.const import CLOUD_NEVER_EXPOSED_ENTITIES
from homeassistant.helpers import entity_registry
from homeassistant.helpers.event import async_call_later
@@ -95,9 +96,14 @@ class AlexaConfig(alexa_config.AbstractConfig):
entity_config = entity_configs.get(entity_id, {})
return entity_config.get(PREF_SHOULD_EXPOSE, DEFAULT_SHOULD_EXPOSE)
@callback
def async_invalidate_access_token(self):
"""Invalidate access token."""
self._token_valid = None
async def async_get_access_token(self):
"""Get an access token."""
if self._token_valid is not None and self._token_valid < utcnow():
if self._token_valid is not None and self._token_valid > utcnow():
return self._token
resp = await cloud_api.async_alexa_access_token(self._cloud)

View File

@@ -2,7 +2,7 @@
"domain": "cloud",
"name": "Cloud",
"documentation": "https://www.home-assistant.io/components/cloud",
"requirements": ["hass-nabucasa==0.16"],
"requirements": ["hass-nabucasa==0.17"],
"dependencies": ["http", "webhook"],
"codeowners": ["@home-assistant/cloud"]
}

View File

@@ -1,6 +1,10 @@
"""Http views to control the config manager."""
import aiohttp.web_exceptions
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.auth.permissions.const import CAT_CONFIG_ENTRIES
from homeassistant.components import websocket_api
from homeassistant.components.http import HomeAssistantView
from homeassistant.exceptions import Unauthorized
from homeassistant.helpers.data_entry_flow import (
@@ -17,12 +21,18 @@ async def async_setup(hass):
hass.http.register_view(ConfigManagerFlowIndexView(hass.config_entries.flow))
hass.http.register_view(ConfigManagerFlowResourceView(hass.config_entries.flow))
hass.http.register_view(ConfigManagerAvailableFlowView)
hass.http.register_view(
OptionManagerFlowIndexView(hass.config_entries.options.flow)
)
hass.http.register_view(
OptionManagerFlowResourceView(hass.config_entries.options.flow)
)
hass.components.websocket_api.async_register_command(config_entries_progress)
hass.components.websocket_api.async_register_command(system_options_list)
hass.components.websocket_api.async_register_command(system_options_update)
return True
@@ -54,8 +64,18 @@ class ConfigManagerEntryIndexView(HomeAssistantView):
"""List available config entries."""
hass = request.app["hass"]
return self.json(
[
results = []
for entry in hass.config_entries.async_entries():
handler = config_entries.HANDLERS.get(entry.domain)
supports_options = (
# Guard in case handler is no longer registered (custom compnoent etc)
handler is not None
# pylint: disable=comparison-with-callable
and handler.async_get_options_flow
!= config_entries.ConfigFlow.async_get_options_flow
)
results.append(
{
"entry_id": entry.entry_id,
"domain": entry.domain,
@@ -63,14 +83,11 @@ class ConfigManagerEntryIndexView(HomeAssistantView):
"source": entry.source,
"state": entry.state,
"connection_class": entry.connection_class,
"supports_options": hasattr(
config_entries.HANDLERS.get(entry.domain),
"async_get_options_flow",
),
"supports_options": supports_options,
}
for entry in hass.config_entries.async_entries()
]
)
)
return self.json(results)
class ConfigManagerEntryResourceView(HomeAssistantView):
@@ -101,23 +118,8 @@ class ConfigManagerFlowIndexView(FlowManagerIndexView):
name = "api:config:config_entries:flow"
async def get(self, request):
"""List flows that are in progress but not started by a user.
Example of a non-user initiated flow is a discovered Hue hub that
requires user interaction to finish setup.
"""
if not request["hass_user"].is_admin:
raise Unauthorized(perm_category=CAT_CONFIG_ENTRIES, permission="add")
hass = request.app["hass"]
return self.json(
[
flw
for flw in hass.config_entries.flow.async_progress()
if flw["context"]["source"] != config_entries.SOURCE_USER
]
)
"""Not implemented."""
raise aiohttp.web_exceptions.HTTPMethodNotAllowed("GET", ["POST"])
# pylint: disable=arguments-differ
async def post(self, request):
@@ -187,8 +189,8 @@ class ConfigManagerAvailableFlowView(HomeAssistantView):
class OptionManagerFlowIndexView(FlowManagerIndexView):
"""View to create option flows."""
url = "/api/config/config_entries/entry/option/flow"
name = "api:config:config_entries:entry:resource:option:flow"
url = "/api/config/config_entries/options/flow"
name = "api:config:config_entries:option:flow"
# pylint: disable=arguments-differ
async def post(self, request):
@@ -224,3 +226,62 @@ class OptionManagerFlowResourceView(FlowManagerResourceView):
# pylint: disable=no-value-for-parameter
return await super().post(request, flow_id)
@websocket_api.require_admin
@websocket_api.websocket_command({"type": "config_entries/flow/progress"})
def config_entries_progress(hass, connection, msg):
"""List flows that are in progress but not started by a user.
Example of a non-user initiated flow is a discovered Hue hub that
requires user interaction to finish setup.
"""
connection.send_result(
msg["id"],
[
flw
for flw in hass.config_entries.flow.async_progress()
if flw["context"]["source"] != config_entries.SOURCE_USER
],
)
@websocket_api.require_admin
@websocket_api.async_response
@websocket_api.websocket_command(
{"type": "config_entries/system_options/list", "entry_id": str}
)
async def system_options_list(hass, connection, msg):
"""List all system options for a config entry."""
entry_id = msg["entry_id"]
entry = hass.config_entries.async_get_entry(entry_id)
if entry:
connection.send_result(msg["id"], entry.system_options.as_dict())
@websocket_api.require_admin
@websocket_api.async_response
@websocket_api.websocket_command(
{
"type": "config_entries/system_options/update",
"entry_id": str,
vol.Optional("disable_new_entities"): bool,
}
)
async def system_options_update(hass, connection, msg):
"""Update config entry system options."""
changes = dict(msg)
changes.pop("id")
changes.pop("type")
entry_id = changes.pop("entry_id")
entry = hass.config_entries.async_get_entry(entry_id)
if entry is None:
connection.send_error(
msg["id"], websocket_api.const.ERR_NOT_FOUND, "Config entry not found"
)
return
hass.config_entries.async_update_entry(entry, system_options=changes)
connection.send_result(msg["id"], entry.system_options.as_dict())

View File

@@ -11,51 +11,18 @@ from homeassistant.components.websocket_api.decorators import (
)
from homeassistant.helpers import config_validation as cv
WS_TYPE_LIST = "config/entity_registry/list"
SCHEMA_WS_LIST = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend(
{vol.Required("type"): WS_TYPE_LIST}
)
WS_TYPE_GET = "config/entity_registry/get"
SCHEMA_WS_GET = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend(
{vol.Required("type"): WS_TYPE_GET, vol.Required("entity_id"): cv.entity_id}
)
WS_TYPE_UPDATE = "config/entity_registry/update"
SCHEMA_WS_UPDATE = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend(
{
vol.Required("type"): WS_TYPE_UPDATE,
vol.Required("entity_id"): cv.entity_id,
# If passed in, we update value. Passing None will remove old value.
vol.Optional("name"): vol.Any(str, None),
vol.Optional("new_entity_id"): str,
}
)
WS_TYPE_REMOVE = "config/entity_registry/remove"
SCHEMA_WS_REMOVE = websocket_api.BASE_COMMAND_MESSAGE_SCHEMA.extend(
{vol.Required("type"): WS_TYPE_REMOVE, vol.Required("entity_id"): cv.entity_id}
)
async def async_setup(hass):
"""Enable the Entity Registry views."""
hass.components.websocket_api.async_register_command(
WS_TYPE_LIST, websocket_list_entities, SCHEMA_WS_LIST
)
hass.components.websocket_api.async_register_command(
WS_TYPE_GET, websocket_get_entity, SCHEMA_WS_GET
)
hass.components.websocket_api.async_register_command(
WS_TYPE_UPDATE, websocket_update_entity, SCHEMA_WS_UPDATE
)
hass.components.websocket_api.async_register_command(
WS_TYPE_REMOVE, websocket_remove_entity, SCHEMA_WS_REMOVE
)
hass.components.websocket_api.async_register_command(websocket_list_entities)
hass.components.websocket_api.async_register_command(websocket_get_entity)
hass.components.websocket_api.async_register_command(websocket_update_entity)
hass.components.websocket_api.async_register_command(websocket_remove_entity)
return True
@async_response
@websocket_api.websocket_command({vol.Required("type"): "config/entity_registry/list"})
async def websocket_list_entities(hass, connection, msg):
"""Handle list registry entries command.
@@ -70,6 +37,12 @@ async def websocket_list_entities(hass, connection, msg):
@async_response
@websocket_api.websocket_command(
{
vol.Required("type"): "config/entity_registry/get",
vol.Required("entity_id"): cv.entity_id,
}
)
async def websocket_get_entity(hass, connection, msg):
"""Handle get entity registry entry command.
@@ -89,6 +62,17 @@ async def websocket_get_entity(hass, connection, msg):
@require_admin
@async_response
@websocket_api.websocket_command(
{
vol.Required("type"): "config/entity_registry/update",
vol.Required("entity_id"): cv.entity_id,
# If passed in, we update value. Passing None will remove old value.
vol.Optional("name"): vol.Any(str, None),
vol.Optional("new_entity_id"): str,
# We only allow setting disabled_by user via API.
vol.Optional("disabled_by"): vol.Any("user", None),
}
)
async def websocket_update_entity(hass, connection, msg):
"""Handle update entity websocket command.
@@ -107,6 +91,9 @@ async def websocket_update_entity(hass, connection, msg):
if "name" in msg:
changes["name"] = msg["name"]
if "disabled_by" in msg:
changes["disabled_by"] = msg["disabled_by"]
if "new_entity_id" in msg and msg["new_entity_id"] != msg["entity_id"]:
changes["new_entity_id"] = msg["new_entity_id"]
if hass.states.get(msg["new_entity_id"]) is not None:
@@ -132,6 +119,12 @@ async def websocket_update_entity(hass, connection, msg):
@require_admin
@async_response
@websocket_api.websocket_command(
{
vol.Required("type"): "config/entity_registry/remove",
vol.Required("entity_id"): cv.entity_id,
}
)
async def websocket_remove_entity(hass, connection, msg):
"""Handle remove entity websocket command.

View File

@@ -7,7 +7,7 @@ import voluptuous as vol
from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA
from homeassistant.components.climate.const import (
HVAC_MODE_OFF,
HVAC_MODE_AUTO,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_FAN_ONLY,
@@ -33,14 +33,14 @@ AVAILABLE_MODES = [
HVAC_MODE_HEAT,
HVAC_MODE_COOL,
HVAC_MODE_DRY,
HVAC_MODE_AUTO,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_FAN_ONLY,
]
CM_TO_HA_STATE = {
"heat": HVAC_MODE_HEAT,
"cool": HVAC_MODE_COOL,
"auto": HVAC_MODE_AUTO,
"auto": HVAC_MODE_HEAT_COOL,
"dry": HVAC_MODE_DRY,
"fan": HVAC_MODE_FAN_ONLY,
}

View File

@@ -32,6 +32,9 @@ from homeassistant.const import (
STATE_CLOSING,
)
# mypy: allow-untyped-calls, allow-incomplete-defs, allow-untyped-defs
_LOGGER = logging.getLogger(__name__)
DOMAIN = "cover"

View File

@@ -193,7 +193,7 @@ SENSOR_TYPES = {
"%",
"%",
"%",
"mdi:weather-partlycloudy",
"mdi:weather-partly-cloudy",
["currently", "hourly", "daily"],
],
"humidity": [
@@ -380,11 +380,11 @@ CONDITION_PICTURES = {
"cloudy": ["/static/images/darksky/weather-cloudy.svg", "mdi:weather-cloudy"],
"partly-cloudy-day": [
"/static/images/darksky/weather-partlycloudy.svg",
"mdi:weather-partlycloudy",
"mdi:weather-partly-cloudy",
],
"partly-cloudy-night": [
"/static/images/darksky/weather-cloudy.svg",
"mdi:weather-partlycloudy",
"mdi:weather-partly-cloudy",
],
}

View File

@@ -40,5 +40,16 @@
}
},
"title": "deCONZ Zigbee gateway"
},
"options": {
"step": {
"deconz_devices": {
"data": {
"allow_clip_sensor": "Allow deCONZ CLIP sensors",
"allow_deconz_groups": "Allow deCONZ light groups"
},
"description": "Configure visibility of deCONZ device types"
}
}
}
}

View File

@@ -2,7 +2,9 @@
"config": {
"abort": {
"already_configured": "El Bridge ya est\u00e1 configurado",
"already_in_progress": "El flujo de configuraci\u00f3n para el puente ya est\u00e1 en progreso.",
"no_bridges": "No se descubrieron puentes deCONZ",
"not_deconz_bridge": "No es un puente deCONZ",
"one_instance_only": "El componente solo admite una instancia deCONZ"
},
"error": {
@@ -13,7 +15,8 @@
"data": {
"allow_clip_sensor": "Permitir la importaci\u00f3n de sensores virtuales",
"allow_deconz_groups": "Permitir la importaci\u00f3n de grupos deCONZ"
}
},
"description": "\u00bfDesea configurar Home Assistant para conectarse a la puerta de enlace deCONZ proporcionada por el complemento hass.io {addon}?"
},
"init": {
"data": {
@@ -23,6 +26,7 @@
"title": "Definir el gateway deCONZ"
},
"link": {
"description": "Desbloquee su puerta de enlace deCONZ para registrarse con Home Assistant. \n\n 1. Vaya a Configuraci\u00f3n deCONZ - > Gateway - > Avanzado \n 2. Presione el bot\u00f3n \"Autenticar aplicaci\u00f3n\"",
"title": "Enlazar con deCONZ"
},
"options": {

View File

@@ -2,7 +2,9 @@
"config": {
"abort": {
"already_configured": "Ce pont est d\u00e9j\u00e0 configur\u00e9",
"already_in_progress": "Le flux de configuration pour le pont est d\u00e9j\u00e0 en cours.",
"no_bridges": "Aucun pont deCONZ n'a \u00e9t\u00e9 d\u00e9couvert",
"not_deconz_bridge": "Pas un pont deCONZ",
"one_instance_only": "Le composant prend uniquement en charge une instance deCONZ",
"updated_instance": "Instance deCONZ mise \u00e0 jour avec la nouvelle adresse d'h\u00f4te"
},

View File

@@ -0,0 +1,17 @@
{
"config": {
"step": {
"init": {
"data": {
"host": "Host",
"port": "Port"
}
},
"options": {
"data": {
"allow_clip_sensor": "Dopusti uvoz virtualnih senzora"
}
}
}
}
}

View File

@@ -25,10 +25,10 @@
"host": "\u4e3b\u6a5f\u7aef",
"port": "\u901a\u8a0a\u57e0"
},
"title": "\u5b9a\u7fa9 deCONZ \u7db2\u95dc"
"title": "\u5b9a\u7fa9 deCONZ \u9598\u9053\u5668"
},
"link": {
"description": "\u89e3\u9664 deCONZ \u7db2\u95dc\u9396\u5b9a\uff0c\u4ee5\u65bc Home Assistant \u9032\u884c\u8a3b\u518a\u3002\n\n1. \u9032\u5165 deCONZ \u7cfb\u7d71\u8a2d\u5b9a -> \u7db2\u95dc -> \u9032\u968e\u8a2d\u5b9a\n2. \u6309\u4e0b\u300c\u8a8d\u8b49\u7a0b\u5f0f\uff08Authenticate app\uff09\u300d\u6309\u9215",
"description": "\u89e3\u9664 deCONZ \u9598\u9053\u5668\u9396\u5b9a\uff0c\u4ee5\u65bc Home Assistant \u9032\u884c\u8a3b\u518a\u3002\n\n1. \u9032\u5165 deCONZ \u7cfb\u7d71\u8a2d\u5b9a -> \u9598\u9053\u5668 -> \u9032\u968e\u8a2d\u5b9a\n2. \u6309\u4e0b\u300c\u8a8d\u8b49\u7a0b\u5f0f\uff08Authenticate app\uff09\u300d\u6309\u9215",
"title": "\u9023\u7d50\u81f3 deCONZ"
},
"options": {
@@ -39,6 +39,6 @@
"title": "deCONZ \u9644\u52a0\u8a2d\u5b9a\u9078\u9805"
}
},
"title": "deCONZ Zigbee \u7db2\u95dc"
"title": "deCONZ Zigbee \u9598\u9053\u5668"
}
}

View File

@@ -1,5 +1,6 @@
"""Config flow to configure deCONZ component."""
import asyncio
from copy import copy
import async_timeout
import voluptuous as vol
@@ -12,7 +13,13 @@ from homeassistant.const import CONF_API_KEY, CONF_HOST, CONF_PORT
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from .const import CONF_BRIDGEID, DEFAULT_PORT, DOMAIN
from .const import (
CONF_ALLOW_CLIP_SENSOR,
CONF_ALLOW_DECONZ_GROUPS,
CONF_BRIDGEID,
DEFAULT_PORT,
DOMAIN,
)
DECONZ_MANUFACTURERURL = "http://www.dresden-elektronik.de"
CONF_SERIAL = "serial"
@@ -45,6 +52,12 @@ class DeconzFlowHandler(config_entries.ConfigFlow):
_hassio_discovery = None
@staticmethod
@callback
def async_get_options_flow(config_entry):
"""Get the options flow for this handler."""
return DeconzOptionsFlowHandler(config_entry)
def __init__(self):
"""Initialize the deCONZ config flow."""
self.bridges = []
@@ -144,8 +157,12 @@ class DeconzFlowHandler(config_entries.ConfigFlow):
async def _update_entry(self, entry, host):
"""Update existing entry."""
if entry.data[CONF_HOST] == host:
return self.async_abort(reason="already_configured")
entry.data[CONF_HOST] = host
self.hass.config_entries.async_update_entry(entry)
return self.async_abort(reason="updated_instance")
async def async_step_ssdp(self, discovery_info):
"""Handle a discovered deCONZ bridge."""
@@ -162,8 +179,7 @@ class DeconzFlowHandler(config_entries.ConfigFlow):
if uuid in gateways:
entry = gateways[uuid].config_entry
await self._update_entry(entry, discovery_info[CONF_HOST])
return self.async_abort(reason="updated_instance")
return await self._update_entry(entry, discovery_info[CONF_HOST])
bridgeid = discovery_info[ATTR_SERIAL]
if any(
@@ -211,8 +227,7 @@ class DeconzFlowHandler(config_entries.ConfigFlow):
if bridgeid in gateway_entries:
entry = gateway_entries[bridgeid]
await self._update_entry(entry, user_input[CONF_HOST])
return self.async_abort(reason="updated_instance")
return await self._update_entry(entry, user_input[CONF_HOST])
self._hassio_discovery = user_input
@@ -234,3 +249,41 @@ class DeconzFlowHandler(config_entries.ConfigFlow):
step_id="hassio_confirm",
description_placeholders={"addon": self._hassio_discovery["addon"]},
)
class DeconzOptionsFlowHandler(config_entries.OptionsFlow):
"""Handle deCONZ options."""
def __init__(self, config_entry):
"""Initialize deCONZ options flow."""
self.config_entry = config_entry
self.options = copy(config_entry.options)
async def async_step_init(self, user_input=None):
"""Manage the deCONZ options."""
return await self.async_step_deconz_devices()
async def async_step_deconz_devices(self, user_input=None):
"""Manage the deconz devices options."""
if user_input is not None:
self.options[CONF_ALLOW_CLIP_SENSOR] = user_input[CONF_ALLOW_CLIP_SENSOR]
self.options[CONF_ALLOW_DECONZ_GROUPS] = user_input[
CONF_ALLOW_DECONZ_GROUPS
]
return self.async_create_entry(title="", data=self.options)
return self.async_show_form(
step_id="deconz_devices",
data_schema=vol.Schema(
{
vol.Optional(
CONF_ALLOW_CLIP_SENSOR,
default=self.config_entry.options[CONF_ALLOW_CLIP_SENSOR],
): bool,
vol.Optional(
CONF_ALLOW_DECONZ_GROUPS,
default=self.config_entry.options[CONF_ALLOW_DECONZ_GROUPS],
): bool,
}
),
)

View File

@@ -14,8 +14,6 @@ from .const import COVER_TYPES, DAMPERS, NEW_LIGHT, WINDOW_COVERS
from .deconz_device import DeconzDevice
from .gateway import get_gateway_from_config_entry
ZIGBEE_SPEC = ["lumi.curtain"]
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Old way of setting up deCONZ platforms."""
@@ -35,13 +33,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
entities = []
for light in lights:
if light.type in COVER_TYPES:
if light.modelid in ZIGBEE_SPEC:
entities.append(DeconzCoverZigbeeSpec(light, gateway))
else:
entities.append(DeconzCover(light, gateway))
entities.append(DeconzCover(light, gateway))
async_add_entities(entities, True)
@@ -69,14 +62,12 @@ class DeconzCover(DeconzDevice, CoverDevice):
@property
def current_cover_position(self):
"""Return the current position of the cover."""
if self.is_closed:
return 0
return int(self._device.brightness / 255 * 100)
return 100 - int(self._device.brightness / 255 * 100)
@property
def is_closed(self):
"""Return if the cover is closed."""
return not self._device.state
return self._device.state
@property
def device_class(self):
@@ -96,9 +87,9 @@ class DeconzCover(DeconzDevice, CoverDevice):
position = kwargs[ATTR_POSITION]
data = {"on": False}
if position > 0:
if position < 100:
data["on"] = True
data["bri"] = int(position / 100 * 255)
data["bri"] = 255 - int(position / 100 * 255)
await self._device.async_set_state(data)
@@ -116,28 +107,3 @@ class DeconzCover(DeconzDevice, CoverDevice):
"""Stop cover."""
data = {"bri_inc": 0}
await self._device.async_set_state(data)
class DeconzCoverZigbeeSpec(DeconzCover):
"""Zigbee spec is the inverse of how deCONZ normally reports attributes."""
@property
def current_cover_position(self):
"""Return the current position of the cover."""
return 100 - int(self._device.brightness / 255 * 100)
@property
def is_closed(self):
"""Return if the cover is closed."""
return self._device.state
async def async_set_cover_position(self, **kwargs):
"""Move the cover to a specific position."""
position = kwargs[ATTR_POSITION]
data = {"on": False}
if position < 100:
data["on"] = True
data["bri"] = 255 - int(position / 100 * 255)
await self._device.async_set_state(data)

View File

@@ -63,12 +63,12 @@ class DeconzGateway:
@property
def allow_clip_sensor(self) -> bool:
"""Allow loading clip sensor from gateway."""
return self.config_entry.data.get(CONF_ALLOW_CLIP_SENSOR, True)
return self.config_entry.options.get(CONF_ALLOW_CLIP_SENSOR, True)
@property
def allow_deconz_groups(self) -> bool:
"""Allow loading deCONZ groups from gateway."""
return self.config_entry.data.get(CONF_ALLOW_DECONZ_GROUPS, True)
return self.config_entry.options.get(CONF_ALLOW_DECONZ_GROUPS, True)
async def async_update_device_registry(self):
"""Update device registry."""

View File

@@ -40,5 +40,16 @@
"one_instance_only": "Component only supports one deCONZ instance",
"updated_instance": "Updated deCONZ instance with new host address"
}
},
"options": {
"step": {
"deconz_devices": {
"description": "Configure visibility of deCONZ device types",
"data": {
"allow_clip_sensor": "Allow deCONZ CLIP sensors",
"allow_deconz_groups": "Allow deCONZ light groups"
}
}
}
}
}

View File

@@ -50,7 +50,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
)
await line.get_passages()
if line.passages is None:
_LOGGER.warning("No data recieved from De Lijn")
_LOGGER.warning("No data received from De Lijn")
return
sensors.append(DeLijnPublicTransportSensor(line, name))
@@ -71,7 +71,7 @@ class DeLijnPublicTransportSensor(Entity):
"""Get the latest data from the De Lijn API."""
await self.line.get_passages()
if self.line.passages is None:
_LOGGER.warning("No data recieved from De Lijn")
_LOGGER.warning("No data received from De Lijn")
return
try:
first = self.line.passages[0]

View File

@@ -176,8 +176,15 @@ async def async_setup(hass, config):
async def finish_setup(hass, config):
"""Finish set up once demo platforms are set up."""
lights = sorted(hass.states.async_entity_ids("light"))
switches = sorted(hass.states.async_entity_ids("switch"))
switches = None
lights = None
while not switches and not lights:
# Not all platforms might be loaded.
if switches is not None:
await asyncio.sleep(0)
switches = sorted(hass.states.async_entity_ids("switch"))
lights = sorted(hass.states.async_entity_ids("light"))
# Set up history graph
await bootstrap.async_setup_component(

View File

@@ -34,13 +34,13 @@ class DemoFan(FanEntity):
self._supported_features = supported_features
self._speed = STATE_OFF
self.oscillating = None
self.direction = None
self._direction = None
self._name = name
if supported_features & SUPPORT_OSCILLATE:
self.oscillating = False
if supported_features & SUPPORT_DIRECTION:
self.direction = "forward"
self._direction = "forward"
@property
def name(self) -> str:
@@ -80,7 +80,7 @@ class DemoFan(FanEntity):
def set_direction(self, direction: str) -> None:
"""Set the direction of the fan."""
self.direction = direction
self._direction = direction
self.schedule_update_ha_state()
def oscillate(self, oscillating: bool) -> None:
@@ -91,7 +91,7 @@ class DemoFan(FanEntity):
@property
def current_direction(self) -> str:
"""Fan direction."""
return self.direction
return self._direction
@property
def supported_features(self) -> int:

View File

@@ -51,7 +51,7 @@ NORMAL_INPUTS = {
"Dvd": "DVD",
"Blue ray": "BD",
"TV": "TV",
"Satelite / Cable": "SAT/CBL",
"Satellite / Cable": "SAT/CBL",
"Game": "GAME",
"Game2": "GAME2",
"Video Aux": "V.AUX",

View File

@@ -5,7 +5,7 @@
"one_instance_allowed": "Wymagana jest tylko jedna instancja."
},
"create_entry": {
"default": "Aby wysy\u0142a\u0107 zdarzenia do Home Assistant'a, musisz skonfigurowa\u0107 [Dialogflow Webhook]({twilio_url}). \n\n Wprowad\u017a nast\u0119puj\u0105ce dane:\n\n - URL: `{webhook_url}` \n - Metoda: POST \n - Typ zawarto\u015bci: application/json\n\nZapoznaj si\u0119 z [dokumentacj\u0105]({docs_url}), by pozna\u0107 szczeg\u00f3\u0142y."
"default": "Aby wysy\u0142a\u0107 zdarzenia do Home Assistant'a, musisz skonfigurowa\u0107 [Dialogflow Webhook]({dialogflow_url}). \n\n Wprowad\u017a nast\u0119puj\u0105ce dane:\n\n - URL: `{webhook_url}` \n - Metoda: POST \n - Typ zawarto\u015bci: application/json\n\nZapoznaj si\u0119 z [dokumentacj\u0105]({docs_url}), by pozna\u0107 szczeg\u00f3\u0142y."
},
"step": {
"user": {

View File

@@ -17,6 +17,9 @@ SOURCE = "Home Assistant Dialogflow"
CONFIG_SCHEMA = vol.Schema({DOMAIN: {}}, extra=vol.ALLOW_EXTRA)
V1 = 1
V2 = 2
class DialogFlowError(HomeAssistantError):
"""Raised when a DialogFlow error happens."""
@@ -84,23 +87,45 @@ async_remove_entry = config_entry_flow.webhook_async_remove_entry
def dialogflow_error_response(message, error):
"""Return a response saying the error message."""
dialogflow_response = DialogflowResponse(message["result"]["parameters"])
api_version = get_api_version(message)
if api_version is V1:
parameters = message["result"]["parameters"]
elif api_version is V2:
parameters = message["queryResult"]["parameters"]
dialogflow_response = DialogflowResponse(parameters, api_version)
dialogflow_response.add_speech(error)
return dialogflow_response.as_dict()
def get_api_version(message):
"""Get API version of Dialogflow message."""
if message.get("id") is not None:
return V1
if message.get("responseId") is not None:
return V2
async def async_handle_message(hass, message):
"""Handle a DialogFlow message."""
req = message.get("result")
action_incomplete = req["actionIncomplete"]
_api_version = get_api_version(message)
if _api_version is V1:
_LOGGER.warning(
"Dialogflow V1 API will be removed on October 23, 2019. Please change your DialogFlow settings to use the V2 api"
)
req = message.get("result")
action_incomplete = req.get("actionIncomplete", True)
if action_incomplete:
return
if action_incomplete:
return None
elif _api_version is V2:
req = message.get("queryResult")
if req.get("allRequiredParamsPresent", False) is False:
return
action = req.get("action", "")
parameters = req.get("parameters").copy()
parameters["dialogflow_query"] = message
dialogflow_response = DialogflowResponse(parameters)
dialogflow_response = DialogflowResponse(parameters, _api_version)
if action == "":
raise DialogFlowError(
@@ -123,10 +148,11 @@ async def async_handle_message(hass, message):
class DialogflowResponse:
"""Help generating the response for Dialogflow."""
def __init__(self, parameters):
def __init__(self, parameters, api_version):
"""Initialize the Dialogflow response."""
self.speech = None
self.parameters = {}
self.api_version = api_version
# Parameter names replace '.' and '-' for '_'
for key, value in parameters.items():
underscored_key = key.replace(".", "_").replace("-", "_")
@@ -143,4 +169,8 @@ class DialogflowResponse:
def as_dict(self):
"""Return response in a Dialogflow valid dictionary."""
return {"speech": self.speech, "displayText": self.speech, "source": SOURCE}
if self.api_version is V1:
return {"speech": self.speech, "displayText": self.speech, "source": SOURCE}
if self.api_version is V2:
return {"fulfillmentText": self.speech, "source": SOURCE}

View File

@@ -63,6 +63,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
["Power Consumption", obis_ref.CURRENT_ELECTRICITY_USAGE],
["Power Production", obis_ref.CURRENT_ELECTRICITY_DELIVERY],
["Power Tariff", obis_ref.ELECTRICITY_ACTIVE_TARIFF],
["Power Consumption (total)", obis_ref.ELECTRICITY_IMPORTED_TOTAL],
["Power Consumption (low)", obis_ref.ELECTRICITY_USED_TARIFF_1],
["Power Consumption (normal)", obis_ref.ELECTRICITY_USED_TARIFF_2],
["Power Production (low)", obis_ref.ELECTRICITY_DELIVERED_TARIFF_1],

View File

@@ -304,7 +304,7 @@ class Thermostat(ClimateDevice):
self.vacation = event["name"]
return PRESET_VACATION
return None
return self._preset_modes[self.thermostat["program"]["currentClimateRef"]]
@property
def hvac_mode(self):
@@ -357,6 +357,9 @@ class Thermostat(ClimateDevice):
status = self.thermostat["equipmentStatus"]
return {
"fan": self.fan,
"climate_mode": self._preset_modes[
self.thermostat["program"]["currentClimateRef"]
],
"equipment_running": status,
"fan_min_on_time": self.thermostat["settings"]["fanMinOnTime"],
}

View File

@@ -1,135 +0,0 @@
"""Support for EDP re:dy."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEASSISTANT_START
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client, discovery, dispatcher
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import async_track_point_in_time
from homeassistant.util import dt as dt_util
_LOGGER = logging.getLogger(__name__)
DOMAIN = "edp_redy"
EDP_REDY = "edp_redy"
DATA_UPDATE_TOPIC = "{0}_data_update".format(DOMAIN)
UPDATE_INTERVAL = 60
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Schema(
{
vol.Required(CONF_USERNAME): cv.string,
vol.Required(CONF_PASSWORD): cv.string,
}
)
},
extra=vol.ALLOW_EXTRA,
)
async def async_setup(hass, config):
"""Set up the EDP re:dy component."""
from edp_redy import EdpRedySession
session = EdpRedySession(
config[DOMAIN][CONF_USERNAME],
config[DOMAIN][CONF_PASSWORD],
aiohttp_client.async_get_clientsession(hass),
hass.loop,
)
hass.data[EDP_REDY] = session
platform_loaded = False
async def async_update_and_sched(time):
update_success = await session.async_update()
if update_success:
nonlocal platform_loaded
# pylint: disable=used-before-assignment
if not platform_loaded:
for component in ["sensor", "switch"]:
await discovery.async_load_platform(
hass, component, DOMAIN, {}, config
)
platform_loaded = True
dispatcher.async_dispatcher_send(hass, DATA_UPDATE_TOPIC)
# schedule next update
async_track_point_in_time(
hass, async_update_and_sched, time + timedelta(seconds=UPDATE_INTERVAL)
)
async def start_component(event):
_LOGGER.debug("Starting updates")
await async_update_and_sched(dt_util.utcnow())
# only start fetching data after HA boots to prevent delaying the boot
# process
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, start_component)
return True
class EdpRedyDevice(Entity):
"""Representation a base re:dy device."""
def __init__(self, session, device_id, name):
"""Initialize the device."""
self._session = session
self._state = None
self._is_available = True
self._device_state_attributes = {}
self._id = device_id
self._unique_id = device_id
self._name = name if name else device_id
async def async_added_to_hass(self):
"""Subscribe to the data updates topic."""
dispatcher.async_dispatcher_connect(
self.hass, DATA_UPDATE_TOPIC, self._data_updated
)
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def unique_id(self) -> str:
"""Return a unique ID."""
return self._unique_id
@property
def available(self):
"""Return True if entity is available."""
return self._is_available
@property
def should_poll(self):
"""Return the polling state. No polling needed."""
return False
@property
def device_state_attributes(self):
"""Return the state attributes."""
return self._device_state_attributes
@callback
def _data_updated(self):
"""Update state, trigger updates."""
self.async_schedule_update_ha_state(True)
def _parse_data(self, data):
"""Parse data received from the server."""
if "OutOfOrder" in data:
try:
self._is_available = not data["OutOfOrder"]
except ValueError:
_LOGGER.error("Could not parse OutOfOrder for %s", self._id)
self._is_available = False

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