Compare commits

...

918 Commits

Author SHA1 Message Date
Pascal Vizeli
8f9c2000ce Merge pull request #22883 from home-assistant/rc
0.91.2
2019-04-08 11:27:14 +02:00
Robbie Trencheny
a04d44d97a Minor sensor fixes (#22884)
* Minor sensor fixes

* Fix tests
2019-04-08 08:17:11 +00:00
Pascal Vizeli
3f73973970 Bumped version to 0.91.2 2019-04-08 08:00:22 +00:00
Pascal Vizeli
3a79e37cde Fix content_type handling ingress (#22864) 2019-04-08 07:59:05 +00:00
zewelor
3f15b6b2d3 Fix yeelight possible array change during iteration (#22849) 2019-04-08 07:59:04 +00:00
zewelor
c5d4b7c243 Use relative imports in yeelight (#22839) 2019-04-08 07:59:04 +00:00
Robbie Trencheny
236e484dc2 Fix for rate limits should be optional (#22823) 2019-04-08 07:59:02 +00:00
Jason Hunter
f51e8c3012 coerce duration and lookback to int so they can be used in template automation (#22819) 2019-04-08 07:59:01 +00:00
Robbie Trencheny
474fc21c66 Fix for optional values in the update_location webhook call (#22817)
* Fix for optional values in the update_location webhook call

* Square brackets instead of .get
2019-04-08 07:59:00 +00:00
Robbie Trencheny
82f6bed3a3 Add a new mobile_app webhook command to get config (#22813)
* Add a new mobile_app webhook command to get config

* Limit fields returned
2019-04-08 07:58:59 +00:00
zewelor
abb531c06b Improve yeelight imports (#22804) 2019-04-08 07:58:10 +00:00
Chris Helming
7a8aa79f19 Add optional rtsp_port for Foscam (#22786)
* add optional rtsp port for config

* getting rid of default=None

* removing vol.Any
2019-04-08 07:56:56 +00:00
Robbie Trencheny
ed9d1e776f Add new mobile_app webhook command: get_zones (#22604)
## Description:

Adds a new `mobile_app` webhook command, `get_zones`, which just returns all zones.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-04-08 07:56:55 +00:00
Wolfgang Malgadey
d8119b2281 Fix tado turn on off (#22291)
* fix for turn on and off, with new pyTado

missing blank line

* removed, because can't push

* uploaded the file through github again
2019-04-08 07:54:58 +00:00
Alexei Chetroi
a69b1a359d ZHA Light debug logging. (#22776) 2019-04-05 17:06:59 -07:00
David F. Mulcahey
f004f440d3 make the custom polling actually request state (#22778) 2019-04-05 17:01:06 -07:00
Nate Clark
dbe53a3947 Fix konnected unique_id computation for switches (#22777) 2019-04-05 16:52:30 -07:00
Rohan Kapoor
a44966f483 Correctly load Mopar's config (#22771) 2019-04-05 16:52:29 -07:00
Pascal Vizeli
c209236f47 Merge pull request #22755 from home-assistant/rc
0.91.1
2019-04-05 15:44:21 +02:00
zewelor
9eb32728f1 Fix yeelight recorder warning (#22756) 2019-04-05 13:33:10 +02:00
Pascal Vizeli
9198047ad5 Cleanup cookie handling (#22757) 2019-04-05 13:31:17 +02:00
Paulus Schoutsen
cd3f51f7b1 Bumped version to 0.91.1 2019-04-04 23:49:37 -07:00
Fredrik Erlandsson
e9d55bf1c0 fixes configuration flow #22706 (#22754) 2019-04-04 23:49:12 -07:00
Jason Hunter
5252c92670 use the input stream codec as the template for the output streams (#22747) 2019-04-04 23:49:12 -07:00
Chris Helming
dc185b994d Update Foscam stream for newer models (#22744)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none

* Update Foscam stream for newer models

* change if to or
2019-04-04 23:49:11 -07:00
Aaron Bach
74a7d4117e Bump aioambient to 0.2.0 (#22736) 2019-04-04 23:49:10 -07:00
Aaron Bach
bab966fb29 Fix incorrect "Unavailable" Ambient sensors (#22734)
* Fix incorrect "Unavailable" Ambient sensors

* Removed unnecessary cast
2019-04-04 23:49:10 -07:00
Pascal Vizeli
79facb82c6 Fix chunk streaming (#22730)
* Fix chunk streaming

* Cleanup a print

* Better error handling

* Fix import order
2019-04-04 23:49:09 -07:00
Pascal Vizeli
ec07affe0d Fix ingress routing with / (#22728) 2019-04-04 23:49:08 -07:00
David F. Mulcahey
193b608ee0 fix device class lookup for binary sensors (#22724) 2019-04-04 23:49:08 -07:00
Pascal Vizeli
8eb93a8bea Change URL handling (#22713) 2019-04-04 23:49:07 -07:00
Paulus Schoutsen
360caa3b1f Merge pull request #22688 from home-assistant/rc
0.91.0
2019-04-03 14:39:21 -07:00
Paulus Schoutsen
63d8dd9f7a Bumped version to 0.91.0 2019-04-03 11:27:57 -07:00
Paulus Schoutsen
685de23a4e Run PyLint under Python 3.5 (#22642)
* Run PyLint under Python 3.5

* Remove -q from pip install to debug

* Upgrade setuptools before install

* Use correct cache key for pylint
2019-04-03 11:27:50 -07:00
Jason Hu
b30c140648 Require static-check success first for rest of workflow (#22635)
* Require static-check success first

* Update config.yml
2019-04-03 11:27:49 -07:00
Jason Hu
2c10563205 Config CircleCI workflow (#22590)
* Add mypyrc to control typing check, add mypy to circle

* Add translation upload circlci job
2019-04-03 11:27:49 -07:00
Jason Hu
5dd444fcd8 Set up Circleci workflow (#22519)
* Set up Circleci workflow

* Update python tag

* Add pre-test job to cache the requirements

* Upgrade pip itself

* Use 3.7 for lint

* Parallelize pylint

* Tweak run gen_requirements_all

* tweak cache key
2019-04-03 11:27:48 -07:00
Jason Hu
273007fa19 Fix Circleci config (#22509)
* Add libav depends on circleci

* tweak circleci config
2019-04-03 11:27:48 -07:00
Jason Hu
2e8c690033 A very basic Circleci setup (#22503)
* Add circleci support

* Add buildpack-deps

* Install libudev-dev

* sudo

* always run test

* Add test report

* no sugar

* quite pytest

* better junit test result

* Add $CODE_COVERAGE env var
2019-04-03 11:27:47 -07:00
Pascal Vizeli
836aab283f Fix ffmpeg default extra options (#22682) 2019-04-03 11:25:38 -07:00
Paulus Schoutsen
7cf92c2210 Deal with cover assumed state (#22673)
* Deal with cover assumed state

* Add docs
2019-04-03 11:25:38 -07:00
Jason Hu
9eb4f89da4 Fix trusted networks auth provider warning message (#22671)
* Fix trusted networks auth provider warning message

* Update auth.py
2019-04-03 11:25:37 -07:00
Diogo Gomes
167d8cbaba Fix #22648 - Utility_meter would try to cancel a non existing task (#22669)
* don't cancel tariff that are paused

* test tariffs
2019-04-03 11:25:36 -07:00
mvn23
e90d980e67 Don't use room setpoint override in climate.opentherm_gw (#22656)
* Dont use DATA_ROOM_SETPOINT_OVRD in climate.opentherm_gw as it is unreliable with some thermostats.

* Show new target temperature immediately until the backend notices a change

* Only update target temp on the gateway if the value differs from the current target_temperature.
2019-04-03 11:25:36 -07:00
Pascal Vizeli
81a659be0d Hass.io discovery flow deconz (#22623)
* Add Hass.io deCONZ discovery flow

* add bridge ID

* fix attribute

* fix strings

* Address comments

* Add test

* Add only instance / changed maybe later
2019-04-03 11:25:35 -07:00
Robbie Trencheny
51c7cbc6b9 Add mobile_app notify platform (#22580)
* Add mobile_app notify platform

* Requested changes

* Fix incorrect param for status code

* Move push_registrations to notify platform file

* Trim down registration information sent in push

* quotes

* Use async version of load_platform

* Add warning for duplicate device names

* Switch to async_get_service

* add mobile_app.notify test

* Update tests/components/mobile_app/test_notify.py

* Update tests/components/mobile_app/test_notify.py
2019-04-03 11:25:34 -07:00
Paulus Schoutsen
3357596215 Bumped version to 0.91.0b5 2019-04-02 11:42:01 -07:00
Jc2k
31ac965b16 Fix racy homekit_controller platform setup caused by #22368 (#22655) 2019-04-02 11:41:56 -07:00
Chris Helming
e3ca1e6203 Return 0 for failed Foscam streams (#22651)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models

* changing logic for success and return none
2019-04-02 11:41:55 -07:00
Pascal Vizeli
6d741d68b7 Support GET params for websocket ingress path (#22638) 2019-04-02 11:41:55 -07:00
Daniel Høyer Iversen
a5c7f131ee Handle disonnect bug in Tibber library (#22629) 2019-04-02 11:41:54 -07:00
Paulus Schoutsen
c7576999ca Disable Z-Wave autoheal (#22628) 2019-04-02 11:41:53 -07:00
Pascal Vizeli
56c75d7706 Update face_recognition to 1.2.3 (#22622) 2019-04-02 11:41:53 -07:00
Chris Helming
e0b4e88544 Update Foscam component to support stream source (#22568)
* Update Foscam to support stream source

* Removing spaces and tabs

* Changing to Python3-style string formatting

* Adding '_media_port' to hopefully cover other models
2019-04-02 11:41:52 -07:00
Pascal Vizeli
6f345c55c9 Hass.io ingress (#22505)
* Fix API stream of snapshot / Add ingress

* fix lint

* Fix stream handling

* Cleanup api handling

* fix typing

* Set proxy header

* Use header constant

* Enable the ingress setup

* fix lint

* Fix name

* Fix tests

* fix lint

* forward params

* Add tests for ingress

* Cleanup cookie handling with aiohttp 3.5

* Add more tests

* Fix tests

* Fix lint

* Fix header handling for steam

* forward header too

* fix lint

* fix flake
2019-04-02 11:41:51 -07:00
Jason Hu
5cb69cf163 Add trusted networks deprecating warning (#22487)
* Add trusted networks deprecating warning

* Update auth.py

* Update auth.py

* Update auth.py

* Update auth.py

* Tweak
2019-04-02 11:41:51 -07:00
Paulus Schoutsen
fbb28c401e Bumped version to 0.91.0b4 2019-03-31 20:30:30 -07:00
Paulus Schoutsen
0e42cb64d6 Add stream to the default config (#22602) 2019-03-31 20:02:01 -07:00
drjared88
2e61ead4fd Update ONVIF component to SUPPORT_STREAM (#22569)
* Update Onvif component to SUPPORT_STREAM

* Update camera.py

* Update camera.py

* Update camera.py

Remove extra spaces.

* lookup URL when camera is added to hass and add extra guards
2019-03-31 20:02:00 -07:00
Jason Hu
de16059365 Fix name conflict in tests (#22556)
* Fix name conflict in tests

* Lint

* Lint
2019-03-31 20:01:59 -07:00
drjared88
a71fcfb6e5 Update Amcrest component to SUPPORT_STREAM (#22553)
* Update camera.py

Update Amcrest component to SUPPORT_STREAM to allow streaming in the UI and Google Assistant.

* Update camera.py
2019-03-31 20:01:59 -07:00
giefca
8af70d5d19 Google assistant: add blinds trait for covers (#22336)
* Update const.py

* Update smart_home.py

* Update trait.py

* Update test_trait.py

* Update smart_home.py

* Update test_trait.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py

* Update __init__.py

* Update test_trait.py

* Change email

* Trying to correct CLA

* Update __init__.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update trait.py

* Update __init__.py

* Update test_trait.py

* Update test_google_assistant.py

* Update trait.py

* Update trait.py

* Update test_trait.py

* Update test_trait.py
2019-03-31 20:01:59 -07:00
Paulus Schoutsen
ec9a58442b Updated frontend to 20190331.0 2019-03-31 20:01:35 -07:00
Paulus Schoutsen
b1a6539290 Bumped version to 0.91.0b3 2019-03-29 17:05:40 -07:00
Paulus Schoutsen
3ad4419cb6 Fix platform warnings (#22551) 2019-03-29 17:05:30 -07:00
Paulus Schoutsen
f9f100b575 Add support for streaming to ffmpeg (#22549) 2019-03-29 17:05:29 -07:00
Paulus Schoutsen
65c47824a0 Updated frontend to 20190329.0 2019-03-29 16:47:27 -07:00
Paulus Schoutsen
c4a4af7c29 Bumped version to 0.91.0b2 2019-03-29 14:07:22 -07:00
damarco
24095c0d7b Bump zigpy (#22545) 2019-03-29 14:07:18 -07:00
Steven Looman
ae18705c45 Upgrade to async_upnp_client==0.14.7 (#22543) 2019-03-29 14:07:17 -07:00
Jason Hu
ab642ca4eb Fix tts Great Migration issue (#22539) 2019-03-29 14:07:16 -07:00
David F. Mulcahey
b7bc520a0e clean up channel configuration (#22534) 2019-03-29 14:07:16 -07:00
ktnrg45
53595e76d8 PS4 bump to 0.5.2 (#22523)
* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2

* Bump pyps4 to 0.5.2
2019-03-29 14:07:15 -07:00
David F. Mulcahey
173ef7cac5 Do not use zha default light polling (#22513)
* don't use default light polling

* review comment
2019-03-29 14:07:15 -07:00
Jason Hu
9f72764cff Fix lint on dev (#22512)
## Description:

Fix a lint issue in credstash script.


**Related issue (if applicable):** fixes #<home-assistant issue number goes here>

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-29 14:07:14 -07:00
Jason Hu
77f7a53d9f Remove botocore dependency from credstash script (#22511)
* Remove botocore dependency from credstash script

* Update requirements_all.txt

* Update pylintrc

* Update credstash.py
2019-03-29 14:07:13 -07:00
zewelor
fae8265a37 Fixes for yeelight availbility state (#22502) 2019-03-29 14:07:13 -07:00
mvn23
a95fb809a5 Update pyotgw to 0.4b3 (#22496) 2019-03-29 14:07:12 -07:00
Jason Hu
21917f4dc4 Fix dev branch (#22493) 2019-03-29 14:07:12 -07:00
Sebastian Muszynski
9aa5b904c6 Fix regression of the xiaomi_aqara config validation (#22435)
* Fix regression of the xiaomi_aqara config validation

* Make the key optional again

* Add base schema

* Remove the GW_MAC default
2019-03-29 14:07:11 -07:00
Paulus Schoutsen
615b1cbfc7 Bumped version to 0.91.0b1 2019-03-27 23:50:58 -07:00
Paulus Schoutsen
3a406f5677 Fix YAML 2019-03-27 23:49:34 -07:00
Paulus Schoutsen
a2c9834852 Bumped version to 0.91.0b0 2019-03-27 22:09:25 -07:00
Paulus Schoutsen
4f820aef83 Merge remote-tracking branch 'origin/master' into dev 2019-03-27 22:08:48 -07:00
Jason Hu
6ba2891604 Add trusted_users in trusted networks auth provider (#22478) 2019-03-27 21:53:11 -07:00
Jason Hunter
26726af689 Stream Record Service (#22456)
* Initial commit of record service for live streams

* fix lint

* update service descriptions

* add tests

* fix lint
2019-03-27 21:47:07 -07:00
Paulus Schoutsen
9d21afa444 Update translations 2019-03-27 21:32:58 -07:00
Paulus Schoutsen
05cdab03b1 Updated frontend to 20190327.0 2019-03-27 21:32:40 -07:00
Clifford W. Hansen
ece9c62ee8 Add game and app media types (#22459)
* Added game and app media types

* Changed media type to game from music

* Removed app type as it is not used yet
2019-03-27 21:20:43 -07:00
Paulus Schoutsen
a69080ba73 Print error instead of warning for custom platforms in legacy format (#22486)
* Legacy platform format prints error

* Enforce no partial overlays
2019-03-27 20:52:28 -07:00
Robbie Trencheny
7741ec4d5a Great migration notify (#22406)
* Move notify platforms into components

* Move notify tests

* Fix notify tests

* More fixes

* Update requirements

* Update .coveragerc

* Run gen reqs
2019-03-27 20:36:13 -07:00
Paulus Schoutsen
92457ca5ca Fix syntax error 2019-03-27 20:16:00 -07:00
Aaron Bach
8777146053 Fix too-abrubt SimpliSafe data refresh termination on error (#22466) 2019-03-27 20:14:49 -07:00
Rohan Kapoor
c4eab21736 Mopar split (#21526)
* Split out mopar into a component and sensor platform

* Add the mopar switch platform

* Add the mopar lock platform

* Clean up and bump version

* Update per review

* Re-add service to trigger horn

* Clean up again

* Don't call async from sync context

* Lint

* Implement changes from review

* Lint

* A little more clean up
2019-03-27 20:09:36 -07:00
Heine Furubotten
f11f5255ae Entur upgrade to v0.2.0: async polling, number of departures, omit non boarding departures (#22001)
* The Great Migration

* removed outdated tests

* Upgraded enturclient to v0.2.0
- client has gone async
- configurable if non boarding departures should be omitted from result
- configurable how many departures should be shown
- more clear which attributes are included and when

* reduced nesting and clearing of attributes

* Removed test data

* ensure attribution and stop id in attributes

* docstring fixes

* fix rebase errors
went a bit too fast on continue on one of the conflicts..

* fix test requirements comment from gen
2019-03-27 20:04:35 -07:00
Anders Melchiorsen
a1369c2fee Incoming SMS handling for netgear_lte (#22402)
* Fire netgear_lte events for incoming SMS

* Add netgear_lte.delete_sms service call

* Fix log statement

* Add services.yaml
2019-03-27 20:02:04 -07:00
Jc2k
8bf5e57b7f Move HKDevice into connection (#22430) 2019-03-27 20:01:10 -07:00
Jack Wilsdon
14ceb8472f Return percentage information in Alexa Smart Home response (#22440) 2019-03-27 19:58:52 -07:00
Finbarr Brady
e022f4465c Bump pypi again for Cisco Mobility Express (#22467)
* Fix empty device clId

Fix for https://github.com/fbradyirl/ciscomobilityexpress/issues/13

* Update requirements_all.txt
2019-03-27 19:58:06 -07:00
Maciej Bieniek
b8e38c1b25 Add new data fields and bump python-join-api (#22472)
* Add new data fields and bump python-join-api

* Update __init__.py
2019-03-27 19:56:27 -07:00
Daniel Høyer Iversen
c7904a4b37 Improve Sensibo error handling (#22475)
* Handle sensibo exception

* improve sensibo
2019-03-27 19:54:44 -07:00
Robert Svensson
8f3434c2ab Fix events so they work with multiple devices (#22477) 2019-03-27 19:54:27 -07:00
Nate Clark
d13c892b28 fix inverse state changes for binary sensors (#22479) 2019-03-27 19:54:01 -07:00
Sebastian Muszynski
26d4736ebf Fix auto discovery of yeelights (#22481)
* Fix auto discovery of yeelights

* Fix lint
2019-03-27 19:51:22 -07:00
Alexei Chetroi
e670491c86 Targeted ZHA permit joins. (#22482)
* Targeted ZHA permit service.

* Convert IEEE string to EUI64 usiv vol schema.

* Update test units.

* Lint.

isort imports.
2019-03-27 19:50:52 -07:00
Andrew Sayre
e26a5abb2b Don't return cover position when not supported (#22484) 2019-03-27 19:50:02 -07:00
Rohan Kapoor
78e162c1d3 Centralize all usages of host as a configuration param to the constant CONF_HOST (#22458)
* Centralize all usages of  as a configuration param to the constant CONF_HOST

* Clean up test
2019-03-27 19:48:05 -07:00
dilruacs
9176e13a97 Modify check for ADB public key (#22378)
* Remove check for public key

* Remove has_adb_files, directly call cv.isfile

* Check for missing adbkey.pub, create dummy if not found

* Reorder imports

* Bumped androidtv library version, deactivated pubkey test

* Code works without pubkey, removed function

* Removed "import os", not needed anymore

* Bump library version
2019-03-27 20:19:24 -05:00
René-Marc Simard
217782cd05 Cache GTFS metadata and expose utility attributes (breaking change) (#20966)
## Description:
Current sensor updates run 7 additional SQLite database queries to populate attributes, on top of the bus schedule queries themselves. Double that if you have two sensors. That leads to a lot of slowdowns for everything else when using an SD card!

Considering that some data never changes (agency, routes...) and that others like departure times are good until invalidated, let's fetch such metadata at first then only when relevant changes do occur.

**Breaking Change:**
GTFS sensor attributes are now named using the standard snake_case format.

### Work performed:
- All metadata queries are now cached.
- Metadata queries are now all regrouped in the `update()` method.
- Attributes assembling is now done in ~~`device_state_attributes()` where it belongs.~~ in a utility method called from `update()`, for code clarity and since there is potential I/O from SQLAlchemy.
- As a bonus, many metadata entries with cryptic values have complementary entries added that provide easier to use data:
	- .\* Stop Drop Off Type: .\* Stop Drop Off Type **State** -> (string, unknown)
	- .\* Stop Pickup Type: .\* Stop Pickup Type **State** -> (string, unknown)
	- .\* Stop Timepoint: .\* Stop Timepoint **Exact** -> boolean
	- .\* Station Location Type: .\* Station Location Type **Name** -> string
	- .\* Wheelchair Boarding: .\* Wheelchair Boarding **Available** -> (boolean, unknown)
	- Route Type: Route Type **Name** (string)
	- Trip Bikes Allowed: Trip Bikes Allowed **State** -> (boolean, unknown)
	- Trip Wheelchair Access: Trip Wheelchair Access **Available** -> (boolean, unknown)
- Attribute names are now using snake_case.
- Added type hints.

**Related issue (if applicable):** fixes #21222

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-27 17:58:23 -07:00
Jc2k
d8817bb127 Remove homekit_controller duplicate legacy pairing loader code (#22442) 2019-03-28 00:36:50 +01:00
Anders Melchiorsen
90c4f6f6e5 Do data extraction in sensors (#22444)
* Do data extraction in sensors

* Hopefully fix lint
2019-03-27 19:24:02 -04:00
Jason Hu
f795d03503 Fix aws.notify platform schema (#22374)
* Fix aws component notify platform schema

* Address code review comment

* Do not allow load aws.notify from notify component

* Revert unrelated translation update

* Review comment
2019-03-27 14:53:06 -07:00
Gido
24c7c2aa6e Solaredge new sensors (#21047)
* Remove unused hass parameter for SolarEdgeData

* Add factory to create different types of sensors
Rename SolarEdgeSensor to SolarEdgeOverviewSensor
Rename SolarEdgeData to SolarEdgeOverviewDataService
Remove unused hass parameter in SolarEdgeOverviewDataService

* Add SolarEdgeDetailsDataService to retrieve details data
Add SolarEdgeDetailsSensor to report details data
Add abstract class SolarEdgeSensor
Add details sensor types

* Combine multiple details sensor into one sensor with attributes

* Fix pylint and flake8 errors

* Resolve conflict with solaredge component update

* Add SolarEdgeInventoryDataService to retrieve inventory information
Add SolarEdgeInventorySensor to view inventory information
Add inverters to monitored_conditions

* Fix pylint and flake8 errors

* Add additional monitored variables for solaredge

* Add new sensors to solaredge component

* Add SolarEdgePowerFlowDataService
Add SolarEdgePowerFlowSensor
Add new monitored_conditions for power consumption and grid, load and
solar power production/consumption

* Set entity_id for each sensor based on platform and sensor type

* Fix flake8 and pylint errors

* Add check for connections in return data

* Fix pylint and flake8 errors

* Renamed state_attributes to device_state_attributes
Moved request import to top

* Remove explicit definition of entity_id

* Fix pylint and flake8 errors

* Add check for None before adding sensor

* Update SolarEdgeSensorFactory with initial dict which maps sensor_key to
entity class and data service

* Update attribute values to snakecase
Added stingcase as requirement

* Update requirements_all.txt to include stringcase for solaredge

* Update some initial values for data and unit_of_measurement
Update sensor factory
2019-03-27 17:08:52 -04:00
Nate Clark
2b48ecd5c5 better algorithm for computing unique_id (#22389) 2019-03-27 16:47:03 -04:00
Fredrik Erlandsson
71b800457b Add switches to control Daikin Airbase zones (#22417)
* initial AirBase zone support

* fix zone name

* version bump pydaikin

* don't use get()
2019-03-27 16:37:21 -04:00
Ryan Claussen
c3f090af17 Add hourly forecasts to Dark Sky (#21820) 2019-03-27 20:11:25 +00:00
Leonardo Merza
29ad3961e5 Use voluptuous error string for websocket validation error (#21883)
* use voluptuous error string to websocket validation error

* added exception logging to websocket error

* add detailed message to websocket validation error

* add error message to websocket validation error

* Add humanize error for websocket invalid vol error

* Add humanize error for websocket invalid vol error

* Add humanize error for websocket invalid vol error
2019-03-27 10:40:39 -07:00
Robert Svensson
52437f6246 Axis devices support device registry (#22367)
* Add support for device registry

* Fix test
2019-03-27 18:25:01 +01:00
Penny Wood
646c4a7137 Bootstrap to start registry loading early (#22321)
* Registries store directly in data on loading.

* Loading registries concurent with stage 1.

* Removed comments
2019-03-27 22:06:20 +08:00
zewelor
4de2efd07f Add support for yeelight ceiling ambilight (#22346) 2019-03-27 13:39:55 +01:00
Alexei Chetroi
6540114ec5 Update ZHA component CODEOWNERS (#22452) 2019-03-27 07:17:10 -04:00
zewelor
fa9a6f072e Add myself as codeowner for yeelight component (#22438) 2019-03-27 08:02:30 +01:00
Pascal Vizeli
a55afa8119 Update ha-ffmpeg 2.0 (#22427) 2019-03-27 07:55:05 +01:00
Thomas Lovén
19d99ddf57 Lower severity level of log messages from http.view (#21091) 2019-03-26 19:18:32 -04:00
Paulus Schoutsen
1766536812 Fix test name (#22421) 2019-03-26 15:24:28 -07:00
Finbarr Brady
02b12ec1b9 Adding conf for deep standby, wake and specific source bouquet of Enigma2 (#22393)
* - adding deep standby, conf for wake and specify source bouquet

* set defaults to strings

* bump pip

* bump pip

* bump pip

* bump pip

* bump pip

* bump pip
2019-03-26 17:49:53 -04:00
Pascal Vizeli
80250add9e Update homeassistant-pyozw to 0.1.3 (#22433) 2019-03-26 17:42:43 -04:00
Paulus Schoutsen
eb3355b05d Merge pull request #22420 from home-assistant/rc
0.90.2
2019-03-26 14:26:59 -07:00
mvn23
24ba434e6a Improve opentherm gw startup (#22121)
* Improve fix in c90f0d5 (#22106). Schedule connect coroutine directly on the loop rather than waiting for EVENT_HOMEASSISTANT_START.

* Remove unused import.
2019-03-26 14:25:47 -07:00
mvn23
ddefb74215 Fix TypeError in current_temperature if no temperature is known. (#22112)
Don't set opentherm_gw climate temperatures to 0 on init.
2019-03-26 14:25:47 -07:00
mvn23
42e75dc45c Fix opentherm_gw blocks HA startup when gateway unreachable. (#22106) 2019-03-26 14:25:46 -07:00
mvn23
44dc85204c Bump pyotgw to 0.4b2 (#21973) 2019-03-26 14:25:16 -07:00
Finbarr Brady
7e3567319f ciscomobilityexpress pypi version update (#22431)
* Bump pip

* Bump ciscomobilityexpress to 0.1.4
2019-03-26 21:13:56 +01:00
Anders Melchiorsen
afa99c9189 Use dispatcher for netgear_lte state updates (#22328)
* Use dispatcher for netgear_lte state updates

* Also dispatch unavailable state
2019-03-26 08:06:11 -07:00
Jason Hu
7519e8d417 Update translate, fix dev build error (#22419) 2019-03-26 07:48:26 -07:00
Paulus Schoutsen
ab1f1316ba Bumped version to 0.90.2 2019-03-26 07:40:10 -07:00
Jason Hunter
8a6d9cc0e4 reset unsub to None on timeout (#22404) 2019-03-26 07:39:59 -07:00
Pascal Vizeli
fac214828d Enable hass.io panel without ping (#22388)
* Enable hass.io panel without ping

* fix tests
2019-03-26 07:39:58 -07:00
Pascal Vizeli
a2508b4f52 Update hass-nabucasa & fix state (#22385)
* Update hass-nabucasa & fix state

* Fix lint
2019-03-26 07:39:56 -07:00
Jason Hunter
24a55834f9 Prefer TCP for RTSP streams (#22338)
## Description:

For RTSP streams, set the `prefer_tcp` FFMPEG flag.  This should resolve some of the "green feed" issues that some users are reporting, likely due to packets being lost over UDP on their network.

Resources: [FFMPEG protocols documentation](https://ffmpeg.org/ffmpeg-protocols.html#rtsp)

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-26 07:39:55 -07:00
ktnrg45
4d0a28fa56 Fix ps4 no creds with additional device (#22300)
* Fix no creds with additional device.

* Update config_flow.py
2019-03-26 07:39:54 -07:00
Jc2k
133ae63ed0 Add missing append (#22414) 2019-03-26 07:39:05 -07:00
Pascal Vizeli
3fddf5df08 Enable hass.io panel without ping (#22388)
* Enable hass.io panel without ping

* fix tests
2019-03-26 07:38:25 -07:00
cgtobi
a27e821e8b Migrate tts (#22403)
* Migrate tts

* Migrate tts tests

* Update requirements

* Fix path to demo mp3
2019-03-26 07:34:16 -07:00
Kevin Fronczak
c71e5ed588 Changed busy error to warning (#22398) 2019-03-26 09:20:50 -04:00
zewelor
2cebf9ef71 Fix yeelight state update (#22373) 2019-03-26 09:18:53 -04:00
David F. Mulcahey
3cca3c37f0 zha fixes (#22381) 2019-03-26 09:17:43 -04:00
Daniel Høyer Iversen
77e7b63f4a Tibber add support for Watty (#22397) 2019-03-26 14:02:10 +01:00
Paulus Schoutsen
65432ba552 Move core stuff into Home Assistant integration (#22407)
* Move core stuff into Home Assistant integration

* Lint
2019-03-26 13:38:32 +01:00
Jason Hunter
bad0a8b342 Camera Preferences + Preload Stream (#22339)
* initial commit for camera preferences and preload stream

* cleanup and add tests

* respect camera preferences on each request stream call

* return the new prefs after update
2019-03-26 08:31:29 -04:00
Jason Hunter
baa4945944 reset unsub to None on timeout (#22404) 2019-03-26 08:39:09 +01:00
Jason Hu
e85b089eff Set default parallel_update value should base on async_update (#22149)
* Set default parallel_update value should base on async_update

* Set default parallel_update value should base on async_update

* Delay the parallel_update_semaphore creation

* Remove outdated comment
2019-03-25 23:53:36 -07:00
Jc2k
a62c116959 Remove get_serial helper that is no longer needed. (#22368) 2019-03-25 23:49:51 -07:00
Sebastian Muszynski
6fa8fdf555 Fix data_key of the xiaomi_aqara cover for LAN protocol v2 (#22358) 2019-03-25 23:46:00 -07:00
Robert Svensson
79445a7ccc deCONZ support Xiaomi vibration sensor (#22366)
* Martin pointed out in previous PR that no ending '.' in logging

* Add support for Xiaomi vibration sensor
2019-03-25 23:43:58 -07:00
Nick Whyte
73b38572f0 Add infer_arming_state option to ness alarm (#22379)
* Add infer_arming_state option to ness alarm

* actually use config value

* 🤦‍♂️
2019-03-25 23:43:24 -07:00
Jc2k
b2ba9d07ca Fix unavailable state for homekit locks and covers (#22390) 2019-03-25 23:40:28 -07:00
Daniel Shokouhi
8aef8c6bb4 Update ring_doorbell to 0.2.3 (#22395) 2019-03-25 23:37:59 -07:00
uchagani
0c4380a78d remove config sections from hass.config.components (#22370)
* remove config sections from hass.config.components

* fix tests
2019-03-25 22:36:39 -07:00
René-Marc Simard
42c27e5b72 Search GTFS departures across midnight (#20992) 2019-03-25 21:51:49 -07:00
Niccolò Maggioni
5ad3e75a4d Support for Plex sensor with enforced SSL (#21432) 2019-03-25 20:45:13 +01:00
Fredrik Erlandsson
6ffe9ad473 updated pydaikin (#22382) 2019-03-25 19:37:31 +01:00
zewelor
6a74c403c0 Update python yeelight and add nightlight mode sensor (#22345) 2019-03-25 19:06:43 +01:00
lapy
2731777c7e Add traccar events (#22348)
* Add import_events(), small refactoring, traccar_id

I isolated the code that imports traccar tracking data and added a new function that imports the traccar events to make them run in parallel and reduce delay. The events that are imported in hass, will be fired with the prefix "traccar_". Furthermore a traccar_id is now imported in hass entities, useful for matching the traccar hass entities with the traccar hass events in the most accurate way.

* bump pytraccar version

* Code format fix

* Code format fix 2

* Code format fix 3

* Implement requested changes

* Add new traccar dependency

* Fix line too long

* Update device_tracker.py

* Update requirements_all.txt
2019-03-25 18:52:53 +01:00
Andrew
a59487a438 Fix TpLink Device Tracker initialize error (#22349)
Catch RequestException instead of ConnectionError
In some cases TpLinkDeviceScanner throws various successors of
RequestException. They should be caught.
2019-03-25 10:25:49 -07:00
Paulus Schoutsen
f1a0ad9e4a Frontend indicate require admin (#22272)
* Allow panels to indicate they are meant for admins

* Panels to indicate when they require admin access

* Do not return admin-only panels to non-admin users

* Fix flake8
2019-03-25 10:04:35 -07:00
Pascal Vizeli
b57d809dad Update hass-nabucasa & fix state (#22385)
* Update hass-nabucasa & fix state

* Fix lint
2019-03-25 09:43:15 -07:00
Jc2k
f997957054 Remove unused const (#22383) 2019-03-25 16:28:34 +01:00
Jeff Irion
c8048e1aff Allow for custom turn on/off commands (#22354) 2019-03-25 08:37:10 -04:00
ktnrg45
17a96c6d9b Improve PS4 media art fetching and config flow (#22167)
* improved config flow

* Added errors, docs url

* Added errors, docs url

* Added manual config mode

* Add tests for manual/auto host input

* fix inline docs

* fix inline docs

* Changed region list

* Added deprecated region message

* removed DEFAULT_REGION

* Added close method

* Fixes

* Update const.py

* Update const.py

* Update const.py

* Update test_config_flow.py

* Added invalid pin errors

* Update strings.json

* Update strings.json

* bump pyps4 to 0.5.0

* Bump pyps4 0.5.0

* Bump pyps4 to 0.5.0

* test fixes

* pylint

* Change error reference

* remove pin messages

* remove pin messages

* Update en.json

* remove pin tests

* fix tests

* update vol

* Vol fix

* Update config_flow.py

* Add migration for v1 entry

* lint

* fixes

* typo

* fix

* Update config_flow.py

* Fix vol

* Executor job for io method.

* Update __init__.py

* blank line

* Update __init__.py

* Update tests/components/ps4/test_config_flow.py

Co-Authored-By: ktnrg45 <38207570+ktnrg45@users.noreply.github.com>
2019-03-25 08:25:15 -04:00
zewelor
96133f5e6b Improve yeelight component (#22347) 2019-03-25 08:50:47 +01:00
Jc2k
af4b85d39d Give HomeKit locks better names by default (#22333)
## Description:

This is a follow up to #22171. There we set the name of an entity based on the `accessory-information` homekit service, rather than using the zeroconf/avahi name metadata. Unfortunately Lock also sets its name from zeroconf directly, rather than picking it up from the base class. This test updates it to be like the other homekit entities and use the base class.

(This is from my ongoing homekit_controller configentry branch).

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-24 18:21:04 -07:00
fabtesta
324a7c7875 Add ClickSend "caller" option (#20780)
* removed "from" parameter from ClickSend API call

Removed "from" parameter from API call to let ClickSend choose a random number and be more compliant with some cellular networks that do not allow incoming calls from the same recipient number.

* fixed "line too long (94 > 79 characters)" houndci code review

fixed "line too long (94 > 79 characters)" houndci code review

* Added new component optional parameter "caller".
If defined is used to override default logic that uses recipient phone number in "from" API call parameter

* Removed default value for CALLER parameter. If not defined then will take the RECIPIENT value.
2019-03-24 18:13:56 -07:00
Nick Horvath
c59d45caa3 Expose detailed Ecobee equipment status (#20767)
* ecobee: expose detailed equipment status

* Fix #18244 for ecobee by moving current_operation property to current_operation_mode which is more accurate and defining current_operation properly, thanks @ZetaPhoenix

* fix docstring and lint issue

* Revert "fix docstring and lint issue"

This reverts commit d3a645f075f8a4017756f5eae05f00f05e2556cf.

* Revert "Fix #18244 for ecobee by moving current_operation property to current_operation_mode which is more accurate and defining current_operation properly, thanks @ZetaPhoenix"

This reverts commit bfd90551ef759b2c160d69da0778df89251e156b.
2019-03-24 18:13:06 -07:00
Moritz Fey
f272ed3b91 Add 'method' parameter to forgiving_round method (#21708)
* Add 'method' parameter to forgiving_round method

Fixes #21707

* fix rounding behavior in round() filter

* add test cases for new rounding behaviour
2019-03-24 18:10:49 -07:00
karlkar
548371e94c Check if mac is set when more than 2 gateways (#21834)
* Check if mac is set when more than 2 gateways

When more than 2 gateways mac is required for each of them. Now voluptuous will require it.

* fix line length

* remove trailing whitespace

* Make it more readable
2019-03-24 17:59:12 -07:00
Jason Hu
1aee7a1673 Add aws component and consolidate aws notify platform (#22240)
* Add aws component

* Move notify config under aws component

* Add basic tests for aws component

* Add deprecated warning for notify.aws_*

* Add more tests
2019-03-24 17:58:20 -07:00
Fredrik Erlandsson
b6987a1235 Add support for Tfiac Climate component (#21823)
## Description:

Add support for AC-models that follows the Tfiac protocol. Built together with @mellado.

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#8910

## Example entry for `configuration.yaml` (if applicable):
```yaml
climate:
   platform: tfiac
   host: 192.168.10.26
```

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [x] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [x] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [x] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [x] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [x] New files were added to `.coveragerc`.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23


Co-authored-by: Robbie Trencheny <me@robbiet.us>
2019-03-24 17:57:53 -07:00
Steven Looman
d1f75fcf32 Properly connect sensors to hub (#21414)
* Properly connect sensors to hub
Refs #20958

* Don't connect (merge) with main device

* Provide manufacturer

* Linting

* Do connect upnp-sensors to main device

* Linting

* Fix requirements_all.txt
2019-03-24 17:46:15 -07:00
dilruacs
adca598172 Turn Panasonic Viera TV on without WOL (#22084)
* Turn the TV on via remote

* Turn the TV on via remote

* Use turn_on() from panasonic-viera==0.3.2

* make power option configurable

* add app_power as argument

* formatting
2019-03-24 17:41:16 -07:00
Hmmbob
7f940423ad Warn user about HTML5 GCM deprecation (#22351)
* Warn user about GCM deprecation

* Fixing hound

* Fixing typo

* Fixing Travis fail
2019-03-24 17:40:43 -07:00
Steven Looman
1b0e523a60 Add support for 'image' media type (#22353) 2019-03-24 17:40:27 -07:00
shanbs
0d46e2c0b5 Fix the crash due to absence of the "default_home" in HomeData from pyatmo (netatmo/climate) (#22363) 2019-03-25 01:31:22 +01:00
cgtobi
d2a83c2732 Upgrade netatmo smart_home module (#22365) 2019-03-25 01:30:21 +01:00
Robbie Trencheny
dc64634e21 Set Onkyo reset log to debug instead of info (#22369)
Onkyo logs this message somewhat frequently, and its spammy, so lets make it a debug message instead of info. 

See also: #20081
2019-03-24 17:15:07 -07:00
Jason Hunter
0ae38aece8 Prefer TCP for RTSP streams (#22338)
## Description:

For RTSP streams, set the `prefer_tcp` FFMPEG flag.  This should resolve some of the "green feed" issues that some users are reporting, likely due to packets being lost over UDP on their network.

Resources: [FFMPEG protocols documentation](https://ffmpeg.org/ffmpeg-protocols.html#rtsp)

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-24 17:13:20 -07:00
ktnrg45
88df2e0ea5 Fix ps4 no creds with additional device (#22300)
* Fix no creds with additional device.

* Update config_flow.py
2019-03-24 20:08:59 -04:00
Sebastian Muszynski
7421156dfc Add support for the power socket of the Xiaomi AC Partner V3 (#22205) 2019-03-24 20:15:29 +01:00
Sebastian Muszynski
d5732c4dba Add color support to Philips Moonlight (#22204) 2019-03-24 20:14:35 +01:00
Anders Melchiorsen
eabb68ad7d Do not warn when creating an empty database (#22343) 2019-03-24 12:00:29 -07:00
Robert Svensson
8d1cf553de Support deCONZ library with exception handling (#21952) 2019-03-24 19:27:32 +01:00
Yu
89f8203163 Fix xiaomi aqara cube with lumi.acpartner.v3 gateway (#22130) 2019-03-24 18:56:17 +01:00
MatthewFlamm
ed93c3b2c1 Fix pressure in dark sky and openweathermap and add pressure utility (#21210) 2019-03-24 18:37:31 +01:00
Robert Svensson
6988fe783c Axis config flow (#18543)
* Initial draft

* Add tests for init
Fix hound comments

* Add tests for device
Change parameter handling to make device easier to test

* Remove superfluous functionality per Martins request

* Fix hound comments

* Embedded platforms

* Fix device import

* Config flow retry

* Options default values will be set automatically to options in config entry before component can be used

* Clean up init
Add populate options
Fix small issues in config flow
Add tests covering init

* Improve device tests

* Add config flow tests

* Fix hound comments

* Rebase miss

* Initial tests for binary sensors

* Clean up
More binary sensor tests

* Hound comments

* Add camera tests

* Fix initial state of sensors

* Bump dependency to v17

* Fix pylint and flake8

* Fix comments
2019-03-24 16:16:50 +01:00
zewelor
9214934d47 Move yeelight into component (#21593) 2019-03-24 13:01:12 +01:00
René-Marc Simard
71ebc4f594 Define GTFS sensor as a timestamp device class (#21053) 2019-03-24 12:15:30 +01:00
uchagani
c5f4aa0466 show which component is causing translation errors (#22340) 2019-03-23 23:06:55 -07:00
Jason Hunter
49b92b5349 fix where PLATFORM_SCHEMA gets pulled from (#22334) 2019-03-23 23:49:44 -04:00
Paulus Schoutsen
1ddc249989 Consolidate more platforms (#22308)
* Consolidate final platforms

* Fix some tests

* Fix more tests

* Fix more tests
2019-03-23 20:22:35 -07:00
Fabian Affolter
4c4eff1d62 Update file header (#22318)
* Update file header

* Fix indent

* Fix lint issue
2019-03-23 22:05:47 +01:00
Thibault Maekelbergh
16dbf9b2ea Remove occupancy as it is not available in API (#22320) 2019-03-23 20:05:08 +01:00
Paulus Schoutsen
c68b621972 Google Assistant: Add camera stream trait (#22278)
* Add camera stream trait

* Lint
2019-03-23 09:16:43 -07:00
SNoof85
d81df1f0ae Add Freebox switch platform (#21710)
* Added Freebox switch and bump aiofreepybox version

* Added missing modified files

* removed unused import

* gen_requirements_all passed

* removed unused import

* Remove unused code

* lint fixes

* More lint fixe

* Bump aiofreepybox version and API version to Freebox

* Remove URL from log entry

* import relative

* Sort imports
2019-03-23 15:32:53 +01:00
Markus Jankowski
112ed88d64 Add homematicip cloud connection quality related attributes (#21990) 2019-03-23 13:21:55 +01:00
Fabian Affolter
5f34d3ccb9 Update abbreviation (#22317) 2019-03-23 12:07:32 +01:00
Fabian Affolter
3c811bbf1a Upgrade py-cpuinfo to 5.0.0 (#22287) 2019-03-23 08:00:43 +01:00
Fabian Affolter
90dfe72d31 Upgrade pylast to 3.1.0 (#22302) 2019-03-23 08:00:13 +01:00
Robbie Trencheny
89221bfab9 Fix for embedded MQTT server configuration (#22305)
## Description:

Passing in a configuration for the embedded MQTT server has been broken for a while. This fixes that. See related issue number for further details.

**Related issue (if applicable):** fixes #18228

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 16:01:58 -07:00
Robbie Trencheny
773c567563 Switch from using Google Maps API for elevation to Open Elevation API (#22306)
## Description:

Switches elevation helper to use [Open Elevation](https://open-elevation.com/) instead of Google Maps API which now requires a API key. It's a drop in replacement for Google Maps too!

**Related issue (if applicable):** fixes #19860

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 16:01:43 -07:00
Robbie Trencheny
58c23bc2d9 Update srpenergy library (#22307)
Fixes #18899
2019-03-22 16:01:21 -07:00
cgtobi
611597a87b Sort code owners alphabetically (#22304)
## Description:
Sort the code oweners list alphabetically.

**Related issue (if applicable):** fixes #<home-assistant issue number goes here>

**Pull request in [home-assistant.io](https://github.com/home-assistant/home-assistant.io) with documentation (if applicable):** home-assistant/home-assistant.io#<home-assistant.io PR number goes here>

## Example entry for `configuration.yaml` (if applicable):
```yaml

```

## Checklist:
  - [ ] The code change is tested and works locally.
  - [ ] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [ ] There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:
  - [ ] Documentation added/updated in [home-assistant.io](https://github.com/home-assistant/home-assistant.io)

If the code communicates with devices, web services, or third-party tools:
  - [ ] New dependencies have been added to the `REQUIREMENTS` variable ([example][ex-requir]).
  - [ ] New dependencies are only imported inside functions that use them ([example][ex-import]).
  - [ ] New or updated dependencies have been added to `requirements_all.txt` by running `script/gen_requirements_all.py`.
  - [ ] New files were added to `.coveragerc`.

If the code does not interact with devices:
  - [ ] Tests have been added to verify that the new code works.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-22 14:05:26 -07:00
Penny Wood
ecabf92504 Update trait to support auto without ranges. (#21847) 2019-03-22 13:42:56 -07:00
Robbie Trencheny
e9cd9f88be Fix Prometheus casting issues (#22282)
## Description:

Fix Prometheus casting issues

**Related issue (if applicable):** fixes #8659.
## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-22 13:16:17 -07:00
Leonardo Merza
a58f1eedda Add sort by config and tests for Reddit integration (#22081)
* add sort type to reddit sensor

add sort type to reddit sensor

automated commit 14/03/2019 15:53:15

automated commit 15/03/2019 09:43:39

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

reddit sensor add tests and sort by config

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests

* Add reddit sensor sort_by config and tests
2019-03-22 21:05:08 +01:00
jjlawren
ce550206a4 Fix progress for Plex media_players (#22224)
* Return current position and last updated timestamp needed by UI

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing

* Use seconds

* Update homeassistant/components/plex/media_player.py

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

* Add throttling to position updating

* Simplify logic, don't clear position when refreshing
2019-03-22 14:00:12 -06:00
Penny Wood
1ddc65a0ce Fixing the api_streams sensor (#22200)
* Fire events with websocket messages.

* Added tests to validate

* Fixed api_streams sensor to use new sensor

* Delete from coverageac as now works.

* Removed websocket request event.

* Use dispatcher instead of events.

* Moved sensor to under websocket_api

* Changes as per code review

* Fixed tests.

* Modified test

* Patch
2019-03-22 11:59:10 -07:00
Anders Melchiorsen
2b6e197deb Consolidate the netgear_lte configuration (#22105)
* Consolidate the netgear_lte configuration

* Simplfications from review

* Extract sensor_types

* Simplify defaults
2019-03-22 14:43:39 +01:00
Jeff Irion
b125514655 Improved exception handling and logging (#22268)
Catch RuntimeError exceptions. Don't log ADB command output if there isn't any.
2019-03-22 08:47:06 -04:00
Jeff Irion
c90e13bfef Bump androidtv to 0.0.13 (#22279)
* Bump androidtv to 0.0.13

* Bump androidtv to 0.0.13 in requirements_all.txt
2019-03-22 09:25:31 +01:00
jjlawren
30d4a9f12c Plex: Avoid refreshing by both device and session methods (#22266)
* Avoid refreshing by both device and session methods

* Fix indentation
2019-03-21 19:41:41 -07:00
Fabian Affolter
3432c5da9e Upgrade sqlalchemy to 1.3.0 (#22269) 2019-03-21 19:40:11 -07:00
Paulus Schoutsen
ae2153f1fc Merge pull request #22265 from home-assistant/rc
0.90.1
2019-03-21 14:24:28 -07:00
Pascal Vizeli
8085e9206a Update hass-nabucasa 0.10 (#22267) 2019-03-21 14:21:37 -07:00
Pascal Vizeli
5716d0aa1a Update hass-nabucasa 0.10 (#22267) 2019-03-21 14:21:13 -07:00
Daniel Høyer Iversen
86a510441c Upgrade tibber libary, support solar production (#22261) 2019-03-21 16:46:25 -04:00
Paulus Schoutsen
ff93591aaf Lint 2019-03-21 13:22:08 -07:00
Pascal Vizeli
8a314d7da0 Update Hass-NabuCasa 0.9 (#22258) 2019-03-21 13:06:15 -07:00
Andrew Sayre
f47a50aa24 Fix validate webhook requirements (#22248) 2019-03-21 13:06:13 -07:00
Michaël Arnauts
b2bb70b5aa Allow on/off on tado climate component. (#22242)
* Allow on/off on tado climate component. Bump python-tado version. Patch from @wmalgadey

* Revert wrongly change in tado device tracker
2019-03-21 13:05:46 -07:00
Jason Hunter
56cbe8a73f Stream fixes (#22238)
* fix issues with out of order packets, and empty first packet on some IP camera models

* do not skip the first packet
2019-03-21 13:05:09 -07:00
Paulus Schoutsen
0f730310a4 Bumped version to 0.90.1 2019-03-21 13:03:40 -07:00
Karim Roukoz
1aab284012 Bump total-connect-client to 0.25, fixing issue with Total Connect (#22230)
* Bump total-connect-client to 0.25

* Bump version in requirements_all.txt
2019-03-21 13:03:25 -07:00
Alexei Chetroi
a84ba90c9e Fix ZHA force polled entities. (#22222)
## Description:
Fix "force_polled" ZHA entities.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-21 13:02:35 -07:00
Ryan Bahm
bc85d47878 Change .now() to .utcnow() (#22233)
ephem works in UTC time, not local time. As a result, our comparison needs to be in UTC for accurate results.
2019-03-21 12:59:07 -07:00
Paulus Schoutsen
ee1c270c89 Updated frontend to 20190321.0 2019-03-21 12:57:47 -07:00
Paulus Schoutsen
72bb94de96 Update translations 2019-03-21 12:57:20 -07:00
Paulus Schoutsen
0a4251e08f Updated frontend to 20190321.0 2019-03-21 12:56:59 -07:00
Pascal Vizeli
1b66520e31 Update Hass-NabuCasa 0.9 (#22258) 2019-03-21 19:39:24 +01:00
Penny Wood
81bb928394 Handle on/off through TemperatrureSetting trait. (#21842) 2019-03-21 10:57:42 -07:00
Karim Roukoz
fe468ace34 Bump total-connect-client to 0.25, fixing issue with Total Connect (#22230)
* Bump total-connect-client to 0.25

* Bump version in requirements_all.txt
2019-03-21 09:39:30 -07:00
Andrew Sayre
6526c68e2d Fix validate webhook requirements (#22248) 2019-03-21 09:13:20 -07:00
Michaël Arnauts
f64a99878f Allow on/off on tado climate component. (#22242)
* Allow on/off on tado climate component. Bump python-tado version. Patch from @wmalgadey

* Revert wrongly change in tado device tracker
2019-03-21 08:24:30 -07:00
Alexei Chetroi
03855c18fc add ZHA channel name property (#22218)
* Make channel name a property.

* Cleanup Zigbee channels.

Use zcl.Cluster.ep_attribute as default channel name.
2019-03-21 07:40:12 -07:00
Jason Hu
2b02c0d0fc Fix build issue (#22251) 2019-03-21 07:32:13 -07:00
Jason Hunter
07dc23a0e3 Stream fixes (#22238)
* fix issues with out of order packets, and empty first packet on some IP camera models

* do not skip the first packet
2019-03-21 07:31:55 -07:00
Steven Looman
77635d40e2 Upgrade to async_upnp_client==0.14.6 (#22223)
Upgrade to async_upnp_client to 0.14.6
2019-03-21 08:58:04 +01:00
Sebastian Muszynski
f4102339c1 Bump python-miio version (#22202)
* Bump python-miio version

* Rename speed property to motor_speed

* Enable set_led service of the Air Humidifier

* Allow a favorite level in [0...17]

* Allow a scene in [0...6]
2019-03-21 08:56:36 +01:00
uchagani
21871b3d6b add date_time_iso to time_date sensor (#22199)
* add date_time_iso to time_date sensor

* hound fixes

* lint fixes
2019-03-21 08:55:30 +01:00
Quentin Stafford-Fraser
88be786e82 Make !include_dir_list use alphanumeric order (#21902)
* Make YAML includes such as !include_dir_list incorporate files in alphabetical order

* Test for !include_dir_list sorting
2019-03-20 23:10:08 -07:00
Paulus Schoutsen
4b1de61110 Use relative imports inside integrations (#22235)
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Marco Orovecchia
ab17b22239 Removed overly broad exception handling for nanoleaf light (#22189) 2019-03-20 20:32:06 -07:00
Fabian Affolter
423d595edf Upgrade holidays to 0.9.10 (#22182) 2019-03-20 20:31:15 -07:00
Fabian Affolter
e044eace20 Upgrade psutil to 5.6.1 (#22183)
* Upgrade psutil to 5.6.1

* Upgrade speedtest-cli to 2.1.1
2019-03-20 20:30:52 -07:00
Alexei Chetroi
9653544144 Fix ZHA force polled entities. (#22222)
## Description:
Fix "force_polled" ZHA entities.

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.

[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L14
[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard/__init__.py#L23
2019-03-20 19:15:21 -07:00
Paulus Schoutsen
937eba3dbe Merge pull request #22216 from home-assistant/rc
0.90.0
2019-03-20 10:16:24 -07:00
Paulus Schoutsen
01d8b5831e Updated frontend to 20190320.0 2019-03-20 07:51:38 -07:00
Paulus Schoutsen
9d8054e6e2 Bumped version to 0.90.0 2019-03-20 07:51:23 -07:00
Penny Wood
d4cd39e43e Fixed typing errors (#22207) 2019-03-20 07:51:14 -07:00
Paulus Schoutsen
1bf49ce5a3 Updated frontend to 20190320.0 2019-03-20 07:50:24 -07:00
Penny Wood
62c2bbd59a Fixed typing errors (#22207) 2019-03-20 07:49:27 -07:00
Matt Snyder
398281959a Update codeowners (#22198) 2019-03-20 11:33:42 +01:00
Paulus Schoutsen
7cf1f4f9fe Bumped version to 0.90.0b7 2019-03-19 16:48:31 -07:00
Paulus Schoutsen
268d129ea9 Updated frontend to 20190319.1 2019-03-19 16:36:11 -07:00
CV
db07e45df8 Fix breaking on HTML email without images (#22143)
* Fix breaking on HTML email without images

If using html emails with no images the code breaks since it is not tested for empty (uninitialized) key images.

* fixed long line

* Implemented suggested better solution

Better solution to allow data -> html email without images.

* Protecting data -> without html key from crashing

If the data key does not contain the html key, sending the email would crash this "script". Preventing this by returning an default empty array.
2019-03-19 14:37:12 -07:00
Jc2k
0344c761fc Better handling of HomeKit accessory-information service (#22171)
* HomeKit controller: Better handling of accessory-information service

* Changes from review
2019-03-19 15:04:20 -04:00
Fabian Affolter
6cb8806085 Upgrade Sphinx to 1.8.5 (#22180) 2019-03-19 15:02:56 -04:00
Fabian Affolter
2b250a7ec8 Upgrade youtube_dl to 2019.03.18 (#22181) 2019-03-19 15:01:58 -04:00
Paulus Schoutsen
b8f246356a Bumped version to 0.90.0b6 2019-03-19 11:41:08 -07:00
Paulus Schoutsen
e6ffc790f2 Always load Hass.io component on Hass.io (#22185)
* Always load Hass.io component on Hass.io

* Lint

* Lint
2019-03-19 11:40:49 -07:00
Pascal Vizeli
b85189e699 Update Hass-NabuCasa 0.8 (#22177) 2019-03-19 11:40:48 -07:00
uchagani
f202114ead bump total_connect_client to 0.24 (#22166) 2019-03-19 11:40:06 -07:00
Paulus Schoutsen
fff6927f9c Updated frontend to 20190319.0 2019-03-19 11:38:16 -07:00
Paulus Schoutsen
08849fd3e8 Updated frontend to 20190319.0 2019-03-19 11:38:05 -07:00
Paulus Schoutsen
92dc26bab3 Always load Hass.io component on Hass.io (#22185)
* Always load Hass.io component on Hass.io

* Lint

* Lint
2019-03-19 11:33:50 -07:00
Eliseo Martelli
88669c6543 removed iliad (#22175) 2019-03-19 16:16:29 +01:00
Daniel Høyer Iversen
350904870e restore entity for switchbot (#22087) 2019-03-19 16:16:10 +01:00
Pascal Vizeli
1499485a71 Update Hass-NabuCasa 0.8 (#22177) 2019-03-19 15:10:30 +01:00
Penny Wood
bf4b7a82b4 Move platforms patch (#22168)
* move mold sensor

* Get tests working

* Move moon and season sensor strings.

* Renamed sensor strings.
2019-03-19 06:43:15 -07:00
Jc2k
c2aa06d0d4 Add some tests for Koogeek LS1 (#22141) 2019-03-19 00:58:56 -07:00
uchagani
188293770e bump total_connect_client to 0.24 (#22166) 2019-03-19 00:51:42 -07:00
Andrew Hall
12df14b87b Change ATTR_BATTERY_STATE_UNPLUGGED for ios component (#22152)
* AH - Updated Text Description of ATTR_BATTERY_STATE_UNPLUGGED

* AH - updated device_tracker ios test to use new battery state description
2019-03-19 00:46:04 -07:00
Penny Wood
f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
David F. Mulcahey
46ece3603f Add dynamic subscription for ZHA add device page (#22164)
* add ws subscription for zha gateway messages
* add debug mode
* only relay certain logs
* add missing require admin
* add devices command
* add area_id
* fix manufacturer code
2019-03-18 22:35:03 -04:00
Paulus Schoutsen
ad0ec66353 Bumped version to 0.90.0b5 2019-03-18 17:04:49 -07:00
Franck Nijhof
592edd10ef Upgrade toonapilib to 3.2.2 + lower interval (#22160) 2019-03-18 17:04:43 -07:00
Pascal Vizeli
d75d75e49f Remove config check over supervisor (#22156)
* Remove config check over supervisor

* Fix lint

* Fix tests
2019-03-18 17:04:42 -07:00
Jason Hunter
1c9b750e36 Fix resetting access token on streams with keepalive (#22148) 2019-03-18 17:04:41 -07:00
WebSpider
33a7075883 Bump tado version (#22145)
* Bump python-tado, new API endpoint

* Change references of old API endpoint to new

* Update REQUIREMENTS
2019-03-18 17:04:40 -07:00
Paulus Schoutsen
cc00f3cd2e Allow non-admins to listen to certain events (#22137) 2019-03-18 17:04:39 -07:00
Jason Hu
22624715a9 Remove hass.config from aws_lambda notify payload (#22125) 2019-03-18 17:04:38 -07:00
Paulus Schoutsen
05db444832 Updated frontend to 20190318.0 2019-03-18 17:04:04 -07:00
Pascal Vizeli
ecfe0fc3dd Remove config check over supervisor (#22156)
* Remove config check over supervisor

* Fix lint

* Fix tests
2019-03-18 16:58:48 -07:00
Franck Nijhof
e5a2ef9b8d Upgrade toonapilib to 3.2.2 + lower interval (#22160) 2019-03-18 16:56:57 -07:00
Paulus Schoutsen
c37dcacf54 Updated frontend to 20190318.0 2019-03-18 16:54:31 -07:00
zewelor
9591aa66ba Fixx yeelight flow action param for declared effects (#22159) 2019-03-18 20:51:42 +01:00
Ben Lebherz
af473cddf0 replace einder lib with horimote (#22135) 2019-03-18 20:14:14 +01:00
James Hilliard
9c7ef13f91 Fix hlk-sw16 inverted switch state (#22059) 2019-03-18 10:57:44 -07:00
endor
9f96aab2f4 Additional sensors and fixed icons, attributes and device classes. (#22139) 2019-03-18 18:55:09 +01:00
Jason Hunter
ce5cf5803c Fix resetting access token on streams with keepalive (#22148) 2019-03-18 09:27:34 -04:00
WebSpider
e14b243336 Bump tado version (#22145)
* Bump python-tado, new API endpoint

* Change references of old API endpoint to new

* Update REQUIREMENTS
2019-03-18 08:54:24 -04:00
Paulus Schoutsen
29131a655d Allow non-admins to listen to certain events (#22137) 2019-03-17 19:13:06 -07:00
Aaron Bach
c020b7c47d Handle possible exception during Ambient PWS reconnect (#22134)
* Handle possible exception during Ambient PWS reconnect

* Hound
2019-03-17 13:06:19 -06:00
Aaron Bach
8529ad3ba1 Loosen field retrieval from Pollen.com (#22132) 2019-03-17 11:55:58 -06:00
Aaron Bach
0d42ed1861 Handle occassional 502 Bad Gateway from SimpliSafe (#22131) 2019-03-17 11:55:10 -06:00
cgtobi
ba923d2d66 Add service description for services. (#21897)
* Add service description for services.

* Make service description more clear
2019-03-17 13:04:09 +01:00
Tyler Page
9b1491a98d Fix AttributeError traceback with darksky (#22101)
* Update darksky.py

* fixes
2019-03-17 12:06:39 +01:00
Jason Hu
1aab551eed Remove hass.config from aws_lambda notify payload (#22125) 2019-03-17 11:42:49 +01:00
Daniel Høyer Iversen
54dfc3e2b4 Tibber, Add price level (#22085)
* Add price level to Tibber sensor

* bump pyTibber version
2019-03-17 09:34:50 +01:00
Otto Winter
cf5ba7d922 Add ESPHome Camera (#22107)
* Add ESPHome Camera

* Bump aioesphomeapi to 1.7.0
2019-03-16 23:36:31 -07:00
Paulus Schoutsen
872ee3eb21 Bumped version to 0.90.0b4 2019-03-16 23:26:48 -07:00
Jason Hunter
f218564185 delete previously removed service option from services yaml (#22123) 2019-03-16 23:26:17 -07:00
Paulus Schoutsen
16ac1d4600 Updated frontend to 20190316.0 2019-03-16 23:25:57 -07:00
Paulus Schoutsen
d16c507f34 Updated frontend to 20190316.0 2019-03-16 23:23:28 -07:00
Jason Hunter
54489a3514 delete previously removed service option from services yaml (#22123) 2019-03-16 23:16:05 -07:00
Paulus Schoutsen
f5076188ef Consolidate all platforms that have no tests (#22096)
* Consolidate

* Fix tests

* Update imports

* Fix import

* Use importlib because integration and package share name

* Fix more tests

* Update .coveragerc and CODEOWNERS
2019-03-16 20:44:05 -07:00
mvn23
d33cad0b24 Improve opentherm gw startup (#22121)
* Improve fix in c90f0d5 (#22106). Schedule connect coroutine directly on the loop rather than waiting for EVENT_HOMEASSISTANT_START.

* Remove unused import.
2019-03-16 23:51:50 +01:00
mvn23
4423572682 Fix TypeError in current_temperature if no temperature is known. (#22112)
Don't set opentherm_gw climate temperatures to 0 on init.
2019-03-16 16:34:31 +01:00
mvn23
c90f0d5bd6 Fix opentherm_gw blocks HA startup when gateway unreachable. (#22106) 2019-03-16 16:32:51 +01:00
Andre Lengwenus
0466e43478 Restricted temperature units for Celsius and Fahrenheit to the standardized units (#22108) 2019-03-16 16:31:58 +01:00
Aaron Bach
7807b40925 Add available property to Ambient PWS (#22092)
* Add available property to Ambient PWS

* Linting

* remove blank line
2019-03-16 11:33:22 +01:00
Phil Bruckner
9e4bd88a06 Bump amcrest to 1.2.7 for correct RTSP port (#22099)
amcrest 1.2.7 now includes camera's configured RTSP port in generated URL. Necessary to make new stream component work correctly if camera does not use default RTSP port.
2019-03-16 08:20:49 +01:00
Ville Skyttä
b4f8d157d6 Upgrade pytest to 4.3.1 (#22088) 2019-03-16 08:13:45 +01:00
Paulus Schoutsen
ade86b9b8d Version bump to 0.91.0dev0 2019-03-15 23:25:48 -07:00
Paulus Schoutsen
179c2315be Updated frontend to 20190315.1 2019-03-15 23:24:37 -07:00
Paulus Schoutsen
7b224dde23 Bumped version to 0.90.0b3 2019-03-15 23:20:19 -07:00
Jason Hunter
7a88c58ffa Beta Fix: FFMPEG and Stream component (#22091)
* remove stream_source from ffmpeg and onvif and add to generic ip cam

* fix tests
2019-03-15 23:19:52 -07:00
Jason Hunter
f396de623b Beta Fix: FFMPEG and Stream component (#22091)
* remove stream_source from ffmpeg and onvif and add to generic ip cam

* fix tests
2019-03-15 23:19:32 -07:00
Paulus Schoutsen
68d1a5322a Prevent cloud remote UI when using 127.0.0.1 as trusted network (#22093)
* Prevent cloud remote UI when using trusted networks

* Limit to 127.0.0.1 trusted network

* Update error msg

* Disable ipv6 loopback
2019-03-15 23:19:26 -07:00
Jeff Irion
a46b64d227 Bump androidtv to 0.0.12 (#22072) 2019-03-15 23:19:26 -07:00
Paulus Schoutsen
5924479272 Updated frontend to 20190315.1 2019-03-15 23:19:09 -07:00
Andre Lengwenus
d0365f5911 Add LCN sensor platform (#21440) 2019-03-15 22:10:56 -05:00
Paulus Schoutsen
dbdf5558e6 Prevent cloud remote UI when using 127.0.0.1 as trusted network (#22093)
* Prevent cloud remote UI when using trusted networks

* Limit to 127.0.0.1 trusted network

* Update error msg

* Disable ipv6 loopback
2019-03-15 19:26:10 -07:00
Nacho Barrientos
42265036ff Telegram_bot: Allow fetching data from unverified SSL endpoints (#22067) (#22069)
* Telegram_bot: Allow fetching data from unverified SSL endpoints (#22067)

This patch adds an extra option to the payload that describes the
resource to send to disable the SSL server verification when polling
data from URLs.

* Use the boolean interpretation of the variable directly

Co-Authored-By: nbarrientos <nacho@criptonita.com>
2019-03-16 09:18:10 +08:00
Jeff Irion
53b204347d Bump androidtv to 0.0.12 (#22072) 2019-03-15 12:25:09 -07:00
Paulus Schoutsen
aa81819683 Fix func 2019-03-15 11:12:12 -07:00
Paulus Schoutsen
dc656205c4 Fix func 2019-03-15 11:11:59 -07:00
Paulus Schoutsen
ff6b86b5a8 Bumped version to 0.90.0b2 2019-03-15 10:59:55 -07:00
Paulus Schoutsen
3d404c43c8 Fix more test 2019-03-15 10:59:50 -07:00
Paulus Schoutsen
b18aef8d31 Fix test 2019-03-15 10:59:50 -07:00
Pascal Vizeli
ac1aeb35a6 Binary Sensor for Remote UI & Fix timezone (#22076)
* Binary Sensor for Remote UI

* Fix lint

* Revert make hass public

* Add tests
2019-03-15 10:59:27 -07:00
Jason Hu
3ec8b5a170 Correct context (#22061) 2019-03-15 10:59:26 -07:00
Paulus Schoutsen
8f10345468 Return config entry ID after creation (#22060) 2019-03-15 10:59:25 -07:00
Robbie Trencheny
0029dc3813 Mobile App: Expose Cloud Remote UI FQDN in registration response (#22055)
* Add a callback to get the cloud remote UI FQDN

* Expose Cloud Remote UI FQDN in the registration response

* Return a URL instead of FQDN
2019-03-15 10:59:25 -07:00
Robbie Trencheny
11ebb3f24e Mobile App: Discovery to default configuration.yaml, zeroconf to default_config (#22028)
* Move discovery into default configuration.yaml

* Add zeroconf to default_config
2019-03-15 10:59:25 -07:00
Robbie Trencheny
4835fb2c57 Mobile App: Enable loading via discovery (surprise inside!) (#22027)
![](http://funpeep.com/wp-content/uploads/2014/04/Cute-White-Cat-Wallpaper.jpg)
2019-03-15 10:59:23 -07:00
Jeff Irion
25a7f71ec2 Bump androidtv to 0.0.11 (#22025) 2019-03-15 10:59:22 -07:00
Robbie Trencheny
f0b7d76e26 Mobile App: Sensors (#21854)
## Description:

**Related issue (if applicable):** fixes #21782

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-15 10:57:24 -07:00
Robbie Trencheny
f7dcfe28b6 Mobile App: Register devices into the registry (#21856)
* Register devices into the registry

* Switch to device ID instead of webhook ID

* Rearchitect mobile_app to support config entries

* Kill DATA_REGISTRATIONS by migrating registrations into config entries

* Fix tests

* Improve how we get the config_entry_id

* Remove single_instance_allowed

* Simplify setup_registration

* Move webhook registering functions into __init__.py since they are only ever used once

* Kill get_registration websocket command

* Support description_placeholders in async_abort

* Add link to mobile_app implementing apps in abort dialog

* Store config entry and device registry entry in hass.data instead of looking it up

* Add testing to ensure that the config entry is created at registration

* Fix busted async_abort test

* Remove unnecessary check for entry is None
2019-03-15 10:57:00 -07:00
Robbie Trencheny
3fd1e8d382 Mobile App: Update Location schema updates & device ID generation (#21849)
* Update location schema

* Generate a random device ID at registration time for later use with device_tracker.see

* Remove host name from device_tracker.see payload

* Drop consider_home from the payload

* Remove stale consider_home in schema

* Remove source_type
2019-03-15 10:56:36 -07:00
Robbie Trencheny
c67113ad55 Mobile App: Support rendering multiple templates at once (#21851)
* Support rendering multiple templates at once

* Only catch TemplateError and dont log the error
2019-03-15 10:56:06 -07:00
Robbie Trencheny
b336322e9e Mobile App: Require encryption for registrations that support it (#21852)
## Description:

**Related issue (if applicable):** fixes #21758

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-15 10:55:45 -07:00
Paulus Schoutsen
9e6a7a6357 Updated frontend to 20190315.0 2019-03-15 10:49:13 -07:00
Paulus Schoutsen
087748b5ff Updated frontend to 20190315.0 2019-03-15 10:43:32 -07:00
Pascal Vizeli
17ba33004c Binary Sensor for Remote UI & Fix timezone (#22076)
* Binary Sensor for Remote UI

* Fix lint

* Revert make hass public

* Add tests
2019-03-15 10:39:53 -07:00
Isabella Gross Alström
9520d38288 Update rest.py (#22077)
Added specific error logs for 5xx and 4xx responses, debug log for 2xx and other statuses.
2019-03-15 10:14:22 -07:00
Jason Hu
cf69f25354 Correct context (#22061) 2019-03-15 10:01:15 -07:00
Fabian Affolter
101225749b Upgrade ruamel.yaml to 0.15.89 (#22064) 2019-03-15 09:22:00 -07:00
Paulus Schoutsen
e581d9e249 Fix more test 2019-03-15 09:14:20 -07:00
Paulus Schoutsen
3ce50b0a6a Fix test 2019-03-15 07:47:13 -07:00
Paulus Schoutsen
941f9b29dc Return config entry ID after creation (#22060) 2019-03-15 07:41:34 -07:00
escoand
3b34594aa3 Add HTTP auth and SSL verification to REST notify (#22016)
* add HTTP auth and SSL verification

* use internal import

* fix long line

* avoid extra import
2019-03-15 08:43:54 +01:00
Robbie Trencheny
5a9e8b2d3e Mobile App: Expose Cloud Remote UI FQDN in registration response (#22055)
* Add a callback to get the cloud remote UI FQDN

* Expose Cloud Remote UI FQDN in the registration response

* Return a URL instead of FQDN
2019-03-14 19:46:59 -07:00
David F. Mulcahey
89c96279ce Cleanup remaining constants stuff in ZHA (#22050)
* clean up constants
* fix quirks until it can be upgradded
2019-03-14 21:00:49 -04:00
Robbie Trencheny
851378739f Fix cloud services.yaml 2019-03-14 17:48:38 -07:00
Alexei Chetroi
9575c20b7c Minor ZHA consts fixes (#22049)
* Use consts for zha.core.consts

* Fix ZHA battery reporting config.
2019-03-14 20:29:12 -04:00
Robbie Trencheny
dcaced1966 Mobile App: Sensors (#21854)
## Description:

**Related issue (if applicable):** fixes #21782

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-14 17:24:53 -07:00
Paulus Schoutsen
fb895bba80 Bumped version to 0.90.0b1 2019-03-14 16:25:00 -07:00
Pascal Vizeli
707d32495b Fix Google Assistant User with Cloud (#22042)
* Fix Google Assistant User with Cloud

* Fix User Agent ID

* respell

* Fix object

* Fix tests

* fix lint

* Fix lint
2019-03-14 16:19:19 -07:00
Jason Hu
7057958e3e Fix lifx light async error (#22031) 2019-03-14 16:19:19 -07:00
emontnemery
90c878a7ed Update additional platforms to use new MQTT message callback (#22030)
* Move additional platforms to new MQTT callback

* Fix automation.mqtt
2019-03-14 16:19:18 -07:00
cgtobi
c78e332df3 Bring back the boiler status (#22021) 2019-03-14 16:19:18 -07:00
Phil Hawthorne
42c9472a74 Remove UTF8 decoding for Waze (#22020)
Removes the UFT8 decoding for the Waze sensor, which broke in 0.89

Fixes #21739
2019-03-14 16:19:17 -07:00
Pascal Vizeli
6a80ffa8cc Fix Google Assistant User with Cloud (#22042)
* Fix Google Assistant User with Cloud

* Fix User Agent ID

* respell

* Fix object

* Fix tests

* fix lint

* Fix lint
2019-03-14 16:18:31 -07:00
Robbie Trencheny
3769f5893a Mobile App: Register devices into the registry (#21856)
* Register devices into the registry

* Switch to device ID instead of webhook ID

* Rearchitect mobile_app to support config entries

* Kill DATA_REGISTRATIONS by migrating registrations into config entries

* Fix tests

* Improve how we get the config_entry_id

* Remove single_instance_allowed

* Simplify setup_registration

* Move webhook registering functions into __init__.py since they are only ever used once

* Kill get_registration websocket command

* Support description_placeholders in async_abort

* Add link to mobile_app implementing apps in abort dialog

* Store config entry and device registry entry in hass.data instead of looking it up

* Add testing to ensure that the config entry is created at registration

* Fix busted async_abort test

* Remove unnecessary check for entry is None
2019-03-14 12:57:50 -07:00
Charles Garwood
62f12d242a Z-Wave usb_path in configuration.yaml overrides config entry usb_path (#22038)
* usb_path in configuration.yaml overrides config entry

* Minor text update

* Update __init__.py
2019-03-14 12:29:21 -07:00
emontnemery
b25e951dcc Update additional platforms to use new MQTT message callback (#22030)
* Move additional platforms to new MQTT callback

* Fix automation.mqtt
2019-03-14 10:58:32 -07:00
Phil Bruckner
8d2d71c16a Bump amcrest to 1.2.6 & use new exceptions (#22040)
* Bump amcrest to 1.2.6 & use new exceptions

* Fix lint failure

* Use AmcrestError instead of individual ones
2019-03-14 10:56:33 -07:00
Fredrik Erlandsson
4e84e8a15e Async support for Daikin (#21638)
* asyncio support for Daikin

* version bump pydaikin

* pass session to pydaikin.Appliance

* all entities should have update
2019-03-14 18:33:43 +01:00
cgtobi
018a5d5c1f Bring back the boiler status (#22021) 2019-03-14 10:18:25 -07:00
Fabian Affolter
bd930b6e96 Upgrade youtube_dl to 2019.03.09 (#22041) 2019-03-14 10:14:27 -07:00
ktnrg45
ef2e3f607a Ps4 remove throttling (#21961)
* Remove throttling

* Correct docstring
2019-03-14 17:49:57 +01:00
Jason Hu
e480f75d6d Fix lifx light async error (#22031) 2019-03-14 17:10:36 +01:00
David F. Mulcahey
300384410f Refactor ZHA gateway into modules and add admin protections to API (#22023)
* refactor

* cleanup

* fix tests

* admin all the things
2019-03-14 10:20:25 -04:00
Daniel Høyer Iversen
b022428cb6 change logging to debug for nmap (#22036) 2019-03-14 10:00:19 -04:00
mvn23
2b25c25ca8 Bump pyotgw to 0.4b2 (#21973) 2019-03-14 13:11:04 +01:00
Jason Hu
4ff8a46acf Upgrade prefetched tox env to py37 (#22029) 2019-03-14 13:09:32 +01:00
kbickar
abf2e763b1 Add sense guard clause (#22014) 2019-03-14 11:46:44 +01:00
Jeff Irion
6381242eca Bump androidtv to 0.0.11 (#22025) 2019-03-14 17:25:07 +08:00
Robbie Trencheny
e75b12b92a Add myself to CODEOWNERS 2019-03-14 00:34:52 -07:00
Robbie Trencheny
95da6d41f9 Mobile App: Discovery to default configuration.yaml, zeroconf to default_config (#22028)
* Move discovery into default configuration.yaml

* Add zeroconf to default_config
2019-03-13 22:05:56 -07:00
Robbie Trencheny
3fcfba0a1e Mobile App: Enable loading via discovery (surprise inside!) (#22027)
![](http://funpeep.com/wp-content/uploads/2014/04/Cute-White-Cat-Wallpaper.jpg)
2019-03-13 21:55:30 -07:00
Phil Hawthorne
2787671de5 Remove UTF8 decoding for Waze (#22020)
Removes the UFT8 decoding for the Waze sensor, which broke in 0.89

Fixes #21739
2019-03-13 19:08:23 -07:00
Robbie Trencheny
673c8907e3 Mobile App: Update Location schema updates & device ID generation (#21849)
* Update location schema

* Generate a random device ID at registration time for later use with device_tracker.see

* Remove host name from device_tracker.see payload

* Drop consider_home from the payload

* Remove stale consider_home in schema

* Remove source_type
2019-03-13 15:38:53 -07:00
Robbie Trencheny
5ef602bc2e Mobile App: Support rendering multiple templates at once (#21851)
* Support rendering multiple templates at once

* Only catch TemplateError and dont log the error
2019-03-13 15:33:37 -07:00
Robbie Trencheny
acc44aaf6c Mobile App: Require encryption for registrations that support it (#21852)
## Description:

**Related issue (if applicable):** fixes #21758

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
2019-03-13 15:22:43 -07:00
Paulus Schoutsen
07022c46f2 Version bump to 0.90.0b0 2019-03-13 13:03:58 -07:00
Paulus Schoutsen
b601fa52ba Bumped version to 0.89.0b0 2019-03-13 13:02:55 -07:00
Paulus Schoutsen
ce5efcdb26 Merge branch 'master' into dev 2019-03-13 13:02:26 -07:00
Gijs Reichert
1ffc0e3c7c Check updated_date for list and pick first (#22008) 2019-03-13 13:00:58 -07:00
Isabella Gross Alström
2dcd9d94c8 Allow all success status codes in REST notify response (#22011)
For example Discord webhooks returns a 204 success code as response, which gets logged as an error in the log, even though it is successful.
Update the allowed statuses to accept all 2xx responses as successful.
2019-03-13 13:00:08 -07:00
Andrew Sayre
83243e95d3 Remove default temp unit (#22012) 2019-03-13 12:59:37 -07:00
emontnemery
5957e4b75b Pass Message object to MQTT message callbacks (#21959)
* Pass Message object to MQTT message callbacks

* Improve method of detecting deprecated msg callback

* Fix mysensors

* Fixup

* Review comments

* Fix merge error
2019-03-13 12:58:20 -07:00
Paulus Schoutsen
50ec3d7de5 Update translations 2019-03-13 12:57:00 -07:00
Paulus Schoutsen
d0c8f6de56 Updated frontend to 20190313.0 2019-03-13 12:57:00 -07:00
Marco Orovecchia
cac8e34841 Nanoleaf availability check (#21945)
* Added availability check for nanoleaf lights

* pylint errors fixed

* pynanoleaf bump
2019-03-13 12:54:15 -07:00
Jc2k
deb66bb748 HomeKit controller light - remove code that can never execute (#21951) 2019-03-13 12:53:33 -07:00
beavis9k
eed1168fa1 fix error in LutronButton init if Button doesn't have a type (#21921) 2019-03-13 12:52:45 -07:00
Anders Melchiorsen
de2c7a9567 Wait for Sonos regrouping in service calls (#22006) 2019-03-13 12:51:41 -07:00
Anders Melchiorsen
fe5e4b5b9b Avoid playing queue pollution with Sonos unjoin (#22004) 2019-03-13 12:51:08 -07:00
Pascal Vizeli
186b48e2eb Bump NabuCasa library to 0.5 (#22010) 2019-03-13 16:45:26 +01:00
Aaron Bach
a71394a0ce Add program/zone enable/disable services to RainMachine (#21785) 2019-03-13 08:20:13 -06:00
Aaron Bach
897862fca4 Add availability and next run datetime to RainMachine switches (#21786) 2019-03-13 08:19:26 -06:00
endor
18daee9af6 Tellstick sensor configuration cleanup (#21402)
* Cleaned up named sensor handling for future

Breaking change for tellstick sensor configuration.

* Fixed linting of long lines and closing bracket

Linting warning for long line and not using best practice for visual indentation of closing bracket.
Who's a good boy..

* Whitespace on line was not cleaned.

* Removed spaces to clean up

* More.. whitespace. Sloppy.

* Constants from const, altered loops, added dictionary for sensor names.

* Fixed whitespace

* Inverted condition and created guard clause

* Changed condition from not ... in to not in.

* Fixed bad indentation on L91 and 92
2019-03-13 12:20:15 +01:00
Jeff Irion
007bf2bcb5 Rename 'firetv' to 'androidtv' and add Android TV functionality (#21944)
* Working on adding androidtv functionality to firetv component

* 'should_poll' must return True

* Change 'properties' to 'device_properties'

* Also mention 'Android TV' in services.yaml

* Use GitHub for 'androidtv' requirement

* Add 'androidtv==0.0.10' to requirements, remove 'firetv==1.0.9'

* Add 'GET_PROPERTIES' adb command option; use pypi for REQUIREMENTS

* Rename integration from 'firetv' to 'androidtv'

* Change default name to 'Android TV'

* Rename integration from 'firetv' to 'androidtv'

* Change firetv to androidtv in .coveragerc

* Change firetv to androidtv in requirements_all.txt

* Remove 'DEFAULT_APPS'
2019-03-13 11:18:59 +01:00
Jason Hu
e5da7a0014 Add breaking change section to PR template (#21994) 2019-03-13 10:54:30 +01:00
Anders Melchiorsen
c8692fe70c Use asyncio lock (#21985) 2019-03-13 10:17:09 +01:00
Daniel Perna
0162e2abe5 Update pyhomematic to 0.1.58 (#21989) 2019-03-13 08:56:59 +01:00
Paulus Schoutsen
c15f433c3e Add a service require_admin wrapper (#21953)
* Add a service require_admin wrapper

* Allow it to be used as a decorator

* Lint

* Add comment

* Add docstring

* Update syntax
2019-03-12 22:09:50 -07:00
Robbie Trencheny
bf839687ad Mobile App: Registration schema improvements (#21850)
* Update registration schema to add os_name (required) and make app_name required

* Ensure that a provided app_component is valid and available

* Ensure that component DEPENDENCIES declares mobile_app

* Update homeassistant/helpers/config_validation.py

* Standardize error responses

* Dont generalize REGISTER_BAD_COMPONENT

* Fix tests after merge
2019-03-12 22:04:27 -07:00
Diogo Gomes
a99d83390e Centrally define Energy Units (kWh and Wh) (#21719)
* centralize energy units kWh and Wh

* lint
2019-03-12 18:46:41 -07:00
Jc2k
c0b859d8da Set homekit controller entity as unavailable if new connections fail (#21901)
* Set entity as unavailable if new connections fail

* Fix docstring
2019-03-12 18:45:34 -07:00
Daniel Shokouhi
d66cc9befa Add stream source for amcrest component (#21983) 2019-03-12 21:40:24 -04:00
Jc2k
e618e2f348 Fix error introduced by #21933 (#21988) 2019-03-12 18:37:33 -07:00
Robbie Trencheny
9428ed7690 Use .get to ensure we dont get KeyError (#21993) 2019-03-12 18:00:18 -07:00
emontnemery
ce1fe06193 Write state directly in all MQTT platforms (#21971) 2019-03-12 14:46:48 -07:00
Paulus Schoutsen
f8921f84d7 skip flaky test (#21981) 2019-03-12 14:19:11 -07:00
Jc2k
2b1b47bfdd homekit_controller: Bump homekit to 0.13.0 (#21965)
* Bump homekit to 0.13.0

* Update gen_requirements_all.py

* Escape values used in TESTS_REQUIREMENTS
2019-03-12 21:54:08 +01:00
Paulus Schoutsen
97a87b2e4e Merge pull request #21982 from home-assistant/rc
0.89.2
2019-03-12 13:38:43 -07:00
Paulus Schoutsen
737c7e871d Bumped version to 0.89.2 2019-03-12 11:51:09 -07:00
Klaudiusz Staniek
1f3e4c5776 Fixes issues #21821 and #21819 (#21911)
* Fix #21821

* datetime fix

* local time to utc conversion fix

* Test cases update

* date import removed

* Update tod.py
2019-03-12 11:51:02 -07:00
Daniel Shokouhi
00d01865cf Fix botvac when no map exists (#21877) 2019-03-12 11:51:02 -07:00
Jason Hu
1b4905ae5a Override http.trusted_networks by auth_provider.trusted_networks (#21844) 2019-03-12 11:51:00 -07:00
Andrew Sayre
39749952ee Update dependencies to receive data on webhook callbacks (#21838) 2019-03-12 11:51:00 -07:00
Paulus Schoutsen
d3960bf745 Fix some cloud things (#21977) 2019-03-12 11:49:46 -07:00
Paulus Schoutsen
9416af5b56 Allow changing password without being admin (#21978) 2019-03-12 11:49:28 -07:00
Paulus Schoutsen
4a4bb43422 Stream: Only add base url when needed (#21979) 2019-03-12 11:46:20 -07:00
Paulus Schoutsen
d635111e4f Update translations 2019-03-12 11:31:17 -07:00
Paulus Schoutsen
9178ac17ad Updated frontend to 20190312.0 2019-03-12 11:30:50 -07:00
Sidney
1444a684e0 Fix MagicHome LEDs with flux_led component (#20733)
* bug fixing for MagicHome LEDs with flux_led component.

* corrections of the fixes for flux_led

* now asyncio sleep and turn on with brigthness possible

* indention fix with flux_led

* async now works

* houndci fixes

* little fixes for flux_led

* self._color fix for flux_led

* Add docstring
2019-03-12 16:51:51 +01:00
Paulus Schoutsen
d3bab30dbe Add cloud status (#21960)
* Add cloud status

* Expose certificate details

* store & reset last state

* Fix tests

* update tests

* update req

* fix lint
2019-03-12 15:54:04 +01:00
Markus Jankowski
ac97cebe11 Add Weather Sensors to Homematic IP (#21887)
* Add HmIP Weather Sensor Devices

* Fix test and icons

* fix test

* Fix comments
2019-03-12 14:52:13 +01:00
Thom Troy
cc34ee5559 fix ephember doing http call from property (#21855) 2019-03-12 14:49:36 +01:00
kbickar
62df6cbd09 Update to sense component to fully be async (#21698)
* Update to sense component to fully be async

* Shortened lines

* Whitespace
2019-03-12 14:44:53 +01:00
Anders Melchiorsen
dd11f8d3fe Avoid playing queue pollution when restoring Sonos snapshots (#21963)
Assume a snapshot state with three speakers in two groups, AB and C. They will
be playing the A and C queues, respectively. The B queue exists but is hidden
in this topology.

Unjoin B and form a new group BC, playing the B queue (now with the C queue
hidden).

To restore the snapshot we would join B back to A. The BC group would now only
contain the C speaker, still playing the B queue. The C queue has been lost :-(

The problem is that unjoining a coordinator will elect a new coordinator that
inherits the group queue and thus has its hidden queue overwritten.

This commit avoids the situation by having restore unjoin all slaves. Above, C
would be unjoined before joining B to A. This restores the C queue and since B
is then alone, it can be joined to A without having to transfer its playing
queue to remaining speakers.
2019-03-12 14:39:55 +01:00
Robbie Trencheny
2225425ed2 Update lametric icon to be HA logo (#21957) 2019-03-11 20:42:13 -07:00
Jason Hunter
7ccd0bba9a Live Streams Component (#21473)
* initial commit of streams

* refactor stream component

* refactor so stream formats are not considered a platform

* initial test and minor refactor

* fix linting

* update requirements

* need av in tests as well

* fix import in class def vs method

* fix travis and docker builds

* address code review comments

* fix logger, add stream start/stop logs, listen to HASS stop

* address additional code review comments

* beef up tests

* fix tests

* fix lint

* add stream_source to onvif camera

* address pr comments

* add keepalive to camera play_stream service

* remove keepalive and move import

* implement registry and have output provider remove itself from stream after idle, set libav log level to error
2019-03-11 19:57:10 -07:00
Klaudiusz Staniek
0a6ba14444 Fixes issues #21821 and #21819 (#21911)
* Fix #21821

* datetime fix

* local time to utc conversion fix

* Test cases update

* date import removed

* Update tod.py
2019-03-11 21:27:41 +01:00
Fabian Affolter
650658ea01 Upgrade schiene to 0.23 (#21940) 2019-03-11 21:25:29 +01:00
Pascal Vizeli
92ff49212b Offload Cloud component (#21937)
* Offload Cloud component & Remote support

* Make hound happy

* Address comments
2019-03-11 12:21:20 -07:00
Paulus Schoutsen
8bfbe3e085 Add update user command (#21922)
* Add update user command

* Add is_admin to current user
2019-03-11 12:08:02 -07:00
Jc2k
5e2302e469 Add an asyncio Lock around pairing, which cant be used concurrently (#21933) 2019-03-11 11:59:41 -07:00
Paulus Schoutsen
4f5446ff02 Add area permission check (#21835) 2019-03-11 11:02:37 -07:00
David McNett
4f49bdf262 Minor version bump for anthemav package (#21932)
Additional Python 3.7 fixes in the anthemav package.
See also: https://pypi.org/project/anthemav/
2019-03-11 20:47:57 +05:30
Marco Orovecchia
e7c85d350e Changed from nanoleaf_aurora to nanoleaf (#21913)
Nanoleaf component now supports both nanoleaf lights, Aurora and Canvas
Changed the dependency to pynanoleaf, nanoleaf does not seem to be
maintained anymore
2019-03-11 20:46:32 +05:30
Michaël Arnauts
bc76055c17 Allow inverting netdata sensor values (#21711)
* Allow inverting netdata sensor values

* Fix lint issue

* Use parentheses
2019-03-11 20:43:53 +05:30
Robbie Trencheny
785fd273e3 If registration supports encryption then return encrypted payloads (#21853) 2019-03-11 08:34:58 -04:00
Andrew Sayre
c401f35a43 Add cloudhook support to SmartThings component (#21905)
* Add support for Nabu Casa cloudhooks

* Added tests to cover cloudhook creation and removal

* Remove cloud dependency
2019-03-11 08:33:25 -04:00
gertdb
3fd6aa0ba9 Fixes Modbus service.yaml validity (#21923)
* Update __init__.py

* Update services.yaml

* Update services.yaml
2019-03-11 08:17:31 -04:00
Anders Melchiorsen
49014ac13f Remove confusing warning for TTS without entity_id (#21927) 2019-03-11 12:31:36 +01:00
Finbarr Brady
85dc5fe4d5 Update enigma2 based on review comments (#21890)
* Updates based on review comments

* bump netdisco and remove enigma2 init code

* revert netdisco bump
2019-03-11 11:42:56 +01:00
Jc2k
b0d55d1946 HomeKit controller config flow fixes (#21898)
* HomeKit controller config flow fixes

* This does work if you have latest vol-serialize
2019-03-11 10:07:12 +01:00
Brad Dixon
9ab543ab3d Add as_timestamp() to Jinja filters. (#21910)
Add as_timestamp() to Jinja filters
2019-03-11 13:21:22 +05:30
Colby Rome
29f01fb14e Add 'ssl' parameter for FiOS Quantum Gateway and upgrade Pypi (#21669)
* bump pypi version and take 'use_https' parameter

* changed to use CONF_SSL
2019-03-11 12:26:19 +08:00
Paulus Schoutsen
429bbc05dc Add WS subscription command for MQTT (#21696)
* Add WS subscription command for MQTT

* Add test

* Add check for connected

* Rename event_listeners to subscriptions
2019-03-10 20:07:09 -07:00
emontnemery
fc85b3fc5f Don't hang forever if manually added cast is down (#21565)
* Don't hang forever if manually added cast is down

* Adapt to pychromecast

* Do not set available until connected

* Update __init__.py

* Update requirements

* Lint, tests

* Fix tests
2019-03-10 19:57:30 -07:00
Jason Hu
fe1840f901 Deprecate http.api_password (#21884)
* Deprecated http.api_password

* Deprecated ApiConfig.api_password

GitHub Drafted PR would trigger CI after changed it to normal PR.
I have to commit a comment change to trigger it

* Trigger CI

* Adjust if- elif chain in auth middleware
2019-03-10 19:55:36 -07:00
Finbarr Brady
7ec7e51f70 bump netdisco to 2.4.0 (#21914) 2019-03-11 09:49:40 +08:00
Thiago Oliveira
77dc7595ee Allow emulated hue to set climate component temperature (#19034) 2019-03-11 00:04:21 +01:00
Niall Donegan
5debc8828a Return time based attributes as datetime in Unifi module (#21146)
* Return time based data as datetime in Unifi module

* Fix missing space and pylint complaints about import order.
2019-03-10 19:22:28 +01:00
Peter Epley
c888e65f11 Add custom holidays to workday sensor (#21718)
* Add custom holidays to workday sensor

* correcting copy/paste errors

* resolve block comment and add default

* resolve line too long

* fixed handling of no custom holidays

* hound fixes

* rerun Travis

* @fabaff requested changes

* spaces v tabs

* Fix validation
2019-03-10 22:44:45 +05:30
gertdb
bab53a1c94 Modbus write_register accept single value and array (#21621)
* Update __init__.py

* Update services.yaml
2019-03-10 20:38:29 +05:30
Thibault Maekelbergh
65ff8b727a Add myself to CODEOWNERS for NMBS code (#21892)
* Add myself to CODEOWNERS for NMBS code

* Fix
2019-03-10 20:17:17 +05:30
Thibault Maekelbergh
6456f71a46 Fix icon for sensor.discogs_random_record (#21891)
* Fix icon for sensor.discogs_random_record

* Add myself to CODEOWNERS for Discogs code
2019-03-10 19:19:31 +05:30
Marco M
05333f60d7 Fix missing code_required check in async_alarm_arm_night (#21858)
* Fix missing code_required check in async_alarm_arm_night

* Remove double code validation
Test added
2019-03-10 14:25:01 +01:00
Julius Mittenzwei
6f77d9bc34 Don't wait until final position of Velux cover is reached (#21558)
## Description:

* Bump version to latest version of pyvlx: 0.2.10. Library more failure tolerant, when detecting an unsupported device.
* When calling API (e.g. run scene, change position) don't wait until device has reached target position (This caused  HASS to be flaky while the device was moving)
* Support for vertical and horizontal awnings.
2019-03-10 03:47:22 -07:00
Joakim Sørensen
7102e82113 Change lib for whois sensor (#21878)
* Change lib for whois sensor

* Change requirements.txt
2019-03-10 14:38:13 +05:30
Paulus Schoutsen
ad73b6eee9 Updated frontend to 20190309.0 2019-03-09 21:26:35 -08:00
Paulus Schoutsen
5fbe2d5477 Update translations 2019-03-09 21:26:26 -08:00
David F. Mulcahey
5ffb471198 Update ZHA state handling (#21866)
* make device available if it was seen within 2 hours

* more state restore

* cleanup init

* clean up storage stuff

* fix tests

* update state handling
2019-03-09 20:09:09 -08:00
Paulus Schoutsen
5b2c6648fb Add user group (#21832)
* Add user group

* Rename system group to plural
2019-03-09 20:07:29 -08:00
Paulus Schoutsen
14b05b0a91 Fix incorrect 2nd param 2019-03-09 19:52:50 -08:00
Andrew Sayre
5ace55ea8d Add SmartThings sensor support for Three Axis (#21841)
* Add support for Three Axis to sensor platform

* Changes per review feedback.

* Remove unnecessary KeyError except

* Fix lint issue in line wrapping
2019-03-09 18:45:15 -06:00
Andrew Sayre
c927cd9c14 Add SmartThings climate support for Air Conditioners (#21840)
* Add support for Samsung Air Conditioners to Climate

* Changes per review feedback.

* Fix py3.5 compat list sorting in test
2019-03-09 18:43:16 -06:00
Daniel Shokouhi
2d2abc7831 Fix botvac when no map exists (#21877) 2019-03-09 23:06:35 +01:00
Zak
896075fa1c Add ClearPass Policy Manger device tracker (#21673)
* Adding ClearPass Policy Manger device tracker. Amending author

* Cleaned redundant code

* Updated .coveragerc

* Updated requirements_all.txt

* Implemented suggested changes partially.

* Implemented more suggested changes.

* Hound was unhappy

* Implement further suggested changes.

* Make Hound happy.

* Satisfy Travic CI

* Satisfy Travis CI #2

* Hound barking

* pylint else: return

* Implemented suggested changes minus AccessToken

* Removed access token logging

* Removed throttle import

* Removed period from debug string

* Make travis happy :(

* Moved source to new component structure.

* Forgot to rename source.
2019-03-09 22:12:29 +01:00
Paulus Schoutsen
f4f0d363ca Better cloud check (#21875) 2019-03-09 12:15:16 -08:00
David F. Mulcahey
ac5ccd651c Bump quirks for ZHA and handle resulting battery % change (#21869)
* bump quirks and handle battery change

* move inside guard

* round battery
2019-03-09 12:14:58 -08:00
Jason Hu
226be65910 Only commit if need. (#21848) 2019-03-09 12:04:13 -08:00
Paul Bottein
4d9cf15c45 Fix authorization header in cors (#21662)
* Fix authorization headers in cors

* Use aiohttp authorization header instead of custom const
2019-03-09 10:00:10 -08:00
emontnemery
fc81826763 Introduce Entity.async_write_ha_state() to not miss state transition (#21590)
* Copy state in schedule_update_ha_state

* Lint

* Fix broken test

* Review comment, improve docstring

* Preserve order of state updates

* Rewrite

* Break up async_update_ha_state

* Update binary_sensor.py

* Review comments

* Update docstring

* hass -> ha

* Update entity.py

* Update entity.py
2019-03-09 09:52:22 -08:00
Willem Burgers
458548daec Fix TypeError (#21734)
* timediff is of type timedelta. Divide by timedelta does not work.

- convert a timedelta to int
- make sure the test inputs real timestamps

* Convert the total_seconds to decimal and round the result

readings are of type Decimal, so fix test to reflect that

* split line into multiple statements

Line too long

* use total_seconds instead of timediff

* Make both values float instead of Decimal
2019-03-09 17:51:15 +01:00
Hackashaq666
be989ebb7e Update honeywell.py to read current humidity for US Thermostats (#21728)
* Update honeywell.py

Add thermostat humidity reading available in somecomfort for US thermostats.

* Update honeywell.py

* Update honeywell.py
2019-03-09 21:47:28 +05:30
Jason Hu
bbd01968ba Override http.trusted_networks by auth_provider.trusted_networks (#21844) 2019-03-08 23:56:37 -08:00
Robbie Trencheny
9ab0753cf7 mobile_app improvements (#21607)
* First webhook commands for getting and deleting single registrations

* Keep a list of deleted webhook IDs so we can 410 if the webhook receives traffic in the future

* Return a empty JSON object instead of None

* Split up mobile_app bits into individual files

* Add typing

* Sort keys

* Remove unused async_setup_entry

* New decorator method of registering webhooks

* Add tests for cloud hook forwarding and improve error handling for cloud hooks

* Initial implementation of platform specific logic

* Add get registrations by user ID websocket call, minor style fixes

* Stop using resp dictionary during registration

* Move mobile_app/ios.py to ios/mobile_app.py

* Log any errors encountered during webhook

* Improve update registration call

* Split up mobile_app tests to match split up component

* Fix tests

* Remove integration_map in favor of component name in registration

* Add a few helper functions for custom logic components to use

* Load the app_component platform at device registration or component setup time

* Remove extraneous function

* Use guard function for checking if component is in device

* Inline websocket schemas

* Rename ATTR_s used in storage to DATA_ prefix

* squash flake8 and pylint issues

* Remove ios.mobile_app platform

* Dont mark websocket_api as a dependency

* Return standard empty_okay_response with 400 if no JSON sent

* Ensure deleted webhook IDs are registered at launch

* Remove the creation of cloudhooks during handle_webhook

* Rename device to registration everywhere applicable

* Dont check if cloud is logged in, just check if cloud is in components

* Dont ever use cloudhook_id

* Remove component loading logic for a later PR

* Cast exception to string

* Remove unused functions
2019-03-08 23:44:56 -08:00
Aaron Bach
49eaa34e03 Fixed a misspelling in a docstring (#21846) 2019-03-08 22:36:41 -07:00
Andrew Sayre
c5734eecc7 Update dependencies to receive data on webhook callbacks (#21838) 2019-03-08 21:20:07 -08:00
Aaron Bach
113db9afd4 Fix config entry exception in Ambient PWS (#21836) 2019-03-08 21:25:35 -06:00
William Scanlon
012c657a9c Updated to pyeconet 0.0.10 (#21837) 2019-03-08 21:24:17 -06:00
engrbm87
76d11e4b74 fix empty TOPIC_BASE issue (#21740)
* fix empty TOPIC_BASE issue

if the value of the TOPIC_BASE is empty then we need to remove "~" from the topic value if it exists. 
by doing `if base:` on line 239 the condition will be false if the value is empty so the '~' will not be stripped from the topic value.
I simply removed the `if base:` line and added `if TOPIC_BASE in payload:`

* Update homeassistant/components/mqtt/discovery.py

Co-Authored-By: engrbm87 <engrbm87@gmail.com>
2019-03-08 16:48:54 -08:00
Mike Megally
d8ac761bb6 Synology sensor quick return if attr is null (#21709)
* Quick return if attr is null

There are some case where attr is null. Returning null doesn't change anything (in my case this is mapped to a volume that doesn't exist, not sure what others are seeing). 

If you have confirmed you hass instance for C instead of F you do not see this error.

* update == to is

* whitespace
2019-03-08 16:35:38 -08:00
Finbarr Brady
0f189809a9 Add support for Cisco Mobility Express (#21531)
* Move cisco me to new layout

* Add docstring

* Move items out of init method and pass the controller instance to the scanner in get_scanner

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

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

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

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

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

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

* Update homeassistant/components/cisco_mobility_express/device_tracker.py

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

* Fix build error

* Cleanup based on comments.
2019-03-09 00:47:06 +01:00
Robbie Trencheny
31a4187cc0 Log if aiohttp hits error during IndieAuth (#21780)
* Log if aiohttp hits error during IndieAuth

* Add content of redirect_url into error log

Co-Authored-By: awarecan <awarecan@users.noreply.github.com>
2019-03-08 14:51:13 -08:00
Jason Hu
3d8673dbf8 Resolve auth_store loading race condition (#21794)
* Add lock in auth_store._async_load()

* Python 3.5 does not like assert_called_once()
2019-03-08 14:50:24 -08:00
Jason Hu
3ff2d99cd6 Load logger and system_log components as soon as possible (#21799) 2019-03-08 14:47:10 -08:00
Paulus Schoutsen
22ab5a498f Change how we import config modules (#21824) 2019-03-08 14:09:18 -08:00
uchagani
ed6082eb2b change paths to be relative (#21827) 2019-03-08 14:08:19 -08:00
Paulus Schoutsen
4c9e5eef9c Remove stub from config component (#21822) 2019-03-08 14:07:49 -08:00
Paulus Schoutsen
3da0ed9cc7 Onboarding to generate auth code (#21777) 2019-03-08 13:51:42 -08:00
Toon Willems
a0e8543aed remove occupancy, as it is not available at this level in the iRail api (#21810) 2019-03-09 02:49:48 +05:30
Greg Dowling
7226e917ed Bump loopenergy to 0.1.0. Loop updated their socket.io server from 0.9 to 2.0 - which required a library update. (#21809) 2019-03-09 02:13:59 +05:30
Finbarr Brady
4571f1bf0d Adding enigma2 media player (#21271)
* Updated based on review comments

* fix hound

* Update homeassistant/components/media_player/enigma2.py

* Update homeassistant/components/media_player/enigma2.py

* Update homeassistant/components/media_player/enigma2.py

* Update enigma2.py

* Update enigma2.py

* Move file and update docsstring

* Fix path in coverage rc file

* requirements

* Update media_player.py

* Setup discovery for e2

* Handle discovered devices

* Add reqs

* Update for auth for openwebif

* Forget to set DEFAULT_PASSWORD

* Add source selection

* Fix get current source name

* Update pip version

* - adding some extra attributes
- support better recording playback integration

* bump pip version

* Bump pip

* Adding prefer_picon config option

* Updates to move logic into pypi module

* bump pip

* bump pip

* - remove http dependancy.

- rename prefer_picon to use_channel_icon

* Bump pypi to fix toggle bug.

also fix travis

also move setup out of init
2019-03-08 14:56:10 +01:00
Ville Skyttä
dfd9f7ccf3 Upgrade huawei-lte-api to 1.1.5 (#21791) 2019-03-08 09:28:53 +01:00
Jose Motta Lopes
f705ac6b43 Add Time of Flight Sensor using VL53L1X (#21230)
* Add Time of Flight Sensor using VL53L1X

* Fix issues found by bot

* Fix issues from bot

* Remove extra logs

* Keep removing logs dependencies not used

* Remove log from update

* Add logger info to async_update

* Fix over-indented line

* Fix pylint error

* Remove logger reporting successful operation

* Update requirements

* Update requirements_all.txt

* Update requirements_test_all.txt

* Used isort to keep imports and added STMicroelectronics to docstring

* Replace time.sleep by asyncio.sleep

* Add requirements to COMMENT_REQUIREMENTS and fix typo

* Using async_add_executor_job to schedule the call in the pool

* Fix typo

* Optimize async_update

* Updated requirements files

* Group and schedule calls that should be run sequentially

* Fix lint errors

* Revision showing development history

* Cleaning and typos

* Cleaning and typos

* Fix wrong-import-order

* Fix gen_requirements_all

* Schedule rpi_gpio I/O on the executor thread pool

* Fix partial parameters

* Fix bot error - add blank line

* Fix lint error

* Remove dependencies from requirements

* Review initial commits

* Move all device I/O to async_update

* Update requirements_all.txt

* Revised header with no url to the docs

* Use async_added_to_hass to add and initialize the sensor

* Add docstring to init()

* Move sensor.open() to async_setup_platform

* Remove logging and async

* Fix typo

* Move sensor.open to safe initialization

* Fix typo

* Fix typo

* Add the new tof module to .coveragerc

* Move the sensor platform under a tof package

* Update .coveragerc and requirements_all for tof package
2019-03-08 08:21:22 +01:00
Paulus Schoutsen
ac4d5d7c30 Merge pull request #21778 from home-assistant/rc
0.89.1
2019-03-07 23:16:17 -08:00
Ville Skyttä
2812483193 Upgrade pylint to 2.3.1 (#21789) 2019-03-08 09:13:35 +02:00
Paulus Schoutsen
f3e8e34089 Add workflow for tests 2019-03-07 17:03:23 -08:00
Paulus Schoutsen
eae6d1c7a6 Bumped version to 0.89.1 2019-03-07 16:48:53 -08:00
William Scanlon
a121c92f52 Updated to newest pyeconet (#21772) 2019-03-07 16:48:47 -08:00
David Thulke
4d6f21ecb2 adds missing SUPPORT_VOLUME_SET flag to webos media_player (#21766) 2019-03-07 16:48:46 -08:00
Sebastian Muszynski
1638d0a92f Bump PyXiaomiGateway version to 0.12.2 (Closes: #21731) (#21764) 2019-03-07 16:48:46 -08:00
Jason Hu
c031fd4164 Fix script load module issue (#21763)
* Fix script load depedency

* Revert #21754
2019-03-07 16:48:45 -08:00
Jason Hu
78a806bc5c Fix script load module issue (#21763)
* Fix script load depedency

* Revert #21754
2019-03-07 16:48:14 -08:00
David Thulke
2fb978393b adds missing SUPPORT_VOLUME_SET flag to webos media_player (#21766) 2019-03-07 16:46:50 -08:00
William Scanlon
a843da1bfc Updated to newest pyeconet (#21772) 2019-03-07 16:46:01 -08:00
Sebastian Muszynski
cfd94ecbbc Bump PyXiaomiGateway version to 0.12.2 (Closes: #21731) (#21764) 2019-03-07 22:55:11 +01:00
Marvin Wichmann
5112f8f6b5 Introduce target_temperature_state_address for climate device (#21541) 2019-03-07 21:53:42 +00:00
Jason Hu
5f0c37ccfc Fix colorlog import error (#21754)
* Fix colorlog import error

* Lint
2019-03-07 11:07:24 -08:00
Jason Hu
c91fb82807 Fix colorlog import error (#21754)
* Fix colorlog import error

* Lint
2019-03-07 11:07:07 -08:00
Daniel Shokouhi
e412317194 Fix botvac connected maps call as it is not a supported model (#21752) 2019-03-07 11:06:42 -08:00
Leonardo Merza
44341a958a automated commit 07/03/2019 10:47:38 (#21749) 2019-03-07 11:06:41 -08:00
Markus Jankowski
5a555102b9 Fix group-switch availability for Homematic IP (#21640)
* Add available=True to groups

* Added unreach to stateattributes

* Fixed comments

* added missing sabotage check

* added missing lowBat check

* fix typo

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* applied suggiestions

* readded lost str()

* fix comment
2019-03-07 11:06:40 -08:00
Markus Jankowski
aebe6ab70c Fix Name of Homematic IP accesspoint in devices, if name is configured (#21617)
* Fix Name of Accesspoint if name is configured

* fix lint

* Simplyfied naming

* applied suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* update comment
2019-03-07 11:06:39 -08:00
Kevin Fronczak
48c9758cf5 Upgrade blinkpy==0.13.1 (Fixes #21559) (#21578)
* Upgrade blinkpy with new api endpoint

* Change wifi units to dBm
2019-03-07 11:06:39 -08:00
Leonardo Merza
e356b48fca automated commit 07/03/2019 10:47:38 (#21749) 2019-03-07 11:03:32 -08:00
Daniel Shokouhi
fc943dc4b6 Fix botvac connected maps call as it is not a supported model (#21752) 2019-03-07 11:03:02 -08:00
Paulus Schoutsen
279470613c Updated frontend to 20190305.1 2019-03-07 10:54:56 -08:00
zewelor
f2abc91c1e Allow light toggle service to accept all turn on params (#20912) 2019-03-07 22:33:30 +05:30
Pascal Vizeli
61786b79f7 Revert pull request to push 2019-03-07 15:33:13 +01:00
Pascal Vizeli
720b0c5334 Revert Travis until github actions work better for PR (#21746) 2019-03-07 15:30:48 +01:00
Pascal Vizeli
5c2d174d5f Change github trigger type 2019-03-07 15:25:27 +01:00
Pascal Vizeli
02bcf46053 Update .travis.yml (#21736)
* Update .travis.yml

* Update tox.ini

* Update main.workflow

* Update tox.ini
2019-03-07 14:40:18 +01:00
Jason Hu
ba70459e1e Remove pytest warning message (#21713) 2019-03-07 16:59:15 +05:30
Markus Jankowski
1891d5bf22 Fix group-switch availability for Homematic IP (#21640)
* Add available=True to groups

* Added unreach to stateattributes

* Fixed comments

* added missing sabotage check

* added missing lowBat check

* fix typo

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* apply suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* applied suggiestions

* readded lost str()

* fix comment
2019-03-07 11:12:03 +01:00
Markus Jankowski
a46458d04f Fix Name of Homematic IP accesspoint in devices, if name is configured (#21617)
* Fix Name of Accesspoint if name is configured

* fix lint

* Simplyfied naming

* applied suggestion

Co-Authored-By: SukramJ <markus@mm-jankowski.de>

* update comment
2019-03-07 11:07:32 +01:00
Leonardo Merza
9c70b00403 tplink - catch SmartDeviceException on is_dimmable call (#21726)
* automated commit 06/03/2019 20:49:50

* automated commit 06/03/2019 20:53:13

* automated commit 06/03/2019 20:53:48
2019-03-07 10:54:09 +01:00
Jason Hu
38a93afa66 Make pytest in tox quite (#21727) 2019-03-06 22:27:46 -08:00
Jason Hu
a85119ac09 Fix pylint warning on python 3.7 (#21714) 2019-03-07 06:47:56 +01:00
c-soft
f4a9ad0b2e Fix initialization and add "pending" status of Satel integra (#21194)
* Added updating alarm state after start of the HA. Still rough and dirty.

* Fixed initialization of the panel and binary sensor.  Before cleanup.

* Added alarm clearing, linting fixes.

* Removed dead code, added style changes.

* Updated requirements

* Fixed linting errors.

* Fixed linting errors

* Fixed linter errors.

* Fixed hopefully last linter errors.

* Fixes after code review, imports sorted.

* Removed init debugging
2019-03-06 19:47:47 -08:00
Sergio Oller
9f06be750f Support multiple keys in ifttt triggers (#21454)
* Support multiple keys in ifttt triggers

* Rename `to` to `target` in ifttt.

Follow PR code review suggestions
2019-03-06 19:47:13 -08:00
Jc2k
dbf129dfdd Start preparing for homekit_controller config entries (#21564)
* Start preparing for homekit_controller config entries

* Review feedback

* Review feedback

* Only use the vol.strip validator for pairing_code

* CV not required now

* Changes from review

* Changes after review
2019-03-06 19:44:52 -08:00
Phil Bruckner
5616505032 Change amcrest camera_image to async (#21720)
Change AmcrestCam method camera_image to async so asyncio lock can be used instead of a threading lock. Bump amcrest package to 1.2.5.
2019-03-06 19:42:59 -08:00
Paulus Schoutsen
88bc3033d3 Merge pull request #21712 from home-assistant/rc
0.89.0
2019-03-06 15:15:37 -08:00
Paulus Schoutsen
21de636e5b Bumped version to 0.89.0 2019-03-06 10:07:31 -08:00
Franck Nijhof
87b5faa244 Upgrade toonapilib to 3.2.1 (#21706) 2019-03-06 10:05:32 -08:00
Fredrik Erlandsson
c2f4293c6a resync hass that changes have occured (#21705) 2019-03-06 10:05:31 -08:00
Franck Nijhof
0e36b26770 Upgrade toonapilib to 3.2.1 (#21706) 2019-03-06 07:40:29 -08:00
Diogo Gomes
8e9a496002 Utility Meter offset defined by a time_period (#20926)
* change offset from int to Time period dictionary

* track according to offset

* left overs... tks @fabaff

* typo
2019-03-06 07:55:24 -05:00
Fredrik Erlandsson
54895fcb1e resync hass that changes have occured (#21705) 2019-03-06 07:52:25 -05:00
Alan Tse
b7b034c532 Update to teslajsonpy v0.0.25 (#21702) 2019-03-05 21:44:37 -08:00
Penny Wood
d1038ea79f Google Assistant: Create and pass context to service calls (#21551)
* Google Assistant: Create and pass context to service calls

* Refactor request data into separate object and pass to execute.
2019-03-05 20:00:53 -08:00
Paulus Schoutsen
fc1ee9be43 Use new style for built-in ws commmands (#21694)
* Use new style for built-in ws commmands

* Lint
2019-03-05 19:31:26 -08:00
Paulus Schoutsen
c9b173405b Fix Z-Wave relative imports (#21693) 2019-03-05 17:17:58 -08:00
Paulus Schoutsen
4c72f3c48b Bumped version to 0.89.0b3 2019-03-05 11:46:30 -08:00
carstenschroeder
cb613984df Fix ADS race condition (#21677) 2019-03-05 11:46:19 -08:00
Diogo Gomes
4978a1681e check we have a tb (#21670) 2019-03-05 11:46:18 -08:00
Paulus Schoutsen
2303e1684e Updated frontend to 20190305.0 2019-03-05 11:45:46 -08:00
Paulus Schoutsen
467d8d616e Updated frontend to 20190305.0 2019-03-05 11:45:31 -08:00
Alan Tse
dbb92048aa Bump teslajsonpy to 0.0.24 (#21675)
* Bump teslajsonpy to 0.0.24

* Update requirements_all.txt
2019-03-05 09:23:00 -08:00
Jonathan McDowell
401720085d Allow 202 status code as a successful REST notify response (#21678)
The REST notification component only allows 200 + 201 as a successful
response code to the submission. notify.me returns a 202 (Accepted)
response, which works fine but gets logged as a warning in the log.
Update the allowed statuses to treat the 202 as ok.
2019-03-05 09:22:21 -08:00
Nick Whyte
7d9c14541b Bump nessclient version to 0.9.14 (#21679) 2019-03-05 09:21:13 -08:00
Phil Bruckner
16d79b52c3 Serialize amcrest snapshot commands and bump PyPI package to 1.2.4 (#21664)
* Serialize snapshot commands and bump amcrest package to 1.2.4

Attempting to send a snapshot command when a previous one hasn't finished will result in warnings and/or errors. This can happen when the camera picture is clicked on in the frontend, resulting in the thread that updates the thumbnail in the background every 10 seconds to sometimes collide with the thread that updates the large picture in the foreground quickly. An automation that calls the camera.snapshot service in yet another thread can make the situation worse. Fix by adding a thread lock to serialize snapshot commands. Also bump the amcrest package to 1.2.4 which fixes error handling in the command method and improves performance by reusing requests sessions.

* Update amcrest package to 1.2.4
2019-03-05 17:03:19 +01:00
Steven Looman
3ffff887d8 Adds option in UPnP component to override callback url (#21583)
* Add option to override callback url

* Upgrade to async_upnp_client==0.14.5

* Fix requirements_all.txt
2019-03-05 15:48:44 +00:00
carstenschroeder
17c3c14833 Fix ADS race condition (#21677) 2019-03-05 11:07:40 +01:00
Colby Rome
0e78054195 Xfinity Gateway device_tracker platform (#21026)
* initial commit

* updated .coveragerc, CODEOWNERS, generated requirements_all.txt

* fixed lines exceeding 79 characters

* pylint fixes

* shorten docstring and simplify get_scanner

* extract initialization into get_scanner

* bump pypi version

* name change
2019-03-04 22:57:45 -08:00
Diogo Gomes
efe4ce9a05 check we have a tb (#21670) 2019-03-05 06:18:25 +01:00
ktnrg45
efa5d5dfe3 Add support for multiple devices for PS4 component (#21302)
* Support multiple devices.

* Revert "Support multiple devices."

This reverts commit 3f5d4462a98da13ebb1ab1c07d341dbd7020e6cc.

* Support multiple devices

* Bump to 0.3.3

* bump 0.3.4

* Add tests for multiple devices.

* Update Requirements

* Update config_flow.py

* Update config_flow.py

* fixed typo

* Reordered functions

* Added multiple flow implementation test.

* fix

* typo

* fix tests

* bump 0.4.0

* Bump 0.4.0

* 0.4.0

* bump version

* bump version

* bump version

* Add keep alive feature with multiple devices

* bump version

* bump version

* bump version

* bump 0.4.7

* bump 0.4.7

* bump 0.4.7

* Edited tests.

* bump/pylint

* pylint

* bump/pylint

* bump/pylint

* Change to add additional entry

* Changed to multiple entries

* pylint

* Corrections to manage multiple devices.

* lint

* comments

* Removed redundant for loop

* Shorthand correction

* Remove reference to private object

* Test fix

* Revert changes. Test failure.

* Test fix

* test fix

* unindent assertions

* pylint
2019-03-05 01:48:25 +01:00
Paulus Schoutsen
3135257c0d Bumped version to 0.89.0b2 2019-03-04 16:02:05 -08:00
Paulus Schoutsen
b20b811cb9 Avoid recorder thread crashing (#21668) 2019-03-04 16:01:59 -08:00
Paulus Schoutsen
df25128923 Avoid recorder thread crashing (#21668) 2019-03-04 16:01:31 -08:00
Franck Nijhof
a778cd117f Upgrade toonapilib to 3.1.0 (#21661) 2019-03-04 16:01:15 -08:00
Franck Nijhof
31b88197eb 🚑 Fixes Toon doing I/O in coroutines (#21657) 2019-03-04 16:01:14 -08:00
Paulus Schoutsen
81c252f917 Rename Google Assistant evenets (#21655) 2019-03-04 16:01:13 -08:00
Franck Nijhof
f5a0b5ab98 👕 Corrects unit of measurement symbol for Watt (#21654) 2019-03-04 16:01:12 -08:00
Gijs Reichert
a382ba731d Cast displaytime to int for JSON RPC (#21649) 2019-03-04 15:59:19 -08:00
Paulus Schoutsen
cca8d4c951 Fix calc next (#21630) 2019-03-04 15:59:18 -08:00
Anders Melchiorsen
932080656d Upgrade pysonos to 0.0.8 (#21624) 2019-03-04 15:59:18 -08:00
Jason Hu
d5bdfdb0b3 Resolve race condition when HA auth provider is loading (#21619)
* Resolve race condition when HA auth provider is loading

* Fix

* Add more tests

* Lint
2019-03-04 15:59:17 -08:00
Andrew Sayre
d9806f759b Handle when installed app has already been removed (#21595) 2019-03-04 15:59:16 -08:00
Anders Melchiorsen
e6debe09e8 Word the tplink deprecation warning more strongly (#21586) 2019-03-04 15:59:16 -08:00
Jason Hu
c5dad82211 Log exception occurred in WS service call command (#21584) 2019-03-04 15:59:15 -08:00
Daniel Høyer Iversen
ec9ccf6402 Upgrade PyXiaomiGateway library (#21582) 2019-03-04 15:59:15 -08:00
Jason Hu
a268aab2ec Re-thrown exception occurred in the blocking service call (#21573)
* Rethrown exception occurred in the actual service call

* Fix lint and test
2019-03-04 15:59:14 -08:00
damarco
996e0a6389 Bump zigpy-deconz (#21566) 2019-03-04 15:59:14 -08:00
emontnemery
e877983533 Make time trigger data trigger.now local (#21544)
* Make time trigger data trigger.now local

* Make time pattern trigger data trigger.now local

* Lint

* Rework according to review comment

* Lint
2019-03-04 15:59:13 -08:00
Robbie Trencheny
73675d5a48 mobile_app component (#21475)
* Initial pass of a mobile_app component

* Fully support encryption, validation for the webhook payloads, and other general improvements

* Return same format as original API calls

* Minor encryption fixes, logging improvements

* Migrate Owntracks to use the superior PyNaCl instead of libnacl, mark it as a requirement in mobile_app

* Add mobile_app to .coveragerc

* Dont manually b64decode on OT

* Initial requested changes

* Round two of fixes

* Initial mobile_app tests

* Dont allow making registration requests for same/existing device

* Test formatting fixes

* Add mobile_app to default_config

* Add some more keys allowed in registration payloads

* Add support for getting a single device, updating a device, getting all devices. Also change from /api/mobile_app/register to /api/mobile_app/devices

* Change device_id to fingerprint

* Next round of changes

* Add keyword args and pass context on all relevant calls

* Remove SingleDeviceView in favor of webhook type to update registration

* Only allow some properties to be updated on registrations, rename integration_data to app_data

* Add call service test, ensure events actually fire, only run the encryption tests if sodium is installed

* pylint

* Fix OwnTracks test

* Fix iteration of devices and remove device_for_webhook_id
2019-03-04 15:59:12 -08:00
roblandry
e10e27d809 Add SmartThingsAccelCluster to ZHA binary_sensor (#21609)
* Add SmartThingsAccelCluster to binary_sensor

* Make corrections per discussion with @dmulcahey

* Add missing const to gateway.py

* Remove Acceleration from no sensor
2019-03-04 15:56:05 -08:00
Jason Hu
4a3b4cf346 Resolve race condition when HA auth provider is loading (#21619)
* Resolve race condition when HA auth provider is loading

* Fix

* Add more tests

* Lint
2019-03-04 15:55:26 -08:00
Daniel Høyer Iversen
7a7080055e Netatmo, handle missing thermostat devices (#21651) 2019-03-04 15:54:21 -08:00
Franck Nijhof
955b71c44b 👕 Corrects unit of measurement symbol for Watt (#21654) 2019-03-04 15:53:16 -08:00
Franck Nijhof
73b100d3af 🚑 Fixes Toon doing I/O in coroutines (#21657) 2019-03-04 15:52:00 -08:00
Franck Nijhof
641138a986 Upgrade toonapilib to 3.1.0 (#21661) 2019-03-04 15:51:15 -08:00
Paulus Schoutsen
27e8a6ee80 Rename Google Assistant evenets (#21655) 2019-03-04 13:18:16 -08:00
Alok Saboo
5375510535 Add camera name to logs (#21653) 2019-03-04 12:06:28 -08:00
Paulus Schoutsen
8213016eaf Allow targeting areas in service calls (#21472)
* Allow targeting areas in service calls

* Lint + Type

* Address comments
2019-03-04 09:51:12 -08:00
Nate Clark
f62eb22ef8 Add support for DHT and DS18B20 sensors via Konnected firmware (#21189)
* mvp basic temperature sensor support

* support for DHT temperature & humidity

* add support for ds18b20 sensors

* improve resolution of device settings

* update requirements_all.txt

* re-organize new file

* don't use filter(lambda: syntax

* set unique_id on entities to allow renaming in the UI

* leverage base Entity module to do C to F conversion

* add option for setting poll_interval

* use handler pattern to handle updates from Konnected device

* cleanups from code review
2019-03-04 16:56:41 +01:00
Gijs Reichert
158e25562b Cast displaytime to int for JSON RPC (#21649) 2019-03-04 15:25:28 +01:00
Pascal Vizeli
72b6e80d02 Better output of workflow 2019-03-04 14:06:05 +01:00
Fabian Affolter
eb1d7be67c Upgrade youtube_dl to 2019.03.01 (#21647) 2019-03-04 14:00:10 +01:00
Pascal Vizeli
c60627c699 GitHub Workflow (#21643)
* Fix tox.ini

* Update main.workflow

* Update tox.ini

* Update main.workflow

* Update main.workflow

* Update tox.ini

* Try only with one

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow

* Update main.workflow
2019-03-04 12:36:50 +01:00
Pascal Vizeli
5c9f266672 Fix actions with tox (#21642)
* Fix actions with tox

* Update main.workflow
2019-03-04 10:23:19 +01:00
Pascal Vizeli
5efcbc5043 Replace travis (#21641) 2019-03-04 09:59:35 +01:00
Nick Whyte
10e334cbf0 Allow configuration of update interval for ness_alarm (#21415)
* ness_alarm: Allow configuration of update_interval

* requirements

* update_interval -> scan_interval

* Consistent config validation

* requirements

* don't touch dependency version
2019-03-04 00:05:44 -08:00
Paulus Schoutsen
43f85f7053 Updated frontend to 20190303.0 2019-03-03 22:41:38 -08:00
Paulus Schoutsen
c03116291e Updated frontend to 20190303.0 2019-03-03 21:55:51 -08:00
Paulus Schoutsen
de9e6e8d1a Update translations 2019-03-03 21:53:45 -08:00
David F. Mulcahey
fc07d3a159 Add storage helper to ZHA and use it for the device node descriptor (#21500)
* node descriptor implementation

add info to device info

disable pylint rule

check for success

* review comments

* send manufacturer code for get attr value for mfg clusters

* ST report configs

* do zdo task first

* add guard

* use faster reporting config

* disable false positive pylint
2019-03-03 21:22:42 -08:00
Jason Hu
ee6f09dd29 Log exception occurred in WS service call command (#21584) 2019-03-03 21:22:22 -08:00
Paulus Schoutsen
48a2e50f84 Fix calc next (#21630) 2019-03-03 21:36:13 -07:00
Paulus Schoutsen
f5ed6432eb Expose create/delete cloudhook (#21606)
* Expose create/delete cloudhook

* Make sure we dont publish cloudhooks when not connected
2019-03-03 19:03:49 -08:00
shanbs
c25cbccca9 Return Netatmo climate operation_mode instead of boiler status (#21633)
* Merge the devices into one list and add into entries at once; Return operation_mode instead of boiler status.

* Removing property operation_mode
2019-03-04 02:42:29 +01:00
Aaron Bach
31bcf6c35f Bump pyflunearyou to 1.0.3 (#21634) 2019-03-03 18:39:13 -07:00
Willem Burgers
2017e45d78 fix derived rate, fixes #20097 (#21620)
* fix derived rate, fixes #20097

* fix derived rate, fixes #20097

* Fix typo

thnx @amelchio

* Make the test more realistic

Took values from my own smart meter for the test

* Update test to ignore rounding issues
2019-03-03 23:42:52 +01:00
srirams
818776d2b4 Add optional sender name for SendGrid (#21610)
* Set "Home Assistant" as email sender name for SendGrid

* make sender name configurable

* sendgrid tweaks

* fix config
2019-03-03 13:44:40 -08:00
Jeff Irion
fa938f5628 Add 'app_name' property and 'apps' config entry to Fire TV (#21601)
* Add 'app_name' property and 'apps' config entry to Fire TV

* Define 'CONF_APPS', don't import it

* Address reviewer comments
2019-03-03 12:39:39 -08:00
Markus Jankowski
3032283b99 Add device HMIP-eTRV-C to HomematicIP (#21612)
* Update dependencies

* Add additional device HMIP-eTRV-C

add valveActualTemperature to HeatingThermostats (HMIP-eTRV-C, HMIP-eTRV, HMIP-eTRV-2)

* Removed HomematicipThermostatTemperatureSensor

already in climate
2019-03-03 12:33:48 -08:00
kennedyshead
1308ead8d6 Bumping aioasuswrt (#21627) 2019-03-03 12:31:09 -08:00
Andrew Sayre
3e0459cef9 SmartThings remove SmartApp/Automation on integration removal (#21594)
* Add clean-up logic upon entry removal

* Removed unecessary app removal from migration

* Change log level and clarified code
2019-03-03 13:47:25 -06:00
Anders Melchiorsen
0f6e0aa355 Upgrade pysonos to 0.0.8 (#21624) 2019-03-03 18:49:29 +01:00
Maikel Punie
b985223603 Add the velbus sync clock service (#21308)
* Add the velbus sync clock service

* Fixed houndci-bot commants

* Fix lint and pylint

* fixed all comments

* Hound bot comments

* Fix for flake8
2019-03-03 06:37:36 -06:00
Andrew Sayre
1e60993aa7 Handle when installed app has already been removed (#21595) 2019-03-02 21:57:57 -06:00
shanbs
18372ad81b Added support for multiple Netatmo thermostats/valves (#19407)
* climate/netatmo: Added support for muletiple thermostats/valves

* Adjusted the update interval throttle to 10 seconds

* Avoid returning 'homes' without 'therm_schedules'

* Requires home to have 'modules' as well as 'therm_schedules'; Using pyatmo 1.7

* Support multiple homes

* Fix nest level too deep issue

* Fix crashing bug when discovery is true

* Fix crashing bug when discovery is true

* Modifications according to review comments

* Resolve format issue

* Fix mode name issue

* Revisions according to review's suggestions

* Revisions according to review's comments

* Revisions according to review's comments
2019-03-02 19:51:42 -08:00
Matt White
18491c515f Further Yale ZWave lock device mapping cleanup (#21128)
* Update device mapping for workarounds from zwave device db

* Update comment on old Yale vendor ID
2019-03-02 20:29:16 -06:00
Rohan Kapoor
9af8c95e83 Upgrade motorparts to 1.1.0 (#21602) 2019-03-02 20:23:17 -06:00
ehendrix23
833f17de04 Add parameter hold_secs for Harmony remote send command (#19650)
* Update requirements

Updated requirements

* Small bump for aioharmony

Small version bump increase for aioharmony

* Add attributes

Add firmware and config version attributes

* Add hold for button press on send_command

* Fix requirements file

For some reason aioharmony ended up in there as a duplicate. Fixed it.

* Revert rebase changes

Revert some changes that should have been reverted back as part of rebase.

* Updated based on review

Removed HOLD_SECS from platform schema (configuration)
Updated getting kwargs in async_send_command
Updated debug log to include delay_secs
2019-03-03 00:54:03 +01:00
Daniel Perna
b8eebda541 Update pyhomematic (#21600) 2019-03-02 17:42:51 -05:00
David F. Mulcahey
45316f6ed6 ZHA fixes (#21592)
* do not report on 0x1000 LightLink cluster
* don't flood Zigbee network during configuration or initialization
* add lifeline of 60 minutes to lights
* use ootb polling
2019-03-02 14:09:01 -05:00
Anders Melchiorsen
5eab86986e Word the tplink deprecation warning more strongly (#21586) 2019-03-02 12:32:18 +01:00
Joe Trabulsy
61e4a6be18 Update for new pyvesyncv_v2 library and vesync switch support (#21449)
* Change dependency to pyvesync-v2 for vesync switch

* Update requirements_all.txt

* Update Version - Wall Switch Support

Update required version for vesync outlets and switches.  Eliminate API call for energy usage for wall switches that do not have that feature

* fix name convention
2019-03-02 11:57:10 +01:00
Diogo Gomes
1ad4779443 Add network throughput statistics to systemmonitor sensor (#21575)
* add network throughput

* lint
2019-03-02 16:08:15 +05:30
Diogo Gomes
ed2b9e5483 Centrally define Watt (#21570)
* centralize Watt definition

* lint
2019-03-02 11:29:59 +01:00
Kevin Fronczak
e55ce61100 Upgrade blinkpy==0.13.1 (Fixes #21559) (#21578)
* Upgrade blinkpy with new api endpoint

* Change wifi units to dBm
2019-03-02 11:28:44 +01:00
Daniel Høyer Iversen
8e75bfb11e Upgrade PyXiaomiGateway library (#21582) 2019-03-02 11:27:36 +01:00
Penny Wood
f61f650495 Get room hints from areas (#21519)
* Get google room hint from area.

* Test case for area code.

* Updates as per code review.
2019-03-01 23:31:57 -08:00
Anders Melchiorsen
0c8a31b8ec Memory optimization for logbook (#21549) 2019-03-01 23:23:45 -08:00
Jason Hu
f1b867dccb Re-thrown exception occurred in the blocking service call (#21573)
* Rethrown exception occurred in the actual service call

* Fix lint and test
2019-03-01 23:09:31 -08:00
emontnemery
cd89809be5 Make time trigger data trigger.now local (#21544)
* Make time trigger data trigger.now local

* Make time pattern trigger data trigger.now local

* Lint

* Rework according to review comment

* Lint
2019-03-01 23:09:12 -08:00
Robbie Trencheny
655ada1374 mobile_app component (#21475)
* Initial pass of a mobile_app component

* Fully support encryption, validation for the webhook payloads, and other general improvements

* Return same format as original API calls

* Minor encryption fixes, logging improvements

* Migrate Owntracks to use the superior PyNaCl instead of libnacl, mark it as a requirement in mobile_app

* Add mobile_app to .coveragerc

* Dont manually b64decode on OT

* Initial requested changes

* Round two of fixes

* Initial mobile_app tests

* Dont allow making registration requests for same/existing device

* Test formatting fixes

* Add mobile_app to default_config

* Add some more keys allowed in registration payloads

* Add support for getting a single device, updating a device, getting all devices. Also change from /api/mobile_app/register to /api/mobile_app/devices

* Change device_id to fingerprint

* Next round of changes

* Add keyword args and pass context on all relevant calls

* Remove SingleDeviceView in favor of webhook type to update registration

* Only allow some properties to be updated on registrations, rename integration_data to app_data

* Add call service test, ensure events actually fire, only run the encryption tests if sodium is installed

* pylint

* Fix OwnTracks test

* Fix iteration of devices and remove device_for_webhook_id
2019-03-01 23:08:20 -08:00
Andrew Sayre
0903bd92f0 Add config entry remove callback (#21576) 2019-03-01 21:13:55 -08:00
David F. Mulcahey
cd6c923123 fix exception (#21571) 2019-03-01 20:15:36 -05:00
Wagner Sartori Junior
b8ec74cc15 bump pyxeoma to 1.4.1 to fix and close #19306 (#21568) 2019-03-01 20:11:32 -05:00
damarco
1a9dcaefd2 Bump zigpy-deconz (#21566) 2019-03-01 13:47:20 -05:00
Paulus Schoutsen
52f337ef00 Allow chaining contexts (#21028)
* Allow chaining contexts

* Add stubbed out migration
2019-03-01 10:08:38 -08:00
David F. Mulcahey
b39846fb6b add friendly name to devices in the device registry (#21499)
switch to name_by_user

review comments

add device reg info to zha device api
2019-03-01 08:11:24 -05:00
msvinth
0aba49adce Add separate on/off ids on manual configured IHC lights (#20253)
* Add support for separate on/off ids on manual configured IHC lights.
This makes it easier to support IHC code units thats relies on being
turned on and off through specific inputs.
Also adds a pulse service (ihc.pulse) that supports sending a short on/off pulse to an IHC input.

* Fix

* Lint fix

* Add on/off id support in switch

* Make pulse async

* Code review fixes
2019-03-01 08:17:59 +01:00
Paulus Schoutsen
ee4be13bda Allow config entry reloading (#21502)
* Allow config entry reloading

* Fix duplicate test name

* Add comment

* fix typing
2019-02-28 22:27:20 -06:00
David F. Mulcahey
aa30ac52ea prevent duplicate event channel registration (#21534) 2019-02-28 22:53:59 -05:00
Aaron Bach
326513af90 Add pause/unpause services to RainMachine (#21548)
* Add pause/unpause services to RainMachine

* Update requirements
2019-02-28 17:58:39 -08:00
Paulus Schoutsen
ed28482311 Bumped version to 0.89.0b1 2019-02-28 17:58:23 -08:00
Aaron Bach
0f09c02875 Fix incorrect pyairvisual call (#21542) 2019-02-28 17:46:32 -08:00
Jason Hu
97b93bcf7b Fix warning (#21538) 2019-02-28 17:46:31 -08:00
emontnemery
b05062e9d9 Add missing retain option to mqtt.climate configuration schema (#21536) 2019-02-28 17:46:31 -08:00
Victor Vostrikov
6f2dd21516 Updated variable name for readability (#21528) 2019-02-28 17:46:30 -08:00
Jason Hu
eda2290d47 Allow skip-pip applied to HA core (#21527) 2019-02-28 17:46:30 -08:00
Paulus Schoutsen
238c4247d9 Only use a single store instance (#21521) 2019-02-28 17:46:30 -08:00
Paulus Schoutsen
4fe9f966ad Fix lint (#21520) 2019-02-28 17:46:29 -08:00
Anders Melchiorsen
26a534a67c Improve new Sonos snapshot/restore (#21509)
* Fine-tune new Sonos snapshot/restore

* Move into class
2019-02-28 17:46:29 -08:00
Aaron Bach
aa546b5a1f Add watchdog to Ambient PWS (#21507)
* Add watchdog to Ambient PWS

* Better labeling

* Owner comments
2019-02-28 17:46:28 -08:00
Robert Svensson
9e140d27bf Fix deCONZ retry mechanism for setup 2019-02-28 17:45:41 -08:00
Ben Randall
e6cbdf0645 Add PLATFORM_SCHEMA_BASE to telegram_bot component (#21155) 2019-02-28 17:44:04 -08:00
Paulus Schoutsen
1c889cfcc3 Updated frontend to 20190228.0 2019-02-28 17:43:48 -08:00
Paulus Schoutsen
5e67054ee1 Updated frontend to 20190228.0 2019-02-28 17:43:36 -08:00
David F. Mulcahey
901b2b4ba3 new websocket api way (#21533) 2019-02-28 19:32:41 -05:00
Aaron Bach
b8a94c30e8 Add watchdog to Ambient PWS (#21507)
* Add watchdog to Ambient PWS

* Better labeling

* Owner comments
2019-02-28 14:28:20 -08:00
Martin Hjelmare
40d7fbcda4 Clean up gpslogger tests (#21543) 2019-02-28 14:17:53 -08:00
Aaron Bach
8ebe5c61e8 Fix incorrect pyairvisual call (#21542) 2019-02-28 14:17:10 -08:00
Diogo Gomes
81dd2acf3b Update CODEOWNERS (#21545)
add myself to camera.push
2019-02-28 14:16:51 -08:00
Anders Melchiorsen
193cab4f62 Improve new Sonos snapshot/restore (#21509)
* Fine-tune new Sonos snapshot/restore

* Move into class
2019-02-28 10:25:31 -08:00
Jason Hu
b18b1cffff Fix warning (#21538) 2019-02-28 10:10:21 -08:00
cpopp
84b84559a4 Add support for homekit controller sensors (#21535)
Adds support for homekit devices with temperature, humidity, and
light level characteristics (such as the iHome iSS50)
2019-02-28 10:09:04 -08:00
David F. Mulcahey
82bdd9568d Add direct binding for remotes and lights for ZHA (#21498)
* cluster matching and binding apis

implement binding

callback

fix loop

fix loops

* review comments

* use any because it is clearer
2019-02-28 10:04:35 -08:00
Jason Hu
5ce4fe65b2 Allow skip-pip applied to HA core (#21527) 2019-02-28 10:01:10 -08:00
Paulus Schoutsen
4f4a8a61d2 Only use a single store instance (#21521) 2019-02-28 10:00:17 -08:00
Ben Randall
e14c8c788e Add PLATFORM_SCHEMA_BASE to telegram_bot component (#21155) 2019-02-28 18:27:40 +01:00
emontnemery
c340083ba5 Add missing retain option to mqtt.climate configuration schema (#21536) 2019-02-28 18:26:54 +01:00
Marco M
c3d4738649 Mqtt alarm added value_template and code_arm_required (#19558)
* Added value_template config for parsing json value from state topic

Added arm_code_required to avoid code enter when arming

* Renamed config parameter to code_arm_required

* Fix for discovery update compatibility

* Fixed lint error

* Added test
2019-02-28 17:44:23 +01:00
Fabian Affolter
b0dd6e4093 Upgrade python-mystrom to 0.5.0 (#21523) 2019-02-28 17:46:38 +05:30
Fabian Affolter
3e8e998078 Upgrade numpy to 1.16.2 (#21525) 2019-02-28 17:46:21 +05:30
Victor Vostrikov
342ddbfe8c Updated variable name for readability (#21528) 2019-02-28 17:35:39 +05:30
koolsb
bfc6f51b25 Add arm night for alarm decoder (#21488) 2019-02-28 17:15:17 +05:30
Jeff Irion
27a780dcc9 Register 'firetv.adb_command' service (#21419)
* Register 'media_player.firetv_adb_cmd' service

* Wrap the 'firetv_adb_cmd' service with 'adb_decorator'

* Address reviewer comments

* Move firetv to its own platform

* Move 'adb_command' service description

* Rename DOMAIN to FIRETV_DOMAIN

* Import KEYS in __init__ method

* Change 'self.KEYS' to 'self.keys'

* Update firetv in .coveragerc

* 'homeassistant.components.media_player.firetv' -> 'homeassistant.components.firetv'

* 'homeassistant.components.firetv' -> 'homeassistant.components.firetv.media_player'
2019-02-28 12:29:56 +01:00
Fabian Affolter
6f2def06be Upgrade opensensemap-api to 0.1.5 (#21524) 2019-02-28 11:59:14 +01:00
Paulus Schoutsen
229d19bb20 Fix lint (#21520) 2019-02-27 21:35:14 -08:00
Adam Dullage
548d7bbeda Bump starlingbank version to 3.1 (#21501)
* Bump starlingbank version to 3.1

Resolves Python 3.5 compatibility issue.

* Remove syntax error.
2019-02-28 09:53:21 +05:30
Aaron Bach
aad15776c0 Upgrade pyflunearyou to 1.0.2 (#21514) 2019-02-27 17:52:50 -07:00
Aaron Bach
c1365de861 Upgraded py17track to 2.2.2 (#21515) 2019-02-27 17:52:31 -07:00
Aaron Bach
fd32910185 Upgrade pytile to 2.0.6 (#21516) 2019-02-27 17:52:05 -07:00
Aaron Bach
1369b0b583 Upgrade pypollencom to 2.2.3 (#21517) 2019-02-27 17:51:36 -07:00
Aaron Bach
4ca7273c58 Upgrade pyopenuv to 1.0.9 (#21513) 2019-02-27 17:51:09 -07:00
Paulus Schoutsen
45bbe75d29 Bumped version to 0.89.0b0 2019-02-27 16:45:14 -08:00
Victor Vostrikov
4a45510c88 Changed source priority for Person (#21479)
* Added gps accuracy to Person

* Corrected GPS accuracy for Person

* Added priority of sources to Person

* Fixed formatting

* Removed rounding of coordinates.

* Added test for source priority.
Changed test for rounding of coordinates.

* Improved code style

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Code style cleanup

* Lint

* Lint
2019-02-27 16:40:23 -08:00
msvinth
070320a24a Bump ihc to 2.3.0 (#21494) 2019-02-27 16:39:11 -08:00
Nick Whyte
1ef3e32d4a ness_alarm: Bump nessclient version to 0.9.13 (#21466) 2019-02-27 16:38:53 -08:00
Paulus Schoutsen
c9ade6ee85 Merge remote-tracking branch 'origin/master' into dev 2019-02-27 16:34:47 -08:00
Paulus Schoutsen
78217fa9b0 Update translations 2019-02-27 16:34:13 -08:00
Paulus Schoutsen
f3bb9e870e Updated frontend to 20190227.0 2019-02-27 16:33:56 -08:00
Daniel Høyer Iversen
732110b4c3 Upgrade tibber lib (#21486) 2019-02-27 16:33:26 -08:00
Aaron Bach
ab2be6df48 Upgrade aioambient to 0.1.3 (#21510) 2019-02-27 16:27:26 -08:00
Aaron Bach
e4b2aab1e9 Bump simplisafe-python to 3.4.1 (#21511) 2019-02-27 16:27:13 -08:00
Aaron Bach
3749321fa5 Upgrade pyairvisual to 3.0.1 (#21512) 2019-02-27 16:26:59 -08:00
Jeff Irion
0ebd12fa6c Avoid unnecessary commands in Vizio update function (#20867) 2019-02-27 16:08:02 -08:00
CV
8a026bf214 HomeMatic: Add error-attribute (#21009)
Error attribute has different meanings depending on device
2019-02-27 23:09:49 +01:00
Daniel Høyer Iversen
519315f9c8 pylint 2.3.0 (#21485)
* pylint 2.3.0

* remove const

*  disable=syntax-error
2019-02-27 16:10:40 -05:00
Robert Svensson
2482816a11 Fix deCONZ retry mechanism for setup 2019-02-27 21:04:55 +01:00
Penny Wood
b87eb9d79e Fire events when Google Assistant commands come in #15139 (#20204) 2019-02-27 11:33:34 -08:00
Markus Jankowski
9b3a3fc1ac Add device_info to enable HA-devices for Homematic IP (#21241)
* add device_info to device

* added checks

* Fixes based on feedback

* Fix spelling

* Simplified implementation

On homematicip devices and the ap are created

* small fix with device.id

* hub/ap device creation moved to __init__.py

* Fixed result handling

* fixes after review.

* Fix test
2019-02-27 11:25:11 -08:00
Alexei Chetroi
9066609d23 Refactor async_turn_on() for ZHA Light. (#21156)
* Refactor async_turn_on() for ZHA Light.

Use "move_to_level_with_on_off" if brightness or transition attributes
are present in the service call data, otherwise issue "On" Zigbee
command.
Allow brightness of 0 for service call -- effectively turning the light
off.
Send color commands only after the light was turned on.

* Fix zha.light tests.
2019-02-27 08:34:38 -05:00
Fabian Affolter
27e6c6665f Upgrade astral to 1.10.1 (#21474) 2019-02-27 14:07:51 +01:00
Fabian Affolter
0b68da2f88 Upgrade shodan to 1.11.1 (#21478) 2019-02-27 14:07:26 +01:00
Fabian Affolter
01ee92177f Upgrade bcrypt to 3.1.6 (#21476) 2019-02-27 14:07:02 +01:00
Tomas Hellström
33c9afd6e0 Added a digit for precipitation (#21439) 2019-02-27 11:07:35 +05:30
Kevin Tuhumury
28f9c7c2cd Add cpu_use_percent as a new resource to the Glances sensor. (#21455) 2019-02-27 10:54:09 +05:30
Petro31
51773f338e Add person support for Waze Travel Time (#21471)
Adds person to the list of TRACKABLE_DOMAINS domains.  _get_location_from_entity will handle the person domain without any changes.
2019-02-26 20:02:49 -08:00
dfournie
822b6328e1 Add Somfy IO Garage door (#21320)
* Add Somfy IO Garage door

* Fix code style
2019-02-26 22:22:29 -05:00
Paulus Schoutsen
e9f79c3d06 Lint 2019-02-26 18:50:34 -08:00
blackray12
be78265631 Add mitemp bt sensor device class (#20293)
* Fix HomeKit missing humidity issue

When using HomeKit components, MiTemp BT's humidity state will not display in Home.app.
After Added home-assistant device class into property, this problem is solved.

* Add Device_Class_Battery to property

* Break long lines.

* Lint
2019-02-26 15:10:25 -08:00
Thibault Maekelbergh
4d4cd2d752 Update sensor.nmbs to support vias better + show on map (#20063)
* Add the destination stations to the attributes

* Add support for showing station on map

* Add option to exclude via connections

* Cleanup the live sensor

* Perform better checking against false i/o None values

* Add support for excluding vias

* Add more details for via trains

* Lint file

* Update logger level
2019-02-26 15:08:25 -08:00
Daniel Høyer Iversen
efa48848a5 Comment out bluepy libraries from requirements_all.txt (#20856)
* Comment bluepy libraries from requirements_all.txt, fixes #20778

* Comment bluepy libraries from requirements_all.txt, fixes #20778

* Comment bluepy libraries from requirements_all.txt, fixes #20778
2019-02-26 14:50:48 -08:00
William Scanlon
9cff1dd4ba Added new econet states (#21420) 2019-02-26 14:49:15 -08:00
Mattias Welponer
42e691c194 Add HomematicIP HmIP-OC8 module (#21401)
* Add support for HmIP-OC8 module

* Fix line lenght
2019-02-26 14:48:19 -08:00
Jason Hu
7bae76843c Add config for trusted networks auth provider (#21111)
* Add config for trusted networks auth provider

* Lint

* Fix typing

* Fix pylint

* Fix lint

* Add some log information

* Add http.trusted_networks deprecated warning

* Remove log info

* Lint
2019-02-26 14:42:48 -08:00
Paulus Schoutsen
5c2f997394 Lint 2019-02-26 14:42:09 -08:00
Leonardo Merza
e739fd8a31 Reddit Sensor (#21344)
* init

automated commit 22/02/2019 22:55:49

cr comments

cr comments

automated commit 24/02/2019 14:41:08

automated commit 24/02/2019 14:41:59

automated commit 24/02/2019 14:54:16

automated commit 24/02/2019 14:54:49

automated commit 24/02/2019 19:46:15

automated commit 25/02/2019 10:10:46

automated commit 25/02/2019 10:10:52

automated commit 25/02/2019 10:12:16

automated commit 25/02/2019 10:15:59

* automated commit 25/02/2019 12:26:38

* automated commit 25/02/2019 13:55:52
2019-02-26 13:55:11 -08:00
René-Marc Simard
aa472d4f10 Adjust GTFS dates when crossing midnight (#20916) 2019-02-26 13:17:20 -08:00
Andrew Sayre
3b9db88065 Add SmartThings Scene platform (#21405)
* Add SmartThings Scene platform

* Fixed failing tests after rebase

* Update cover tests.
2019-02-26 13:12:24 -08:00
Paulus Schoutsen
344e839bec Remove launching a server in a test (#21445) 2019-02-26 13:06:27 -08:00
Sebastian Muszynski
e119deafe5 Bump PyXiaomiGateway version to 0.11.2 (#21453) 2019-02-26 12:37:21 -08:00
Patrick T.C
dc6fd780a9 Fix for Snips platform update that breaks hermes api. (#21443) 2019-02-26 12:37:01 -08:00
Otto Winter
29187795a8 Fix ESPHome nodes being auto-added without user confirmation (#21444) 2019-02-26 12:35:25 -08:00
Paulus Schoutsen
ab73b725e1 Pin isort (#21463) 2019-02-26 12:33:40 -08:00
David F. Mulcahey
c4400be62a Add friendly name to devices in the device registry (#21318)
* add friendly name to devices in the device registry

* switch to name_by_user

* review comments
2019-02-26 12:20:16 -08:00
David F. Mulcahey
a34524febe Clean up ZHA post rewrite (#21448)
* update async handling to reduce unnecessary coroutine creation

* lint

* cleanup
2019-02-26 10:48:10 -08:00
Ville Skyttä
beb86426e4 Upgrade flake8 to 3.7.7 (#21452) 2019-02-26 10:47:57 -08:00
Anders Melchiorsen
03fc81a434 Clean up codeowners file (#21442) 2019-02-26 10:47:08 -08:00
Giorgos Logiotatidis
5a5c97acb3 Add timeout option to sensor.rest and binary_sensor.rest. (#20065) 2019-02-26 10:23:46 -08:00
Johann Kellerman
90d3f517d8 Check if a script requirement is available before install (#20517)
* Check if a script requirement is available before install

* PackageLoadable

* hound

* req
2019-02-26 10:20:54 -08:00
Franck Nijhof
f3c9327ccf Rewrite of Toon component (#21186)
* 🚜 Rewrite of Toon component

* 🔥 Removed manual state from list

* 👕 Addresses code review comments

* 🔥 Removes a log line that should not have been left behind

* 👕 Addresses linting warnings

* 👕 Addresses Hound CI warning

* 👕 Fixes small code styling issues

*  Sets an appropriate SCAN_INTERVAL

*  Sets min/max temperature for climate platform

* 👕 Makes imports more consistent with codebase

* 🚑 Fixes incorrect SCAN_INTERVAL value in climate platform

* 🚑 Uses OrderedDict for config_flow schema

* 👕 Adds return types for min/max temp

* 🚜 Refactors entities into their actual devices

* ⬆️ Updates toonapilib to 3.0.7

* 🚜 Refactors binary sensor state inversion

* 🚑 Fixes states of OpenTherm connection and Hot Tap Water

*  Adds Boiler Preheat binary sensor

*  Adds Toon Thermostat Program binary sensor

*  Adds Boiler Modulation Level sensor

*  Adds Daily Power Cost sensor

* 🔥 Cleanup of Toon Thermostat climate attributes

* 🚜 Adjusts config_flow with Tenant selection

* 🙋 Adds myself to codeowners file as maintainer

* ⬆️ Gen requirements

* ⬆️ Updates toonapilib to 3.0.9

*  Adds config_flow tests
2019-02-26 10:18:09 -08:00
Andrew Sayre
f0268688be Increase travis timeout (#21447) 2019-02-25 18:59:02 -08:00
Anders Melchiorsen
095a0d19d1 Fix Sonos snapshot/restore (#21411) 2019-02-25 13:03:15 -08:00
koreth
4e9d0ebc63 Fix double events on Lutron Pico keypads (#21408)
* Fix double events on Lutron Pico keypads (#21235)

* Replace "else" with default value; remove explanatory comments
2019-02-25 12:09:58 -08:00
Paulus Schoutsen
6626e5c4a4 Handle GA Disconnect intent (#21387)
* Handle GA Disconnect intent

* Fixed lint error
2019-02-25 10:35:03 -08:00
Otto Winter
db4c06c8fe Add ESPHome User-Defined Services (#21409)
* Add ESPHome User-Defined Services

* Update requirements_all.txt
2019-02-25 10:34:06 -08:00
Andrew Sayre
d3f1ee4a89 Add SmartThings Cover platform and add cover device classes (#21192)
* Add additional device classes to Cover component; Add SmartThings cover platform; Improve lock test coverage

* Enhance cover platform to support position and battery level reporting.

* Add additional classes

* Removed device class descriptions

* Updates based on review feedback

* Add test case for closed
2019-02-25 10:13:34 -08:00
Andrew Sayre
0ccbf61aea Add power and energy attributes to SmartThings switch (#21375) 2019-02-25 15:50:16 +01:00
Joakim Plate
a50bcdff1a Mark water_heater as significant domain (#21390) 2019-02-25 07:45:40 +01:00
Baptiste Lecocq
f190b698c6 Update pylinky (#21416) 2019-02-25 07:44:33 +01:00
Ville Skyttä
619ea3ff98 Upgrade mypy to 0.670 (#20934) 2019-02-25 07:54:54 +02:00
Ville Skyttä
dd5fc0a1da Upgrade pytest to 4.3.0 (#21412) 2019-02-25 07:36:57 +02:00
Jeff Irion
ff93cdb0bc Add ADB server functionality to Fire TV (#21221)
* Bump firetv to 1.0.8

* Update the 'update' function for Fire TV

* Return None for properties when unavailable

* Remove 'self.adb_lock' attribute

* Remove threading import

* Update configuration for Fire TV component

* Clarify 'python-adb' vs. 'pure-python-adb'

* Rename '__adb_decorator' to '_adb_exception_catcher'

* Don't check 'self._available' in properties

* Bump firetv to 1.0.9
2019-02-25 00:16:49 +01:00
Joakim Plate
814e610b1d Philips js state (#21407)
* Switch to SCAN_INTERVAL instead of throttle

This allows forced update of state

* Don't change tv on/off state in services

* Drop unused variables

* Only send mute if different from current state

* No need to update variables, will behandled on update

* Drop unused import
2019-02-24 14:33:07 -06:00
Anders Melchiorsen
a4bb35142c Add Sonos discovery of multiple households (#21337)
* Remove confusing device naming

* Add discovery of multiple households

* Rename SonosDevice to SonosEntity
2019-02-24 18:45:08 +01:00
Martin Hjelmare
47220d71a1 Clean up locative tests (#21400) 2019-02-24 10:49:50 -06:00
Andrew Sayre
04fc951048 Improve tolerance of SmartThings Climate platform (#21383)
* Improve resilience of platform with buggy handlers

* Eliminate possibility of None in operation list

* Refactor variable name
2019-02-24 10:45:11 -06:00
Martin Hjelmare
7255fbdf3a Clean up geofency test (#21397) 2019-02-24 15:56:19 +01:00
Hmmbob
65bc7a6fbd Update WazeTravelSensor to 0.9 (#21130)
* Update WazeRouteCalculator to 0.8 and suppress logging

Fixes #20071 and #21051

* Update requirements_all.txt

* Update requirements_all.txt

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py

* Update waze_travel_time.py
2019-02-24 07:21:56 -06:00
koreth
3e9376c418 Handle capitalized HomeKit property names (#21382)
The Velux ACTIVE gateway uses `C#` rather than `c#` as the name of
the property that holds the count of accessories. Apple's HomeKit docs
suggest that properties should be case-insensitive, so update the
code to not assume the property names are lower case.
2019-02-24 13:56:52 +01:00
Nick Whyte
6e0186fd56 Bump nessclient version to 0.9.10 (#21388)
* ness_alarm: Bump nessclient version

* update requirements_all.txt
2019-02-24 10:26:02 +01:00
Fabian Affolter
3732d75633 Update ordering (#21377) 2019-02-24 10:22:17 +01:00
Fabian Affolter
2ada0ecfd9 Upgrade shodan to 1.11.0 (#21384) 2019-02-23 22:14:26 -06:00
Andrew Sayre
3d9f4bf2aa SmartThings Lock platform state attributes enhancement (#21379)
* Add additional lock metadata

* Fixed attribute name in test
2019-02-24 02:52:37 +01:00
Rohan Kapoor
ce86fe47e3 Remove the google travel time update service (#21153) 2019-02-23 19:24:38 -06:00
Martin Hjelmare
d44269981b Clean up owntracks tests (#21378) 2019-02-23 19:17:49 -06:00
Andre Lengwenus
fc13e37d8d Refactoring. Moved LCN constants to const.py (#21376) 2019-02-24 01:30:19 +01:00
Daniel Høyer Iversen
b588c1fe1c Handle connection issue for netatmo (#21346)
* Handle connection issue for netatmo

* reduce logging
2019-02-24 00:41:38 +01:00
Tony763
6743ef10ab Update panasonic_viera.py (#21365) 2019-02-23 23:39:51 +01:00
Thibault Maekelbergh
a1c3a38428 Generate new Discogs sensors + fix scan interval (#19443)
* Generate new sensors for discogs:
- Generate collection sensor
- Generate wantlist sensor
- Generate random record sensor
- Removes the option to set a name

* Make it so name can still be configured

* Fix invalid syntax

* Use shared data object + 1 sensor

* Linting

* Remove straying comment

* Dont use async for non-async stuff

* Don't use separate list for conf already in dict

* Use consts for keys

* Copy dict to list for sensors

* Fix syntax for computed keys in SENSORS dict
2019-02-23 15:58:30 -06:00
Teemu R
492c3b24de Check for attribute existence for HS220 support (#21309)
* Check for attribute existence as smartplug does not have them (for HS220 support)

* use getattr over hasattr and a separate check
2019-02-23 22:57:54 +01:00
Alistair Galbraith
1eba90d2a1 Add initial support for Sony SDCP projector control (#20269)
* Add initial support for Sony SDCP projector control

* Changes to reflect code review

* Added code per change requests

- Validation of connection during setup_platform
- Docs pending

* Removed blank lines per CI build

* Lint fix

* Update homeassistant/components/switch/sony_projector.py

Co-Authored-By: alistairg <alistair@alistairs.net>

* Updated .coveragerc, made requested logger changes

* Update docstring
2019-02-23 15:57:10 -06:00
Jérôme W
a8a2daeac5 Add custom and zone cleaning to Neato Vacuums (#20779)
* Adding custom and zone cleaning to Neato Vacuums

* Fixing line length and missing imports

* Line too long

* Adding details to the custom service

* Fix linting issues

* Reverting ACTION

* Code cleanup

* Typo

* Requested modifications

* Changing the custom service domain

* No service schema depency anymore

* Removing useless code

* Linting

* Requested changes

* Requested changes for domain

* Revert the service domain back to vacuum
2019-02-23 15:55:55 -06:00
Rohan Kapoor
dc5b8fd8c4 Split out iperf3 into a component with a sensor platform (#21138)
* Move iperf3 sensor to a standalone component

* Split out iperf3 into a component with a sensor platform

* Update coverage and requirements

* Add services.yaml

* Clean up a little bit

* Lint

* Lint
2019-02-23 15:55:08 -06:00
Martin Hjelmare
7143f4e621 Fix person update on create (#21355)
* Update tests to set correct hass running state

* Update person on adding person if hass is running

* Test creating person when hass is running
2019-02-23 15:38:21 -06:00
Adam Dullage
bfda923999 Update Starling Bank Integration to v2 API (#21358)
* Bump starlingbank to v2 API

* Fixed incorrect call
2019-02-23 20:54:42 +01:00
yosilevy
e8b67fc19f Scene validator fix (#21362) 2019-02-23 18:26:27 +01:00
Richard Mitchell
c595cf016f Support the person component in Prometheus (#21363) 2019-02-23 18:13:27 +01:00
Finbarr Brady
d027965304 Update luci device tracker (#21321)
* * bump pip module version.
* moved named tuple into the module.
* pass SSL bool into the object init.
* support get_extra_attributes

* Update homeassistant/components/device_tracker/luci.py
2019-02-23 16:28:41 +01:00
Andre Lengwenus
f20195ba75 Add conf_key check for LCN platform load (#21354) 2019-02-23 15:58:18 +01:00
Benny de Leeuw
197303b63e Add voltage per phase (#21319) 2019-02-23 15:57:54 +01:00
tmechen
2f7b4ed7f0 implementing freedaily mode (#21314)
adressing #15105 and add a freedaily mode for a 5 day forecast with free API key
2019-02-23 15:52:08 +01:00
Justin Bassett
02745be44d Allows the utility_meter to net meter rather than only allow increases. (#21204)
* Allow the utility_meter to net meter rather than only allow increases.

* Fix PR issues around CI.

* Fix line length fallout.

* Change rollover to net_consumption.  Add unit tests.

* Fix test style issues.

* Fix style in tests.
2019-02-23 14:02:39 +00:00
siberx
616c7628d7 Fixes the sensor.filter outlier filter (handle step-changes correctly) (#21332)
* Fix outlier filter median return, Add/update filter outlier tests

* Switch outlier filter to store raw vals (handles step-changes correctly)

* Filter store_raw as attribute instead of filter_state parameter

* Fix linting issues
2019-02-23 13:51:33 +00:00
Hmmbob
954bd4e13b Update buienradar.py (#21351)
Fixing warning about unsupported config key in Buienradar sensor, whilst it was actually supported (but not validated)
2019-02-23 14:43:37 +01:00
Julius Mittenzwei
48e44f4b5b Updated pyvlx from 0.2.8 to 0.2.9. This version has slightly improved logging (#21349) 2019-02-23 08:04:32 -05:00
Daniel Høyer Iversen
b7b4a6dcc8 Add location to Norway airquality (#21347) 2019-02-23 10:35:18 +01:00
Andre Lengwenus
8f70c16863 Add LCN cover platform (#20288)
* Add LCN cover platform

* Removed unused default value

* Moved cover component to lcn platform directory. Small changes due to change request

* Closed state is set before updating
2019-02-23 10:13:15 +01:00
Daniel Shokouhi
2aa7bdb1d5 Allow google home component device tracker to be optional (#21335) 2019-02-23 01:01:09 -08:00
Robbie Trencheny
111f882d78 Add note to issue template regarding iOS issues (#21342)
## Description:

Add an additional line to the issue template mentioning that iOS issues should be reported to the home-assistant-iOS repo.
2019-02-22 17:39:19 -08:00
David Conley
b437b87655 Allow custom_effect to be absent from Flux configuration (#21317)
* Allow custom_effect to be absent from Flux configuration

* set custom effect to none during setup
2019-02-23 00:13:40 +01:00
philipperequile
2b3c31cdb0 Add more ads plc types (#19801)
* Update __init__.py

Support for 2 new 4-byte PLC datatypes DINT and UDINT

* Update __init__.py

* Fix lint issue

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Support for 2 new PLC types

Sensor supports DINT and UDINT PLC types

* Update __init__.py

I removed unused TYPES = [ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_DINT, ADSTYPE_UDINT]
2019-02-22 23:52:46 +01:00
Andrew Sayre
8b38b82e73 Enhance SmartThings component subscription (#21124)
* Move to config v2 to store SmartApp oauth keys

* Add migration functionality.

* Regenerate refresh token on periodic basis

* Fix regenerate and misc. optimizations

* Review feedback

* Subscription sync logic now performs a difference operation

* Removed config entry reloading.
2019-02-22 20:35:12 +01:00
Robert Svensson
d9712027e8 Config entry options (#18929)
Add support for options flow for config entries
2019-02-22 17:59:43 +01:00
Phil Cole
caa3b123ae Nissanleaf (#21145)
* Remove unneeded returns from handle_update()

* Start __init__() params with hass.

* Remove excess logging and downgrade remaining logging.

* Remove period from end of comment

* Decorate callback with @callback

* Use more descriptive variables than key and value.

* Inherit from BinarySensorDevice and overwrite is_on rather than state.

* Removed uncheckedreturn values.

* Use super() rather than explicit object.

* Use add_entities instead of add_devices.

* Don't use listener when calling immediately.

* Remove some excess logging.

* Switch to sync since pycarwings2 is sync.

* Remove RuntimeError exception matching.

* Add temporary reviewer comments.

* Add UI help descriptions for update service.

* Fix hound errors.

* Replaced time.sleep() with await asyncio.sleep()

* Removed location_updateon_on attribute since on device_tracker.

* Use async_added_to_hass() and async_dispatcher_connect().

* Use dict[key] because schema key is required.

* Clarify variable names.

* Remove icon for charging switch.

* Convert LeafChargeSwitch into service and sensor.

* Use async_dispatcher_send().

* Add guard checks for discovery_info. Consistent logs.

* Use async_schedul_update_ha_state().

* Device tracker should return true.

* Remove icon for climate control.

* Really remove icon for climate control.

* Use register() instead of async_register().

* Add guard on device tracker if discovery_info is None.
2019-02-22 17:34:23 +01:00
SNoof85
4102e24481 Adding myself as codeowner for Freebox component (#21288) 2019-02-22 09:58:48 -05:00
Fabian Affolter
3f29e91367 Remove index (#21304)
* Remove index

* Remove emnumerate
2019-02-22 14:11:07 +01:00
Paulus Schoutsen
3fcbc36abe Update translations 2019-02-21 16:40:25 -08:00
Paulus Schoutsen
bd352b9950 Merge remote-tracking branch 'origin/master' into dev 2019-02-21 16:40:07 -08:00
Paulus Schoutsen
bf4fb36bb1 Fix yeelight config validation (#21295) 2019-02-21 16:39:17 -08:00
Paulus Schoutsen
ac502980a2 Do not warn for internally loaded components (#21287) 2019-02-21 14:57:38 -08:00
David McNett
d9a44f2a78 Version bump: python-anthemav to v1.1.9 (#21273) 2019-02-21 23:24:29 +01:00
Aaron Bach
d0e88d9628 Fix unhandled exception in Ambient PWS config entry (#21278) 2019-02-21 13:27:34 -07:00
David F. Mulcahey
a2877c4ea0 update services.yaml (#21276) 2019-02-21 14:39:55 -05:00
Teemu R
94be43e3e1 Add support for automatic discovery of TP-Link switches, bulbs and dimmers (#18091)
* {switch,light}.tplink: use deviceid as unique id, fetch name from the device during initialization

* raise PlatformNotReady when no device is available

* Use mac instead of deviceid

* remove name option as obsolete

* Add support for configuration flow / integration

Allows activating automatic discovery of supported devices from the configuration

* Fix linting, update requirements_all.txt

* start cleaning up tplink component based on feedback

* add device info, improve config handling

* Allow overriding detected devices via configuration file

* Update requirements.txt

* Remove debug logging

* make hound happy

* Avoid I/O during init and simplify the code, remove remains of leds_on

* Fix issues based on feedback, use consistent quotation marks for device info

* add async_setup_platform emiting a deprecation warning

* Avoid blocking the I/O, check for None on features

* handle some Martin's comments, schema-validation is still missing

* use async_create_task instead of async_add_job, let core validate the schema

* simplify configuration handling by storing the configuration data separately from initialized instances

* add default values to schema, make hound happy

* with defaults set by schema, simplify the checks. add async_unload_entry

* Use constant for data structure access

* REWORD add a short note about async_unload_entry

* handle feedback from Martin, config_data is checked against Noneness

* use pop to remove the domain on unload

* First steps to add tests for the new tplink component

* embed platforms under the component directory

* Fix tests by mocking the pyhs100 internals

* Fix linting

* Test against multiple instances of devices, tidy up

* (hopefully) final linting round

* Add pyHS100 to test requirements

* log always the warnings occured during an update to make them easy to see

* revert back the warning behavior (requirement for silver level in IQS)

* Unload only when an entry is being loaded and add tests for that

Thanks @MartinHjelmare for pointing this out!

* Fix linting

* Bump the upstream lib, fixes most prominently the HSV setting on bulbs

* Test unloading for all platforms, clear the data storage instead of popping it out, making it possible to reconfigure after removal without restarting hass first

* Use class variables instead of instance variables for bulb states, required for HS220

* Use new-style format string

* Fix indenting, uppercase the mock constant

* Run black on test_init, hopefully that will finally fix the weird formatting (pycharm, pylint and hound seems to have different opinions...)
2019-02-21 20:29:07 +01:00
Tobias Hoff
c637bad1eb account specific cookies file to enable multiple accounts (#19811) 2019-02-21 10:35:27 -08:00
Miroslav Ždrale
565f513b77 Added device tracker support for Ubee Router (#19586)
* Added Ubee Router Device Tracker.

* Updated code to meet requirements.

* Code clean-up.

* Code clean-up.

* Code clean-up.

* Minor error message update

* Ubee device tracker: Minor code clean-up

* Bump pyubee version

* Code clean-up
2019-02-21 09:24:37 -08:00
Paulus Schoutsen
4c4317fb37 Add SamsungTV Mac validation (#21268) 2019-02-21 08:52:45 -08:00
Joakim Plate
998b5f6d19 Add missing configation option (#21265)
Fixes https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 08:26:26 -08:00
Joakim Plate
6b7a5cfcad Add missing configuration option to plex (#21264)
Fixes part of: https://github.com/home-assistant/home-assistant/issues/21254
2019-02-21 08:26:09 -08:00
Gido
e764d9461a Update rova component with suffix for house number (#21182)
* Update rova component with release rova release 0.1.0
Add house_number_suffix to configuration

* Set default value for house_number_suffix
2019-02-21 09:51:36 -05:00
OleksandrBerchenko
09692143d0 Correctly detect devices, which went offline during HA restart (#20933)
* Correctly detect devices, which went offline during HA restart

* Update __init__.py
2019-02-21 14:48:17 +01:00
David F. Mulcahey
0f8575f939 Fix ZHA bugs (#21246)
* fix bugs

* add comment

* allow entities to be marked unavailable
2019-02-21 14:20:58 +01:00
Paulus Schoutsen
2435456248 Prevent partial custom component overlays (#21070)
* Prevent partial custom component overlays

* Fix tests
2019-02-21 09:41:36 +01:00
Fredrik Erlandsson
73099caede Alarm trigger support for Point (#21207) 2019-02-21 06:50:02 +01:00
Fabian Affolter
966fd1034d Upgrade opensensemap-api to 0.1.4 (#21240) 2019-02-20 17:46:37 -07:00
Paulus Schoutsen
ddd63c615f Remove constraint from regex (#21239) 2019-02-20 21:31:41 +01:00
Paulus Schoutsen
03573781c7 Updated frontend to 20190220.0 2019-02-20 08:55:42 -08:00
Finbarr Brady
54949cff5a Support OpenWRT 18.06 in luci device tracker (#21236)
* Got it right this time i hope

* updates on comments
2019-02-20 16:55:00 +01:00
damarco
1518a80069 Bump zigpy (#21203)
* Bump zigpy

* Update requirements

* Update test requirements

* Bump zigpy-deconz
2019-02-20 16:34:59 +01:00
David F. Mulcahey
cece6454e4 Fix bug in ZHA and tweak non sensor channel logic (#21234)
* fix race condition and prevent profiles from stealing channels

* fix battery voltage
2019-02-20 16:33:29 +01:00
David F. Mulcahey
5b24b271cc Don't dispatch to components when there are no channels for ZHA sensors (#21223)
* don't dispatch when channels don't exist

* review comment
2019-02-20 16:27:03 +01:00
Marco Gazzola
5115dfada2 Add zone and reps for Xiaomi vacuum (#19777)
* xiaomi vacuum with zone and reps

* tail whitespace

* tail whitespaces

* new version

* fix params typs

* fix param type

* line length

* rytilahti tips

* houndci-bot

* fix trevis

* rytilahti tips

* service description

* syssi fix

* MartinHjelmare tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* line lenght

* data_template schema

* fix

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* Update homeassistant/components/vacuum/xiaomi_miio.py

Co-Authored-By: marcogazzola <dev@marcogazzola.com>

* xiaomi vacuum with zone and reps

* tail whitespace

* new version

* fix param type

* rytilahti tips

* rytilahti tips

* MartinHjelmare

* data_template schema

* line lenght

* line lenght

* data_template schema

* fix

* Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit e1f370b3b45d2541c8117146b0940d7c2b5bc8b0.

* log fixed

* Revert "log fixed"

This reverts commit 1f0e7b35e81154af476a0bf1ae00773180cadb98.

* Revert "Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev""

This reverts commit 1cf9e5ae1f5c1c0504fbf59763b39c6a5656cb91.

* Revert "Merge branch 'dev' of https://github.com/marcogazzola/home-assistant into dev"

This reverts commit 0e8d53449a98fd33756397f31a891dd0d4d206ce.

* log fixed
2019-02-20 15:44:04 +01:00
Aaron Bach
7e06d03b45 Fix an Ambient PWS exception when location info is missing (#21220) 2019-02-20 12:10:42 +01:00
Diogo Gomes
1ff299875b Add self to integration sensor and utility_meter (#21226) 2019-02-20 08:34:10 +01:00
Paulus Schoutsen
cf3a8b60ff Prevent invalid context from crashing (#21231)
* Prevent invalid context from crashing

* Lint
2019-02-20 08:02:56 +01:00
Daniel Perna
27d598fff8 Update pyhomematic to 0.1.56 (#21227) 2019-02-20 00:31:46 +01:00
Paulus Schoutsen
49995c2120 Fix the build (#21229) 2019-02-19 13:52:14 -08:00
Paulus Schoutsen
f452409cfa Updated frontend to 20190219.0 2019-02-19 10:14:33 -08:00
zewelor
fb820975b5 Add yeelight flow action support (#21195) 2019-02-19 19:06:40 +01:00
David F. Mulcahey
3be8178035 Refactor ZHA listeners into channels (#21196)
* refactor listeners to channels

* update coveragerc
2019-02-19 09:58:22 -08:00
Johann Bauer
fe4a2b5b31 Fix Homematic IP Cloud configuration (#21202)
`homematicip.aio.auth.isRequestAcknowledged` returns false if the
request failed in stead of raising an error.

See coreGreenberet/homematicip-rest-api@0b61954f6a

Closes: #20428
2019-02-19 09:53:20 -08:00
carstenschroeder
df8589c36a Push pyads to 3.0.7 (#21216)
* Push to pyads 3.0.7

* Correct too long line
2019-02-19 18:42:00 +01:00
Diogo Gomes
b0f317743b ordered by last occurence (#21200) 2019-02-19 08:45:21 -08:00
ehendrix23
99eda385d1 Set aioharmony version to 0.1.8 (#21213)
Update aioharmony version to support latest HUB firmware (4.15.250).
2019-02-19 08:44:42 -08:00
Fabian Affolter
e3cfcbad69 Upgrade numpy to 1.16.1 (#21190) 2019-02-19 16:04:56 +01:00
Julien Brochet
98c3c02daa Bump Synology SRM dependency to version 0.0.6 (#21212)
* Bump Synology SRM dependency to version 0.0.6

* Add @aerialls to the Synology SRM code owners
2019-02-19 10:01:47 -05:00
Fabian Affolter
2d2c6cf4a1 Use constants from const.py (#21068)
* Use constants from const.py

* Fix lint issues
2019-02-19 14:09:06 +01:00
Daniel Perna
9d3eaada27 Netatmo, address comments from #20755 (#21157)
Netatmo component cleanup
2019-02-19 10:53:45 +01:00
Fabian Affolter
baaeaab61d Upgrade crimereports to 1.0.1 (#21187) 2019-02-19 10:04:14 +01:00
starkillerOG
921efbdfef Philips Hue: Add bridge update prompt (#21119)
* Add a prompt if bridge update is available.

* Change logger warning for light update

The self.light.swupdatestate only checks for updates of that specific light, it does not check for updates of the bridge.
Theirfore the warning message schould be updated.

* add space

* fix tests

* rename to swupdate2_bridge_state

* update aiohue to v1.9.1

* update aiohue to v1.9.1

* update aiohue to v1.9.1
2019-02-18 21:31:42 -08:00
Anders Melchiorsen
bc46e48d23 Upgrade aioimaplib for Python 3.7 compatibility (#21197) 2019-02-19 06:11:56 +01:00
OleksandrBerchenko
bdea222196 Expose effect_list attribute for turned off lights (#20750) 2019-02-18 21:01:26 -08:00
Paulus Schoutsen
d1ebe2cbac Updated frontend to 20190218.0 2019-02-18 13:25:43 -08:00
Paulus Schoutsen
d2fea76fd7 Add context to service call event (#21181) 2019-02-18 13:07:44 -08:00
sjabby
463c4ae5c9 Fix for #19072 (#21175)
* Fix for #19072

PR #19072 introduced the custom_effect feature but it didnt make it optional as the documentation states.
This causes error on startup and the component does not work.
```
Error while setting up platform flux_led
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/flux_led.py", line 135, in setup_platform
    device[CONF_CUSTOM_EFFECT] = device_config[CONF_CUSTOM_EFFECT]
KeyError: 'custom_effect'
```

Changing this line to make the custom_effect optional as the original intention.

* Update flux_led.py
2019-02-18 13:05:46 -08:00
Paulus Schoutsen
600070af3a Make sure that device trackers is always a list during creation (#21193) 2019-02-18 13:04:04 -08:00
Robert Svensson
9ce8f4737d deCONZ thermostat support (#20586)
* Add support for thermostats in deCONZ by adding Climate platform
2019-02-18 17:43:22 +01:00
David F. Mulcahey
3f9e6a7064 Add power source to device and clean up zha listeners (#21174)
check available and add comments

ensure order on API test
2019-02-18 16:55:41 +01:00
Martin Hjelmare
0ab9b006f0 Clean up upc_connect tests (#21150) 2019-02-18 08:58:25 -06:00
Mattias Welponer
0b77a89a2f Fix HomematicIP Cloud fix cover position property (#21154) 2019-02-18 08:54:23 -06:00
Fabian Affolter
4d410bf5b9 Upgrade psutil to 5.5.1 (#21171) 2019-02-18 15:51:21 +01:00
John Mihalic
1afbc22ad5 Update pyEight for Python 3.7 Compatability (#21161) 2019-02-18 11:20:31 +01:00
Fabian Affolter
6cdc5a5c2d Upgrade sqlalchemy to 1.2.18 (#21162) 2019-02-18 11:19:40 +01:00
Fabian Affolter
7e855d5b48 Upgrade youtube_dl to 2019.02.18 (#21164) 2019-02-18 11:19:21 +01:00
Fabian Affolter
2b86fc3841 Upgrade voluptuous-serialize to 2.1.0 (#21166) 2019-02-18 11:18:40 +01:00
Diogo Gomes
3b5ed7a20f Fix track_change error in utility_meter (#21134)
* split validation

* remove any()
2019-02-17 20:40:51 -08:00
CV
ce7f678b9b RSSI_PEER and RSSI_DEVICE are different things (fixes #20900) (#20902)
* Fix #20900: RSSI_PEER and RSSI_DEVICE are different things

This change is fixing issue #20900.

Wireless actors are having two RSSI values. The way the component was programmed one of them was overwritten.

* Added deprecation comment

* Fixed long line

* Fix: pylint comment

* Lint

* flake8

* flake8 again

* Update __init__.py
2019-02-17 20:53:57 -06:00
lapy
425b9851fc Add traccar monitored_conditions option (#21149)
* Add traccar monitored_conditions option

User defined additional parameters to track from the traccar platform

* Version bump for pytraccar client

* Update traccar.py

* Remove default value

* Update homeassistant/components/device_tracker/traccar.py

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

* Update traccar.py
2019-02-17 23:38:04 +01:00
ktnrg45
72ef9670e6 Add component media player.ps4 (#21074)
* Added PS4/ __init__.py

* Create en.json

* Create config_flow.py

* Create const.py

* Create media_player.py

* Create services.yaml

* Create strings.json

* Create __init__.py

* Add test_config_flow.py/ Finished adding PS4 files

* Rewrote for loop into short-hand

* bumped pyps4 to 0.2.8

* Pass in helper()

* Rewrite func

* Fixed test

* Added import in init

* bump to 0.2.9

* bump to 0.3.0

* Removed line

* lint

* Add ps4 to flows list

* Added pyps4-homeassistant with script

* Added pyps4

* Added pypys4 to test

* removed list def

* reformatted service call dicts

* removed config from device class

* typo

* removed line

* reformatted .. format

* redefined property

* reformat load games func

* Add __init__ and media_player.py to coveragerc

* Fix for test

* remove init

* remove blank line

* remove mock_coro

* Revert "remove init"

This reverts commit b68996aa34699bf38781e153acdd597579e8131f.

* Correct permissions

* fixes

* fixes
2019-02-17 15:41:55 -05:00
lapy
4e7cfc923d Add traccar scan_interval configuration option (#21079)
* Added scan_interval configuration option

* Fixed trailing whitespace and indentation

* Update traccar.py

* Update homeassistant/components/device_tracker/traccar.py

Co-Authored-By: lapy <lapy@users.noreply.github.com>
2019-02-17 17:55:06 +01:00
Robert Svensson
9251860201 Logging to find what deCONZ events get created (#20551)
* Helpful logging to easily find what events get created
2019-02-17 16:58:46 +01:00
Daniel Perna
847711ddc9 Add webhook support for Netatmo Cameras (#20755)
Add webhook support for Netatmo Cameras
2019-02-17 12:31:47 +01:00
René-Marc Simard
33b8dbe73a Return None if no GTFS departures found (#20919) 2019-02-17 11:46:08 +01:00
msvinth
df598544d6 Make Netatmo able to discover both Weather station and Health Coach (#20274)
* Resolve conflicts and review comments

* Corretly handle HomeCoach in manual setup

* Fix code reivew comments

* Move import back int methods

* Formatting fix

* Lint fix
2019-02-17 11:45:58 +01:00
Ville Skyttä
816364bfd9 Upgrade pytest to 4.2.1 (#21112)
* Upgrade pytest to 4.2.0

* Upgrade pytest to 4.2.1

* Make litejet switch test work with pytest 4.2
2019-02-17 09:55:33 +01:00
Jason Hu
2155a861cd Remove outdated url pattern match support for static file hosting (#21109) 2019-02-16 23:06:42 -08:00
Paulus Schoutsen
f1b84962ed Add legacy PLATFORM_SCHEMA config validation (#21072)
* Add legacy PLATFORM_SCHEMA config validation

* Fix tests

* Lint

* Add persistent notification

* Update bootstrap.py
2019-02-16 23:05:06 -08:00
cdce8p
9125e49628 Fix battery_level error - HomeKit (#21120) 2019-02-16 23:04:29 -08:00
Markus Jankowski
8c5763624c Add Groups to Homematic IP (#21076)
* Added HmIP-Groups

* Fix imports

* Removed config options from conflig_flow

* fix tests

* Removed config options

* reverted smaller code changes

* changes after review

* minor fix

* Fixed comments
2019-02-17 06:24:13 +01:00
Rohan Kapoor
481439d387 Deprecate conf_update_interval (#20924)
* Deprecate update_interval and replace with scan_interval

* Update tests

* Fix Darksky tests

* Fix Darksky tests correctly

This reverts commit a73384a223ba8a93c682042d9351cd5a7a399183.

* Provide the default for the non deprecated option

* Don't override default schema for sensors
2019-02-17 06:23:09 +01:00
Matthew Garrett
ad9ec2190c Merge pull request #21133 from mjg59/eufy
Update Lakeside dependency in Eufy component
2019-02-16 20:59:20 -08:00
Diogo Gomes
9cab597bc4 Don't expose services in Utility_Meter unless tariffs are available (#20878)
* only expose services when tariffs configured

* don't register services multiple times
2019-02-16 20:04:56 -08:00
Paulus Schoutsen
9c92880b5a Handle ValueError (#21126) 2019-02-16 19:38:52 -08:00
Paulus Schoutsen
ea592a003b Bump pychromecast to 2.5.2 (#21127) 2019-02-16 20:48:43 -05:00
Matthew Garrett
451241b481 Update Lakeside dependency in Eufy component
This should fix #16834
2019-02-16 15:43:30 -08:00
Paulus Schoutsen
66267474dc Updated frontend to 20190216.0 2019-02-16 12:00:04 -08:00
Fabian Affolter
1a6c79d5e2 Order imports (#21117) 2019-02-16 17:03:08 +01:00
Otto Winter
a49686879d Update bootstrap.py 2019-02-16 14:51:30 +01:00
Nick Horvath
f7d9031486 Bump thermoworks_smoke version to get new pyrebase version (#21100) 2019-02-16 11:18:13 +01:00
Andrew Sayre
b39b66ef65 Fix SmartThings Translation Error (#21103) 2019-02-16 10:49:24 +01:00
Matt Snyder
4c23ccad98 Owlet baby monitor component (#21108) 2019-02-16 10:12:16 +01:00
David Barrera
4509caefde Add index parameter to scrape sensor (#21084)
* Add index parameter to scrape sensor

The scrape sensor selects the first element of the list returned by
BeautifulSoup. This commit adds an optional index parameter to allow the
selection of a different element from the list of results. To make this
a non-breaking change, if no index value is configured, the sensor
defaults to the previous behaviour of returning the first element.

* Set default value for index to avoid later checks
2019-02-16 09:29:24 +01:00
Aaron Bach
539d24dd60 Bump aioambient to 0.1.2 (#21098) 2019-02-15 10:28:23 -08:00
Phil Hawthorne
9203ae201f Set uvloop version consistent with hass.io (#21080)
This sets the uvloop version in Docker containers to 0.11.3, which is the
same version that hass.io uses.

uvloop might be causing issues with some Docker containers on some host
systems, as reported in #20829
2019-02-15 10:25:03 -08:00
David F. Mulcahey
3a6a246746 Set ZHA device availability on new join (#21066)
* set availability on device join

* fix new join test
2019-02-15 13:14:58 -05:00
Paulus Schoutsen
f7a6027466 Updated frontend to 20190215.0 2019-02-15 10:09:09 -08:00
Paulus Schoutsen
05808afe75 Update pychromecast (#21097) 2019-02-15 09:46:03 -08:00
Otto Winter
06f2aa93a4 Add persistent notification 2019-02-15 18:40:46 +01:00
Jason Hu
46efc0eafb Refactor http CachingStaticResource (#21062)
* Simplify http.CachingStaticResource implementation

* Sync up CachingStaticResource._handle() implementation from aiohttp

* Ignore pylint duplicate-base warning

* Try to disable pylint for http/static.py

Caused by https://github.com/PyCQA/astroid/issues/633#issuecomment-463879288

* Remove pylint ignore

* Ignore pylint duplicate-base warning
2019-02-15 09:31:54 -08:00
Andrew Sayre
383813bfe6 Config Entry migrations (#20888)
* Updated per review feedback.

* Fixed line length

* Review comments and lint error

* Fixed mypy typeing error

* Moved migration logic to setup

* Use new migration error state

* Fix bug and ignore mypy type error

* Removed SmartThings example and added unit tests.

* Fixed test comments.
2019-02-15 09:30:47 -08:00
Paulus Schoutsen
1130ccb325 Fix hue retry crash (#21083)
* Fix Hue retry crash

* Fix hue retry crash

* Fix tests
2019-02-15 08:43:30 -08:00
Andrew Sayre
93f84a5cd1 SmartThings Component Enhancements/Fixes (#21085)
* Improve component setup error logging/notification

* Prevent capabilities from being represented my multiple platforms

* Improved logging of received updates

* Updates based on review feedback
2019-02-15 17:40:54 +01:00
Jonas Pedersen
7d0f847f83 Add switch platform for Danfoss Air and additional sensors. (#21046)
* Add switch platform for Danfoss Air and additional sensors.

* Solve lint issues.

* Correct style.

* Minor changes

* Minor changes

* Minor changes

* Update file header

* Remove space

* Remove space
2019-02-15 14:54:25 +01:00
Phil Cole
656d39e3ec Nissan Leaf Integration (Carwings / NissanConnect EV) (#19786)
* Added work so far.

* Change interval so nobody drains their battery when I put this online

* Added the warning notice.

* Async setup

* Still broken, but we're getting there.

* Back to synchronous, moved refresh stuff into DataStore

* Functional sensors!

* Added working switches, tweaked intervals a bit

* Fixed turn off result

* Moved plug status to binary_sensor, added smart intervals

* Documentation and car nickname stuff

* Syntax fixes and coveragerc additions

* Style fixes

* Fixing the final line length

* Fixed an issue with newer models and bad climate data

* Forgot to check my line endings.

* New icons for most of the components

* Hotfix for handling Nissan's awful servers

* Merge in fixes made by Phil Cole

Remove invalid FIXMEs and update TODOs
Fixes for pylint and test for CarwingsError exception rather than Exception
Flake8 fixes
Add pycarwings2 to requirements_all.txt
Add extra configuration documentation.
Use pycarwings2 from pip. Check server dates between requests.
Add sensor device class for battery.
Async conversion fixes
flake8 fixes and docstrings
Non-async charging is OK
Handle multiple cars in the configuration
Convert to async. Better imports for platforms
Fix scanning interval & prevent extra refreshes.  async switchover
Check discovery_info to prevent load of platforms
Ensure update frequency is always above a minimum interval (1 min).
Platforms don't have return values
Use values() instead of items() when not using key
Use snake_case (LeafCore becomes leaf_core)

commit 418b6bbcc49cf2909aac85869440435410abf3fd

* Add pycarwings2 to requirements_all.txt

* Make stopping charge error an 'info'. Remove TODO.

* Request update from car after sending start charging command.

* Delay initial (slow) update for 15 seconds and make async

* Flake8 line length fixes

* Try to fix D401 'imperative mood' git diff tox errors

* Try to fix more D401 'imperative mood' tox errors

* Default interval of an hour in code, to match comments.

* Update to pycarwings2 2.3

* Update to pycarwings2 2.3 in requirements_all.txt

* Remove documentation, instead refering to home-assistant.io

* Remove unneeded dispatcher_send()

* Remove unneeded requirements comments

* Combine excess debugging.

* Remove single line method signal_components()

* Bump to version 2.4 of pycarwings2

* Remove unused dispatcher_send

* Simplify logging of LeafEntity registration

* Update requirements_all.txt

* Multiple changes

Increase timeout to 30 seconds
Only consider battery_status
Fix plugged in status
Better attempts at try/exception handling

* Fix line length

* Use pycarwings 2.5

* Remove pointless 'is True'

* Remove unnecessary 'is True/False'

* Remove unnecessary 'is True/False'

* Use LENGTH_MILES and LENGTH_KILOMETERS

* Remove excess logging in setup_platform()

* Remove unnecessary 'is True'

* Use pycarwings2 version 2.6

* Require pycarwings2 version 2.7.

* Increase sleep delay for climate and location reponses.

* Remove unnecessary 'is True'

* Increase frequent polling warning to _LOGGER.warning()

* Use DEVICE_CLASS_BATTERY

* Remove extraneous 'is True'.

* Move icon strings to constants.

* Remove unneeded key.

* LeafRangeSensor ac_on property is internal.

* Flake8 missing line

* Remove homebridge attributes.

* Remove round battery % and range to whole numbers

* Use pycarwings2 2.8

* Move to embedded component model

* Reduce maximum attempts to 10 (5 mins)

* Include attempt count in 'waiting' log message

* Use await instead of yield. Remove @asyncio.coroutine decorators.

* Add @filcole as nissan_leaf codeowner

* Fix checking for if not data returned from vehicle. Don't double send signal on location update.

* Exposed updated_on, update_in_progress and next_update attributes.

* Add nissan_leaf.update service that triggers an update.

* Flake8 line fixes

* Remove excess and double logging.

* Add updated_on attribute for device tracker.

* Fix crash if pycarwings2 doesn't provide cruising ranges.

* Minor changes

* Minor changes

* Minor changes

* Minor changes

* Minor changes
2019-02-15 14:35:25 +01:00
Klaudiusz Staniek
7b19428279 Times of The Day Binary Sensor (#20068)
* First commit

* Times of the Day binary sensor added

* Python 3.5 fixes and logging removed

* Code refactored according to reviewer's suggestions

* Fixed config template with friendly name support

* Finall pep8 fixes

* Removed async_generate_entity_id and moved initial calculation to async_added_to_hass

* Change the configuration schema to follow the current requirements

* Update according latest suggestsion

* Fix typos and minor changes

* Fix lint issue
2019-02-15 14:13:44 +01:00
Fredrik Erlandsson
f3786e2f2b Point alarm control (#20972)
* initial working example of alarm_control

* fixes for alarm_control

* arm home is the same as arm away

* updated documentation

* final fixes

* pypoint version up

* fixes for Martin
2019-02-15 12:19:42 +01:00
Eliran Turgeman
b44ff38f5a Fix "Unable to find entity" at Waze component (#21087)
Should fix https://github.com/home-assistant/home-assistant/issues/20953 
(Unable to create this issue on my HA platform)
2019-02-15 11:48:27 +01:00
Fabian Affolter
eb573c2701 Meteo france (#21065)
* Move files

* Move file

* Update .coveragerc

* Sort import and update file header

* Minor changes
2019-02-15 10:57:47 +01:00
Otto Winter
f6ae054e9f Lint 2019-02-15 10:57:02 +01:00
Otto Winter
b7607ff472 Fix tests 2019-02-15 10:51:52 +01:00
John Mihalic
c115c89afd Bump pyHik library to 0.2.2, improve connections, add sensors (#21086) 2019-02-15 07:18:12 +01:00
Paulus Schoutsen
12c18d63fd Fix pushover schema (#21073) 2019-02-14 15:54:48 -08:00
Paulus Schoutsen
ab7fda4286 Check against unlinked user (#21081) 2019-02-14 15:54:38 -08:00
Fabian Affolter
cdc4dc3f11 Rename CONF_ATTRIBUTION to ATTRIBUTION (#21069)
* Rename CONF_ATTRIBUTION to ATTRIBUTION

* Update homeassistant/components/sensor/irish_rail_transport.py

Co-Authored-By: fabaff <mail@fabian-affolter.ch>
2019-02-14 22:09:22 +01:00
Paulus Schoutsen
d60934c028 Fix pushover schema 2019-02-14 12:06:25 -08:00
Otto Winter
9c09a98c9e Add legacy PLATFORM_SCHEMA config validation 2019-02-14 20:55:51 +01:00
Fabian Affolter
03ec3ac16e Update file header (#21067) 2019-02-14 20:35:47 +01:00
Joakim Plate
c5de32e7b1 Climate const.py move (#20945)
* Move constants to const.py

* Import from const instead of climate
2019-02-14 20:34:43 +01:00
Fabian Affolter
dc62cb6a88 Update file header 2019-02-14 16:42:03 +01:00
Fabian Affolter
3736120c6a Update file header (#21061)
* Update file header

* Fix lint issue

* Fix lint issue
2019-02-14 16:01:46 +01:00
Victor Cerutti
f4b2573c4b Météo-France platform for the weather component (#18404)
* new weather component for meteofrance

* linting

* upgrade meteofrance package version

* Update .coveragerc

* Remove updates to the weather component architecture

* Rewrite Météo-France as a component

* Update .coveragerc

* Update requirements_all.txt

* remove Weather Card option

* Update conf name

Changing conf name to something more universal for worldwide weather forecast (postal code was only relevent for France)

* Update meteofrance pypi package

* fix line too long

* Update requirements_all.txt

* prevent from calling an API endpoint if not in monitored conditions

* fix stale url and remove blank line

* Insure that all cities are unique

* rename CONF_ATTRIBUTION

* Updating data from component setup

* fix missing extra lines
2019-02-14 14:40:27 +01:00
Paulus Schoutsen
801401e9cb Bumped version to 0.89.0.dev0 2019-02-13 20:47:04 -08:00
2930 changed files with 48570 additions and 17542 deletions

262
.circleci/config.yml Normal file
View File

@@ -0,0 +1,262 @@
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
#
version: 2.1
executors:
python:
parameters:
tag:
type: string
default: latest
docker:
- image: circleci/python:<< parameters.tag >>
- image: circleci/buildpack-deps:stretch
working_directory: ~/repo
commands:
docker-prereqs:
description: Set up docker prerequisite requirement
steps:
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends
libudev-dev libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev
libswscale-dev libswresample-dev libavfilter-dev
install-requirements:
description: Set up venv and install requirements python packages with cache support
parameters:
python:
type: string
default: latest
all:
description: pip install -r requirements_all.txt
type: boolean
default: false
test:
description: pip install -r requirements_test.txt
type: boolean
default: false
test_all:
description: pip install -r requirements_test_all.txt
type: boolean
default: false
steps:
- restore_cache:
keys:
- v1-<< parameters.python >>-{{ checksum "homeassistant/package_constraints.txt" }}-<<# parameters.all >>{{ checksum "requirements_all.txt" }}<</ parameters.all>>-<<# parameters.test >>{{ checksum "requirements_test.txt" }}<</ parameters.test>>-<<# parameters.test_all >>{{ checksum "requirements_test_all.txt" }}<</ parameters.test_all>>
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -q -U pip
pip install -q -U setuptools
<<# parameters.all >>pip install -q --progress-bar off -r requirements_all.txt -c homeassistant/package_constraints.txt<</ parameters.all>>
<<# parameters.test >>pip install -q --progress-bar off -r requirements_test.txt -c homeassistant/package_constraints.txt<</ parameters.test>>
<<# parameters.test_all >>pip install -q --progress-bar off -r requirements_test_all.txt -c homeassistant/package_constraints.txt<</ parameters.test_all>>
- save_cache:
paths:
- ./venv
key: v1-<< parameters.python >>-{{ checksum "homeassistant/package_constraints.txt" }}-<<# parameters.all >>{{ checksum "requirements_all.txt" }}<</ parameters.all>>-<<# parameters.test >>{{ checksum "requirements_test.txt" }}<</ parameters.test>>-<<# parameters.test_all >>{{ checksum "requirements_test_all.txt" }}<</ parameters.test_all>>
install:
description: Install Home Assistant
steps:
- run:
name: install
command: |
. venv/bin/activate
pip install -q --progress-bar off -e .
jobs:
static-check:
executor:
name: python
tag: 3.5.5-stretch
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
test: true
- run:
name: run static check
command: |
. venv/bin/activate
flake8
- run:
name: run static type check
command: |
. venv/bin/activate
TYPING_FILES=$(cat mypyrc)
mypy $TYPING_FILES
- install
- run:
name: run gen_requirements_all
command: |
. venv/bin/activate
python script/gen_requirements_all.py validate
pre-install-all-requirements:
executor:
name: python
tag: 3.5.5-stretch
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
all: true
test: true
pylint:
executor:
name: python
tag: 3.5.5-stretch
parallelism: 2
steps:
- checkout
- docker-prereqs
- install-requirements:
python: 3.5.5-stretch
all: true
test: true
- install
- run:
name: run pylint
command: |
. venv/bin/activate
PYFILES=$(circleci tests glob "homeassistant/**/*.py" | circleci tests split)
pylint ${PYFILES}
pre-test:
parameters:
python:
type: string
executor:
name: python
tag: << parameters.python >>
steps:
- checkout
- docker-prereqs
- install-requirements:
python: << parameters.python >>
test_all: true
test:
parameters:
python:
type: string
executor:
name: python
tag: << parameters.python >>
parallelism: 2
steps:
- checkout
- docker-prereqs
- install-requirements:
python: << parameters.python >>
test_all: true
- install
- run:
name: run tests
command: |
. venv/bin/activate
TESTFILES=$(circleci tests glob "tests/**/test_*.py" | circleci tests split --split-by=timings)
if [ -z "$CODE_COVERAGE" ]; then CC_SWITCH=""; else CC_SWITCH="--cov --cov-report html:htmlcov"; fi
pytest --timeout=9 --duration=10 --junitxml=test-reports/homeassistant/results.xml -qq -o junit_family=xunit2 -o junit_suite_name=homeassistant -o console_output_style=count -p no:sugar $CC_SWITCH -- ${TESTFILES}
script/check_dirty
- store_test_results:
path: test-reports
- store_artifacts:
path: htmlcov
destination: cov-reports
- store_artifacts:
path: test-reports
destination: test-reports
# This job use machine executor, e.g. classic CircleCI VM because we need both lokalise-cli and a Python runtime.
# Classic CircleCI included python 2.7.12 and python 3.5.2 managed by pyenv, the Python version may need change if
# CircleCI changed its VM in future.
upload-translations:
machine: true
steps:
- checkout
- run:
name: upload english translations
command: |
pyenv versions
pyenv global 3.5.2
docker pull lokalise/lokalise-cli@sha256:2198814ebddfda56ee041a4b427521757dd57f75415ea9693696a64c550cef21
script/translations_upload
workflows:
version: 2
build:
jobs:
- static-check
- pre-install-all-requirements:
requires:
- static-check
- pylint:
requires:
- pre-install-all-requirements
- pre-test:
name: pre-test 3.5.5
requires:
- static-check
python: 3.5.5-stretch
- pre-test:
name: pre-test 3.6
requires:
- static-check
python: 3.6-stretch
- pre-test:
name: pre-test 3.7
requires:
- static-check
python: 3.7-stretch
- test:
name: test 3.5.5
requires:
- pre-test 3.5.5
python: 3.5.5-stretch
- test:
name: test 3.6
requires:
- pre-test 3.6
python: 3.6-stretch
- test:
name: test 3.7
requires:
- pre-test 3.7
python: 3.7-stretch
# CircleCI does not allow failure yet
# - test:
# name: test 3.8
# python: 3.8-rc-stretch
- upload-translations:
requires:
- static-check
filters:
branches:
only: dev

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,7 @@
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for components if you are using custom components: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!

View File

@@ -8,6 +8,7 @@ about: Create a report to help us improve
- If you need additional help with this template please refer to https://www.home-assistant.io/help/reporting_issues/
- Make sure you are running the latest version of Home Assistant before reporting an issue: https://github.com/home-assistant/home-assistant/releases
- Frontend issues should be submitted to the home-assistant-polymer repository: https://github.com/home-assistant/home-assistant-polymer/issues
- iOS issues should be submitted to the home-assistant-iOS repository: https://github.com/home-assistant/home-assistant-iOS/issues
- Do not report issues for components if you are using custom components: files in <config-dir>/custom_components
- This is for bugs only. Feature and enhancement requests should go in our community forum: https://community.home-assistant.io/c/feature-requests
- Provide as many details as possible. Paste logs, configuration sample and code into the backticks. Do not delete any text from this template!

View File

@@ -1,3 +1,7 @@
## Breaking Change:
<!-- What is breaking and why we have to break it. Remove this section only if it was NOT a breaking change. -->
## Description:

41
.github/main.workflow vendored Normal file
View File

@@ -0,0 +1,41 @@
workflow "Python 3.7 - tox" {
resolves = ["Python 3.7 - tests"]
on = "push"
}
action "Python 3.7 - tests" {
uses = "home-assistant/actions/py37-tox@master"
args = "-e py37"
}
workflow "Python 3.6 - tox" {
resolves = ["Python 3.6 - tests"]
on = "push"
}
action "Python 3.6 - tests" {
uses = "home-assistant/actions/py36-tox@master"
args = "-e py36"
}
workflow "Python 3.5 - tox" {
resolves = ["Pyton 3.5 - typing"]
on = "push"
}
action "Python 3.5 - tests" {
uses = "home-assistant/actions/py35-tox@master"
args = "-e py35"
}
action "Python 3.5 - lints" {
uses = "home-assistant/actions/py35-tox@master"
needs = ["Python 3.5 - tests"]
args = "-e lint"
}
action "Pyton 3.5 - typing" {
uses = "home-assistant/actions/py35-tox@master"
args = "-e typing"
needs = ["Python 3.5 - lints"]
}

1
.gitignore vendored
View File

@@ -55,6 +55,7 @@ pip-log.txt
.tox
nosetests.xml
htmlcov/
test-reports/
# Translations
*.mo

View File

@@ -1,8 +1,18 @@
sudo: false
dist: xenial
addons:
apt:
sources:
- sourceline: "ppa:jonathonf/ffmpeg-4"
packages:
- libudev-dev
- libavformat-dev
- libavcodec-dev
- libavdevice-dev
- libavutil-dev
- libswscale-dev
- libswresample-dev
- libavfilter-dev
matrix:
fast_finish: true
include:
@@ -19,22 +29,19 @@ matrix:
env: TOXENV=py36
- python: "3.7"
env: TOXENV=py37
dist: xenial
- python: "3.8-dev"
env: TOXENV=py38
dist: xenial
if: branch = dev AND type = push
allow_failures:
- python: "3.8-dev"
env: TOXENV=py38
dist: xenial
cache:
directories:
- $HOME/.cache/pip
install: pip install -U tox coveralls
language: python
script: travis_wait 30 tox --develop
script: travis_wait 40 tox --develop
services:
- docker
before_deploy:

View File

@@ -18,7 +18,7 @@ homeassistant/components/frontend/* @home-assistant/core
homeassistant/components/group/* @home-assistant/core
homeassistant/components/history/* @home-assistant/core
homeassistant/components/http/* @home-assistant/core
homeassistant/components/input_*.py @home-assistant/core
homeassistant/components/input_*/* @home-assistant/core
homeassistant/components/introduction/* @home-assistant/core
homeassistant/components/logger/* @home-assistant/core
homeassistant/components/lovelace/* @home-assistant/core
@@ -28,7 +28,7 @@ homeassistant/components/panel_iframe/* @home-assistant/core
homeassistant/components/onboarding/* @home-assistant/core
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/scene/__init__.py @home-assistant/core
homeassistant/components/scene/hass.py @home-assistant/core
homeassistant/components/scene/homeassistant.py @home-assistant/core
homeassistant/components/script/* @home-assistant/core
homeassistant/components/shell_command/* @home-assistant/core
homeassistant/components/sun/* @home-assistant/core
@@ -47,238 +47,244 @@ homeassistant/components/*/zwave.py @home-assistant/z-wave
homeassistant/components/hassio/* @home-assistant/hassio
# Individual platforms
homeassistant/components/alarm_control_panel/egardia.py @jeroenterheerdt
homeassistant/components/alarm_control_panel/manual_mqtt.py @colinodell
homeassistant/components/binary_sensor/hikvision.py @mezz64
homeassistant/components/binary_sensor/threshold.py @fabaff
homeassistant/components/binary_sensor/uptimerobot.py @ludeeus
homeassistant/components/camera/yi.py @bachya
homeassistant/components/climate/coolmaster.py @OnFreund
homeassistant/components/climate/ephember.py @ttroy50
homeassistant/components/climate/eq3btsmart.py @rytilahti
homeassistant/components/climate/mill.py @danielhiversen
homeassistant/components/climate/sensibo.py @andrey-git
homeassistant/components/cover/brunt.py @eavanvalkenburg
homeassistant/components/cover/group.py @cdce8p
homeassistant/components/cover/template.py @PhracturedBlue
homeassistant/components/device_tracker/asuswrt.py @kennedyshead
homeassistant/components/device_tracker/automatic.py @armills
homeassistant/components/device_tracker/huawei_router.py @abmantis
homeassistant/components/device_tracker/quantum_gateway.py @cisasteelersfan
homeassistant/components/device_tracker/tile.py @bachya
homeassistant/components/device_tracker/traccar.py @ludeeus
homeassistant/components/device_tracker/bt_smarthub.py @jxwolstenholme
homeassistant/components/history_graph/* @andrey-git
homeassistant/components/influx/* @fabaff
homeassistant/components/light/lifx_legacy.py @amelchio
homeassistant/components/light/tplink.py @rytilahti
homeassistant/components/light/yeelight.py @rytilahti
homeassistant/components/light/yeelightsunflower.py @lindsaymarkward
homeassistant/components/lock/nello.py @pschmitt
homeassistant/components/lock/nuki.py @pschmitt
homeassistant/components/media_player/emby.py @mezz64
homeassistant/components/media_player/kodi.py @armills
homeassistant/components/media_player/liveboxplaytv.py @pschmitt
homeassistant/components/media_player/mediaroom.py @dgomes
homeassistant/components/media_player/monoprice.py @etsinko
homeassistant/components/media_player/mpd.py @fabaff
homeassistant/components/media_player/sonos.py @amelchio
homeassistant/components/media_player/xiaomi_tv.py @fattdev
homeassistant/components/media_player/yamaha_musiccast.py @jalmeroth
homeassistant/components/no_ip/* @fabaff
homeassistant/components/notify/aws_lambda.py @robbiet480
homeassistant/components/notify/aws_sns.py @robbiet480
homeassistant/components/notify/aws_sqs.py @robbiet480
homeassistant/components/notify/file.py @fabaff
homeassistant/components/notify/flock.py @fabaff
homeassistant/components/notify/instapush.py @fabaff
homeassistant/components/notify/gntp.py @robbiet480
homeassistant/components/notify/html5.py @robbiet480
homeassistant/components/notify/mastodon.py @fabaff
homeassistant/components/notify/smtp.py @fabaff
homeassistant/components/notify/syslog.py @fabaff
homeassistant/components/notify/twilio_call.py @robbiet480
homeassistant/components/notify/twilio_sms.py @robbiet480
homeassistant/components/notify/xmpp.py @fabaff
homeassistant/components/notify/yessssms.py @flowolf
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/remote/harmony.py @ehendrix23
homeassistant/components/scene/lifx_cloud.py @amelchio
homeassistant/components/sensor/airvisual.py @bachya
homeassistant/components/sensor/alpha_vantage.py @fabaff
homeassistant/components/sensor/bitcoin.py @fabaff
homeassistant/components/sensor/cpuspeed.py @fabaff
homeassistant/components/sensor/cups.py @fabaff
homeassistant/components/sensor/darksky.py @fabaff
homeassistant/components/sensor/file.py @fabaff
homeassistant/components/sensor/filter.py @dgomes
homeassistant/components/sensor/fixer.py @fabaff
homeassistant/components/sensor/flunearyou.py.py @bachya
homeassistant/components/sensor/gearbest.py @HerrHofrat
homeassistant/components/sensor/gitter.py @fabaff
homeassistant/components/sensor/glances.py @fabaff
homeassistant/components/sensor/gpsd.py @fabaff
homeassistant/components/sensor/irish_rail_transport.py @ttroy50
homeassistant/components/sensor/jewish_calendar.py @tsvi
homeassistant/components/sensor/launch_library.py @ludeeus
homeassistant/components/sensor/linux_battery.py @fabaff
homeassistant/components/sensor/miflora.py @danielhiversen @ChristianKuehnel
homeassistant/components/sensor/min_max.py @fabaff
homeassistant/components/sensor/moon.py @fabaff
homeassistant/components/sensor/netdata.py @fabaff
homeassistant/components/sensor/nsw_fuel_station.py @nickw444
homeassistant/components/sensor/pi_hole.py @fabaff
homeassistant/components/sensor/pollen.py @bachya
homeassistant/components/sensor/pvoutput.py @fabaff
homeassistant/components/sensor/qnap.py @colinodell
homeassistant/components/sensor/ruter.py @ludeeus
homeassistant/components/sensor/scrape.py @fabaff
homeassistant/components/sensor/serial.py @fabaff
homeassistant/components/sensor/seventeentrack.py @bachya
homeassistant/components/sensor/shodan.py @fabaff
homeassistant/components/sensor/sma.py @kellerza
homeassistant/components/sensor/sql.py @dgomes
homeassistant/components/sensor/statistics.py @fabaff
homeassistant/components/sensor/swiss*.py @fabaff
homeassistant/components/sensor/sytadin.py @gautric
homeassistant/components/sensor/tautulli.py @ludeeus
homeassistant/components/sensor/time_data.py @fabaff
homeassistant/components/sensor/version.py @fabaff
homeassistant/components/sensor/waqi.py @andrey-git
homeassistant/components/sensor/worldclock.py @fabaff
homeassistant/components/shiftr/* @fabaff
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/switch/switchbot.py @danielhiversen
homeassistant/components/switch/switchmate.py @danielhiversen
homeassistant/components/switch/tplink.py @rytilahti
homeassistant/components/vacuum/roomba.py @pschmitt
homeassistant/components/weather/__init__.py @fabaff
homeassistant/components/weather/darksky.py @fabaff
homeassistant/components/weather/demo.py @fabaff
homeassistant/components/weather/met.py @danielhiversen
homeassistant/components/weather/openweathermap.py @fabaff
homeassistant/components/xiaomi_aqara/* @danielhiversen @syssi
homeassistant/components/tts/amazon_polly.py @robbiet480
# A
homeassistant/components/airvisual/sensor.py @bachya
homeassistant/components/alarm_control_panel/manual_mqtt.py @colinodell
homeassistant/components/alpha_vantage/sensor.py @fabaff
homeassistant/components/ambient_station/* @bachya
homeassistant/components/arduino/* @fabaff
homeassistant/components/*/arduino.py @fabaff
homeassistant/components/*/arest.py @fabaff
homeassistant/components/*/axis.py @kane610
homeassistant/components/arest/* @fabaff
homeassistant/components/asuswrt/device_tracker.py @kennedyshead
homeassistant/components/automatic/device_tracker.py @armills
homeassistant/components/axis/* @kane610
# B
homeassistant/components/bitcoin/sensor.py @fabaff
homeassistant/components/blink/* @fronzbot
homeassistant/components/*/blink.py @fronzbot
homeassistant/components/bmw_connected_drive/* @ChristianKuehnel
homeassistant/components/*/bmw_connected_drive.py @ChristianKuehnel
homeassistant/components/*/broadlink.py @danielhiversen
homeassistant/components/braviatv/media_player.py @robbiet480
homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/brunt/cover.py @eavanvalkenburg
homeassistant/components/bt_smarthub/device_tracker.py @jxwolstenholme
# C
homeassistant/components/cloudflare/* @ludeeus
homeassistant/components/coolmaster/climate.py @OnFreund
homeassistant/components/counter/* @fabaff
homeassistant/components/cover/group.py @cdce8p
homeassistant/components/cpuspeed/sensor.py @fabaff
homeassistant/components/cups/sensor.py @fabaff
# D
homeassistant/components/daikin/* @fredrike @rofrantz
homeassistant/components/*/daikin.py @fredrike @rofrantz
homeassistant/components/*/deconz.py @kane610
homeassistant/components/darksky/* @fabaff
homeassistant/components/discogs/sensor.py @thibmaek
homeassistant/components/deconz/* @kane610
homeassistant/components/demo/weather.py @fabaff
homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/*/digital_ocean.py @fabaff
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dweet/* @fabaff
homeassistant/components/*/dweet.py @fabaff
# E
homeassistant/components/ecovacs/* @OverloadUT
homeassistant/components/*/ecovacs.py @OverloadUT
homeassistant/components/*/edp_redy.py @abmantis
homeassistant/components/edp_redy/* @abmantis
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/*/eight_sleep.py @mezz64
homeassistant/components/esphome/*.py @OttoWinter
homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/emby/media_player.py @mezz64
homeassistant/components/ephember/climate.py @ttroy50
homeassistant/components/eq3btsmart/climate.py @rytilahti
homeassistant/components/esphome/* @OttoWinter
# F
homeassistant/components/file/sensor.py @fabaff
homeassistant/components/filter/sensor.py @dgomes
homeassistant/components/fitbit/sensor.py @robbiet480
homeassistant/components/fixer/sensor.py @fabaff
homeassistant/components/flunearyou/sensor.py @bachya
homeassistant/components/foursquare/* @robbiet480
homeassistant/components/freebox/* @snoof85
# G
homeassistant/components/gearbest/sensor.py @HerrHofrat
homeassistant/components/gitter/sensor.py @fabaff
homeassistant/components/glances/sensor.py @fabaff
homeassistant/components/google_travel_time/sensor.py @robbiet480
homeassistant/components/googlehome/* @ludeeus
homeassistant/components/*/googlehome.py @ludeeus
homeassistant/components/gpsd/sensor.py @fabaff
homeassistant/components/gtfs/sensor.py @robbiet480
# H
homeassistant/components/harmony/* @ehendrix23
homeassistant/components/hikvision/binary_sensor.py @mezz64
homeassistant/components/history_graph/* @andrey-git
homeassistant/components/hive/* @Rendili @KJonline
homeassistant/components/*/hive.py @Rendili @KJonline
homeassistant/components/homekit/* @cdce8p
homeassistant/components/huawei_lte/* @scop
homeassistant/components/*/huawei_lte.py @scop
homeassistant/components/huawei_router/device_tracker.py @abmantis
# I
homeassistant/components/influxdb/* @fabaff
homeassistant/components/integration/sensor.py @dgomes
homeassistant/components/ios/* @robbiet480
homeassistant/components/ipma/* @dgomes
homeassistant/components/irish_rail_transport/sensor.py @ttroy50
# J
homeassistant/components/jewish_calendar/sensor.py @tsvi
# K
homeassistant/components/knx/* @Julius2342
homeassistant/components/*/knx.py @Julius2342
homeassistant/components/kodi/media_player.py @armills
homeassistant/components/konnected/* @heythisisnate
homeassistant/components/*/konnected.py @heythisisnate
# L
homeassistant/components/lametric/notify.py @robbiet480
homeassistant/components/launch_library/sensor.py @ludeeus
homeassistant/components/lifx/* @amelchio
homeassistant/components/*/lifx.py @amelchio
homeassistant/components/lifx_cloud/scene.py @amelchio
homeassistant/components/lifx_legacy/light.py @amelchio
homeassistant/components/linux_battery/sensor.py @fabaff
homeassistant/components/liveboxplaytv/media_player.py @pschmitt
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/*/luftdaten.py @fabaff
# M
homeassistant/components/matrix/* @tinloaf
homeassistant/components/*/matrix.py @tinloaf
homeassistant/components/mediaroom/media_player.py @dgomes
homeassistant/components/melissa/* @kennedyshead
homeassistant/components/*/melissa.py @kennedyshead
homeassistant/components/*/mystrom.py @fabaff
homeassistant/components/met/weather.py @danielhiversen
homeassistant/components/miflora/sensor.py @danielhiversen @ChristianKuehnel
homeassistant/components/mill/climate.py @danielhiversen
homeassistant/components/min_max/sensor.py @fabaff
homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/monoprice/media_player.py @etsinko
homeassistant/components/moon/sensor.py @fabaff
homeassistant/components/mpd/media_player.py @fabaff
homeassistant/components/mystrom/* @fabaff
# N
homeassistant/components/nello/lock.py @pschmitt
homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/*/ness_alarm.py @nickw444
homeassistant/components/netdata/sensor.py @fabaff
homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/sensor.py @thibmaek
homeassistant/components/no_ip/* @fabaff
homeassistant/components/nuki/lock.py @pschmitt
homeassistant/components/nsw_fuel_station/sensor.py @nickw444
# O
homeassistant/components/ohmconnect/sensor.py @robbiet480
homeassistant/components/openuv/* @bachya
homeassistant/components/openweathermap/weather.py @fabaff
homeassistant/components/owlet/* @oblogic7
# P
homeassistant/components/pi_hole/sensor.py @fabaff
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/point/* @fredrike
homeassistant/components/*/point.py @fredrike
homeassistant/components/pollen/sensor.py @bachya
homeassistant/components/push/camera.py @dgomes
homeassistant/components/pvoutput/sensor.py @fabaff
# Q
homeassistant/components/qnap/sensor.py @colinodell
homeassistant/components/quantum_gateway/device_tracker.py @cisasteelersfan
homeassistant/components/qwikswitch/* @kellerza
homeassistant/components/*/qwikswitch.py @kellerza
# R
homeassistant/components/rainmachine/* @bachya
homeassistant/components/*/random.py @fabaff
homeassistant/components/*/rfxtrx.py @danielhiversen
homeassistant/components/random/* @fabaff
homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/vacuum.py @pschmitt
homeassistant/components/ruter/sensor.py @ludeeus
# S
homeassistant/components/scrape/sensor.py @fabaff
homeassistant/components/sensibo/climate.py @andrey-git
homeassistant/components/serial/sensor.py @fabaff
homeassistant/components/seventeentrack/sensor.py @bachya
homeassistant/components/shiftr/* @fabaff
homeassistant/components/shodan/sensor.py @fabaff
homeassistant/components/simplisafe/* @bachya
homeassistant/components/sma/sensor.py @kellerza
homeassistant/components/smartthings/* @andrewsayre
homeassistant/components/sonos/* @amelchio
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/spider/* @peternijssen
homeassistant/components/sql/sensor.py @dgomes
homeassistant/components/statistics/sensor.py @fabaff
homeassistant/components/swiss_*/* @fabaff
homeassistant/components/switchbot/switch.py @danielhiversen
homeassistant/components/switchmate/switch.py @danielhiversen
homeassistant/components/synology_srm/device_tracker.py @aerialls
homeassistant/components/sytadin/sensor.py @gautric
# T
homeassistant/components/tahoma/* @philklei
homeassistant/components/*/tahoma.py @philklei
homeassistant/components/tellduslive/*.py @fredrike
homeassistant/components/*/tellduslive.py @fredrike
homeassistant/components/tautulli/sensor.py @ludeeus
homeassistant/components/tellduslive/* @fredrike
homeassistant/components/template/cover.py @PhracturedBlue
homeassistant/components/tesla/* @zabuldon
homeassistant/components/*/tesla.py @zabuldon
homeassistant/components/tfiac/* @fredrike @mellado
homeassistant/components/thethingsnetwork/* @fabaff
homeassistant/components/*/thethingsnetwork.py @fabaff
homeassistant/components/threshold/binary_sensor.py @fabaff
homeassistant/components/tibber/* @danielhiversen
homeassistant/components/*/tibber.py @danielhiversen
homeassistant/components/tile/device_tracker.py @bachya
homeassistant/components/time_date/sensor.py @fabaff
homeassistant/components/toon/* @frenck
homeassistant/components/tplink/* @rytilahti
homeassistant/components/traccar/device_tracker.py @ludeeus
homeassistant/components/tradfri/* @ggravlingen
homeassistant/components/*/tradfri.py @ggravlingen
# U
homeassistant/components/uber/sensor.py @robbiet480
homeassistant/components/unifi/* @kane610
homeassistant/components/switch/unifi.py @kane610
homeassistant/components/upcloud/* @scop
homeassistant/components/*/upcloud.py @scop
homeassistant/components/upnp/* @robbiet480
homeassistant/components/uptimerobot/binary_sensor.py @ludeeus
homeassistant/components/utility_meter/* @dgomes
# V
homeassistant/components/velux/* @Julius2342
homeassistant/components/*/velux.py @Julius2342
homeassistant/components/version/sensor.py @fabaff
# W
homeassistant/components/waqi/sensor.py @andrey-git
homeassistant/components/weather/__init__.py @fabaff
homeassistant/components/wemo/* @sqldiablo
homeassistant/components/*/wemo.py @sqldiablo
homeassistant/components/worldclock/sensor.py @fabaff
# X
homeassistant/components/*/xiaomi_aqara.py @danielhiversen @syssi
homeassistant/components/*/xiaomi_miio.py @rytilahti @syssi
homeassistant/components/xfinity/device_tracker.py @cisasteelersfan
homeassistant/components/xiaomi_aqara/* @danielhiversen @syssi
homeassistant/components/xiaomi_miio/* @rytilahti @syssi
homeassistant/components/xiaomi_tv/media_player.py @fattdev
# Y
homeassistant/components/yamaha_musiccast/* @jalmeroth
homeassistant/components/yeelight/* @rytilahti @zewelor
homeassistant/components/yeelightsunflower/light.py @lindsaymarkward
homeassistant/components/yi/camera.py @bachya
# Z
homeassistant/components/zeroconf/* @robbiet480
homeassistant/components/zha/* @dmulcahey @adminiuga
homeassistant/components/zoneminder/* @rohankapoorcom
# Other code

View File

@@ -1,4 +1,4 @@
Home Assistant |Build Status| |Coverage Status| |Chat Status|
Home Assistant |Build Status| |CI Status| |Coverage Status| |Chat Status|
=================================================================================
Home Assistant is a home automation platform running on Python 3. It is able to track and control all devices at home and offer a platform for automating control.
@@ -27,8 +27,10 @@ components <https://developers.home-assistant.io/docs/en/creating_component_inde
If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.
.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master
.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=dev
:target: https://travis-ci.org/home-assistant/home-assistant
.. |CI Status| image:: https://circleci.com/gh/home-assistant/home-assistant.svg?style=shield
:target: https://circleci.com/gh/home-assistant/home-assistant
.. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg
:target: https://coveralls.io/r/home-assistant/home-assistant?branch=master
.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg

View File

@@ -100,9 +100,21 @@ class AuthManager:
"""Return a list of available auth modules."""
return list(self._mfa_modules.values())
def get_auth_provider(self, provider_type: str, provider_id: str) \
-> Optional[AuthProvider]:
"""Return an auth provider, None if not found."""
return self._providers.get((provider_type, provider_id))
def get_auth_providers(self, provider_type: str) \
-> List[AuthProvider]:
"""Return a List of auth provider of one type, Empty if not found."""
return [provider
for (p_type, _), provider in self._providers.items()
if p_type == provider_type]
def get_auth_mfa_module(self, module_id: str) \
-> Optional[MultiFactorAuthModule]:
"""Return an multi-factor auth module, None if not found."""
"""Return a multi-factor auth module, None if not found."""
return self._mfa_modules.get(module_id)
async def async_get_users(self) -> List[models.User]:
@@ -113,6 +125,11 @@ class AuthManager:
"""Retrieve a user."""
return await self._store.async_get_user(user_id)
async def async_get_owner(self) -> Optional[models.User]:
"""Retrieve the owner."""
users = await self.async_get_users()
return next((user for user in users if user.is_owner), None)
async def async_get_group(self, group_id: str) -> Optional[models.Group]:
"""Retrieve all groups."""
return await self._store.async_get_group(group_id)
@@ -170,8 +187,7 @@ class AuthManager:
user = await self.async_get_user_by_credentials(credentials)
if user is None:
raise ValueError('Unable to find the user.')
else:
return user
return user
auth_provider = self._async_get_auth_provider(credentials)

View File

@@ -11,13 +11,14 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.util import dt as dt_util
from . import models
from .const import GROUP_ID_ADMIN, GROUP_ID_READ_ONLY
from .const import GROUP_ID_ADMIN, GROUP_ID_USER, GROUP_ID_READ_ONLY
from .permissions import PermissionLookup, system_policies
from .permissions.types import PolicyType # noqa: F401
STORAGE_VERSION = 1
STORAGE_KEY = 'auth'
GROUP_NAME_ADMIN = 'Administrators'
GROUP_NAME_USER = "Users"
GROUP_NAME_READ_ONLY = 'Read Only'
@@ -38,6 +39,7 @@ class AuthStore:
self._perm_lookup = None # type: Optional[PermissionLookup]
self._store = hass.helpers.storage.Store(STORAGE_VERSION, STORAGE_KEY,
private=True)
self._lock = asyncio.Lock()
async def async_get_groups(self) -> List[models.Group]:
"""Retrieve all users."""
@@ -272,8 +274,16 @@ class AuthStore:
async def _async_load(self) -> None:
"""Load the users."""
[ent_reg, data] = await asyncio.gather(
async with self._lock:
if self._users is not None:
return
await self._async_load_task()
async def _async_load_task(self) -> None:
"""Load the users."""
[ent_reg, dev_reg, data] = await asyncio.gather(
self.hass.helpers.entity_registry.async_get_registry(),
self.hass.helpers.device_registry.async_get_registry(),
self._store.async_load(),
)
@@ -282,7 +292,9 @@ class AuthStore:
if self._users is not None:
return
self._perm_lookup = perm_lookup = PermissionLookup(ent_reg)
self._perm_lookup = perm_lookup = PermissionLookup(
ent_reg, dev_reg
)
if data is None:
self._set_defaults()
@@ -297,6 +309,7 @@ class AuthStore:
# 1. Data from a recent version which has a single group without policy
# 2. Data from old version which has no groups
has_admin_group = False
has_user_group = False
has_read_only_group = False
group_without_policy = None
@@ -314,6 +327,13 @@ class AuthStore:
policy = system_policies.ADMIN_POLICY
system_generated = True
elif group_dict['id'] == GROUP_ID_USER:
has_user_group = True
name = GROUP_NAME_USER
policy = system_policies.USER_POLICY
system_generated = True
elif group_dict['id'] == GROUP_ID_READ_ONLY:
has_read_only_group = True
@@ -361,6 +381,10 @@ class AuthStore:
read_only_group = _system_read_only_group()
groups[read_only_group.id] = read_only_group
if not has_user_group:
user_group = _system_user_group()
groups[user_group.id] = user_group
for user_dict in data['users']:
# Collect the users group.
user_groups = []
@@ -475,7 +499,7 @@ class AuthStore:
'name': group.name
} # type: Dict[str, Any]
if group.id not in (GROUP_ID_READ_ONLY, GROUP_ID_ADMIN):
if not group.system_generated:
g_dict['policy'] = group.policy
groups.append(g_dict)
@@ -528,6 +552,8 @@ class AuthStore:
groups = OrderedDict() # type: Dict[str, models.Group]
admin_group = _system_admin_group()
groups[admin_group.id] = admin_group
user_group = _system_user_group()
groups[user_group.id] = user_group
read_only_group = _system_read_only_group()
groups[read_only_group.id] = read_only_group
self._groups = groups
@@ -543,6 +569,16 @@ def _system_admin_group() -> models.Group:
)
def _system_user_group() -> models.Group:
"""Create system user group."""
return models.Group(
name=GROUP_NAME_USER,
id=GROUP_ID_USER,
policy=system_policies.USER_POLICY,
system_generated=True,
)
def _system_read_only_group() -> models.Group:
"""Create read only group."""
return models.Group(

View File

@@ -5,4 +5,5 @@ ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30)
MFA_SESSION_EXPIRATION = timedelta(minutes=5)
GROUP_ID_ADMIN = 'system-admin'
GROUP_ID_USER = 'system-users'
GROUP_ID_READ_ONLY = 'system-read-only'

View File

@@ -2,6 +2,7 @@
Sending HOTP through notify service
"""
import asyncio
import logging
from collections import OrderedDict
from typing import Any, Dict, Optional, List
@@ -90,6 +91,7 @@ class NotifyAuthModule(MultiFactorAuthModule):
self._include = config.get(CONF_INCLUDE, [])
self._exclude = config.get(CONF_EXCLUDE, [])
self._message_template = config[CONF_MESSAGE]
self._init_lock = asyncio.Lock()
@property
def input_schema(self) -> vol.Schema:
@@ -98,15 +100,19 @@ class NotifyAuthModule(MultiFactorAuthModule):
async def _async_load(self) -> None:
"""Load stored data."""
data = await self._user_store.async_load()
async with self._init_lock:
if self._user_settings is not None:
return
if data is None:
data = {STORAGE_USERS: {}}
data = await self._user_store.async_load()
self._user_settings = {
user_id: NotifySetting(**setting)
for user_id, setting in data.get(STORAGE_USERS, {}).items()
}
if data is None:
data = {STORAGE_USERS: {}}
self._user_settings = {
user_id: NotifySetting(**setting)
for user_id, setting in data.get(STORAGE_USERS, {}).items()
}
async def _async_save(self) -> None:
"""Save data."""

View File

@@ -1,4 +1,5 @@
"""Time-based One Time Password auth module."""
import asyncio
import logging
from io import BytesIO
from typing import Any, Dict, Optional, Tuple # noqa: F401
@@ -68,6 +69,7 @@ class TotpAuthModule(MultiFactorAuthModule):
self._users = None # type: Optional[Dict[str, str]]
self._user_store = hass.helpers.storage.Store(
STORAGE_VERSION, STORAGE_KEY, private=True)
self._init_lock = asyncio.Lock()
@property
def input_schema(self) -> vol.Schema:
@@ -76,12 +78,16 @@ class TotpAuthModule(MultiFactorAuthModule):
async def _async_load(self) -> None:
"""Load stored data."""
data = await self._user_store.async_load()
async with self._init_lock:
if self._users is not None:
return
if data is None:
data = {STORAGE_USERS: {}}
data = await self._user_store.async_load()
self._users = data.get(STORAGE_USERS, {})
if data is None:
data = {STORAGE_USERS: {}}
self._users = data.get(STORAGE_USERS, {})
async def _async_save(self) -> None:
"""Save data."""

View File

@@ -1,12 +1,14 @@
"""Entity permissions."""
from functools import wraps
from typing import Callable, List, Union # noqa: F401
from collections import OrderedDict
from typing import Callable, Optional # noqa: F401
import voluptuous as vol
from .const import SUBCAT_ALL, POLICY_READ, POLICY_CONTROL, POLICY_EDIT
from .models import PermissionLookup
from .types import CategoryType, ValueType
from .types import CategoryType, SubCategoryDict, ValueType
# pylint: disable=unused-import
from .util import SubCatLookupType, lookup_all, compile_policy # noqa
SINGLE_ENTITY_SCHEMA = vol.Any(True, vol.Schema({
vol.Optional(POLICY_READ): True,
@@ -15,6 +17,7 @@ SINGLE_ENTITY_SCHEMA = vol.Any(True, vol.Schema({
}))
ENTITY_DOMAINS = 'domains'
ENTITY_AREAS = 'area_ids'
ENTITY_DEVICE_IDS = 'device_ids'
ENTITY_ENTITY_IDS = 'entity_ids'
@@ -24,148 +27,65 @@ ENTITY_VALUES_SCHEMA = vol.Any(True, vol.Schema({
ENTITY_POLICY_SCHEMA = vol.Any(True, vol.Schema({
vol.Optional(SUBCAT_ALL): SINGLE_ENTITY_SCHEMA,
vol.Optional(ENTITY_AREAS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_DEVICE_IDS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_DOMAINS): ENTITY_VALUES_SCHEMA,
vol.Optional(ENTITY_ENTITY_IDS): ENTITY_VALUES_SCHEMA,
}))
def _entity_allowed(schema: ValueType, key: str) \
-> Union[bool, None]:
"""Test if an entity is allowed based on the keys."""
if schema is None or isinstance(schema, bool):
return schema
assert isinstance(schema, dict)
return schema.get(key)
def _lookup_domain(perm_lookup: PermissionLookup,
domains_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by domain."""
return domains_dict.get(entity_id.split(".", 1)[0])
def _lookup_area(perm_lookup: PermissionLookup, area_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by area."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
device_entry = perm_lookup.device_registry.async_get(
entity_entry.device_id
)
if device_entry is None or device_entry.area_id is None:
return None
return area_dict.get(device_entry.area_id)
def _lookup_device(perm_lookup: PermissionLookup,
devices_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permissions by device."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
return devices_dict.get(entity_entry.device_id)
def _lookup_entity_id(perm_lookup: PermissionLookup,
entities_dict: SubCategoryDict,
entity_id: str) -> Optional[ValueType]:
"""Look up entity permission by entity id."""
return entities_dict.get(entity_id)
def compile_entities(policy: CategoryType, perm_lookup: PermissionLookup) \
-> Callable[[str, str], bool]:
"""Compile policy into a function that tests policy."""
# None, Empty Dict, False
if not policy:
def apply_policy_deny_all(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
subcategories = OrderedDict() # type: SubCatLookupType
subcategories[ENTITY_ENTITY_IDS] = _lookup_entity_id
subcategories[ENTITY_DEVICE_IDS] = _lookup_device
subcategories[ENTITY_AREAS] = _lookup_area
subcategories[ENTITY_DOMAINS] = _lookup_domain
subcategories[SUBCAT_ALL] = lookup_all
return apply_policy_deny_all
if policy is True:
def apply_policy_allow_all(entity_id: str, key: str) -> bool:
"""Approve all."""
return True
return apply_policy_allow_all
assert isinstance(policy, dict)
domains = policy.get(ENTITY_DOMAINS)
device_ids = policy.get(ENTITY_DEVICE_IDS)
entity_ids = policy.get(ENTITY_ENTITY_IDS)
all_entities = policy.get(SUBCAT_ALL)
funcs = [] # type: List[Callable[[str, str], Union[None, bool]]]
# The order of these functions matter. The more precise are at the top.
# If a function returns None, they cannot handle it.
# If a function returns a boolean, that's the result to return.
# Setting entity_ids to a boolean is final decision for permissions
# So return right away.
if isinstance(entity_ids, bool):
def allowed_entity_id_bool(entity_id: str, key: str) -> bool:
"""Test if allowed entity_id."""
return entity_ids # type: ignore
return allowed_entity_id_bool
if entity_ids is not None:
def allowed_entity_id_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed entity_id."""
return _entity_allowed(
entity_ids.get(entity_id), key) # type: ignore
funcs.append(allowed_entity_id_dict)
if isinstance(device_ids, bool):
def allowed_device_id_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed device_id."""
return device_ids
funcs.append(allowed_device_id_bool)
elif device_ids is not None:
def allowed_device_id_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed device_id."""
entity_entry = perm_lookup.entity_registry.async_get(entity_id)
if entity_entry is None or entity_entry.device_id is None:
return None
return _entity_allowed(
device_ids.get(entity_entry.device_id), key # type: ignore
)
funcs.append(allowed_device_id_dict)
if isinstance(domains, bool):
def allowed_domain_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return domains
funcs.append(allowed_domain_bool)
elif domains is not None:
def allowed_domain_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
domain = entity_id.split(".", 1)[0]
return _entity_allowed(domains.get(domain), key) # type: ignore
funcs.append(allowed_domain_dict)
if isinstance(all_entities, bool):
def allowed_all_entities_bool(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return all_entities
funcs.append(allowed_all_entities_bool)
elif all_entities is not None:
def allowed_all_entities_dict(entity_id: str, key: str) \
-> Union[None, bool]:
"""Test if allowed domain."""
return _entity_allowed(all_entities, key)
funcs.append(allowed_all_entities_dict)
# Can happen if no valid subcategories specified
if not funcs:
def apply_policy_deny_all_2(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
return apply_policy_deny_all_2
if len(funcs) == 1:
func = funcs[0]
@wraps(func)
def apply_policy_func(entity_id: str, key: str) -> bool:
"""Apply a single policy function."""
return func(entity_id, key) is True
return apply_policy_func
def apply_policy_funcs(entity_id: str, key: str) -> bool:
"""Apply several policy functions."""
for func in funcs:
result = func(entity_id, key)
if result is not None:
return result
return False
return apply_policy_funcs
return compile_policy(policy, subcategories, perm_lookup)

View File

@@ -8,6 +8,9 @@ if TYPE_CHECKING:
from homeassistant.helpers import ( # noqa
entity_registry as ent_reg,
)
from homeassistant.helpers import ( # noqa
device_registry as dev_reg,
)
@attr.s(slots=True)
@@ -15,3 +18,4 @@ class PermissionLookup:
"""Class to hold data for permission lookups."""
entity_registry = attr.ib(type='ent_reg.EntityRegistry')
device_registry = attr.ib(type='dev_reg.DeviceRegistry')

View File

@@ -5,6 +5,10 @@ ADMIN_POLICY = {
CAT_ENTITIES: True,
}
USER_POLICY = {
CAT_ENTITIES: True,
}
READ_ONLY_POLICY = {
CAT_ENTITIES: {
SUBCAT_ALL: {

View File

@@ -10,9 +10,11 @@ ValueType = Union[
None
]
# Example: entities.domains = { light: … }
SubCategoryDict = Mapping[str, ValueType]
SubCategoryType = Union[
# Example: entities.domains = { light: … }
Mapping[str, ValueType],
SubCategoryDict,
bool,
None
]

View File

@@ -0,0 +1,98 @@
"""Helpers to deal with permissions."""
from functools import wraps
from typing import Callable, Dict, List, Optional, Union, cast # noqa: F401
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str],
Optional[ValueType]]
SubCatLookupType = Dict[str, LookupFunc]
def lookup_all(perm_lookup: PermissionLookup, lookup_dict: SubCategoryDict,
object_id: str) -> ValueType:
"""Look up permission for all."""
# In case of ALL category, lookup_dict IS the schema.
return cast(ValueType, lookup_dict)
def compile_policy(
policy: CategoryType, subcategories: SubCatLookupType,
perm_lookup: PermissionLookup
) -> Callable[[str, str], bool]: # noqa
"""Compile policy into a function that tests policy.
Subcategories are mapping key -> lookup function, ordered by highest
priority first.
"""
# None, False, empty dict
if not policy:
def apply_policy_deny_all(entity_id: str, key: str) -> bool:
"""Decline all."""
return False
return apply_policy_deny_all
if policy is True:
def apply_policy_allow_all(entity_id: str, key: str) -> bool:
"""Approve all."""
return True
return apply_policy_allow_all
assert isinstance(policy, dict)
funcs = [] # type: List[Callable[[str, str], Union[None, bool]]]
for key, lookup_func in subcategories.items():
lookup_value = policy.get(key)
# If any lookup value is `True`, it will always be positive
if isinstance(lookup_value, bool):
return lambda object_id, key: True
if lookup_value is not None:
funcs.append(_gen_dict_test_func(
perm_lookup, lookup_func, lookup_value))
if len(funcs) == 1:
func = funcs[0]
@wraps(func)
def apply_policy_func(object_id: str, key: str) -> bool:
"""Apply a single policy function."""
return func(object_id, key) is True
return apply_policy_func
def apply_policy_funcs(object_id: str, key: str) -> bool:
"""Apply several policy functions."""
for func in funcs:
result = func(object_id, key)
if result is not None:
return result
return False
return apply_policy_funcs
def _gen_dict_test_func(
perm_lookup: PermissionLookup,
lookup_func: LookupFunc,
lookup_dict: SubCategoryDict
) -> Callable[[str, str], Optional[bool]]: # noqa
"""Generate a lookup function."""
def test_value(object_id: str, key: str) -> Optional[bool]:
"""Test if permission is allowed based on the keys."""
schema = lookup_func(
perm_lookup, lookup_dict, object_id) # type: ValueType
if schema is None or isinstance(schema, bool):
return schema
assert isinstance(schema, dict)
return schema.get(key)
return test_value

View File

@@ -1,4 +1,5 @@
"""Home Assistant auth provider."""
import asyncio
import base64
from collections import OrderedDict
import logging
@@ -204,15 +205,21 @@ class HassAuthProvider(AuthProvider):
DEFAULT_TITLE = 'Home Assistant Local'
data = None
def __init__(self, *args: Any, **kwargs: Any) -> None:
"""Initialize an Home Assistant auth provider."""
super().__init__(*args, **kwargs)
self.data = None # type: Optional[Data]
self._init_lock = asyncio.Lock()
async def async_initialize(self) -> None:
"""Initialize the auth provider."""
if self.data is not None:
return
async with self._init_lock:
if self.data is not None:
return
self.data = Data(self.hass)
await self.data.async_load()
data = Data(self.hass)
await data.async_load()
self.data = data
async def async_login_flow(
self, context: Optional[Dict]) -> LoginFlow:

View File

@@ -4,27 +4,23 @@ Support Legacy API password auth provider.
It will be removed when auth system production ready
"""
import hmac
from typing import Any, Dict, Optional, cast, TYPE_CHECKING
from typing import Any, Dict, Optional, cast
import voluptuous as vol
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from .. import AuthManager
from ..models import Credentials, UserMeta, User
if TYPE_CHECKING:
from homeassistant.components.http import HomeAssistantHTTP # noqa: F401
USER_SCHEMA = vol.Schema({
vol.Required('username'): str,
})
AUTH_PROVIDER_TYPE = 'legacy_api_password'
CONF_API_PASSWORD = 'api_password'
CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend({
vol.Required(CONF_API_PASSWORD): cv.string,
}, extra=vol.PREVENT_EXTRA)
LEGACY_USER_NAME = 'Legacy API password user'
@@ -34,40 +30,45 @@ class InvalidAuthError(HomeAssistantError):
"""Raised when submitting invalid authentication."""
async def async_get_user(hass: HomeAssistant) -> User:
"""Return the legacy API password user."""
async def async_validate_password(hass: HomeAssistant, password: str)\
-> Optional[User]:
"""Return a user if password is valid. None if not."""
auth = cast(AuthManager, hass.auth) # type: ignore
found = None
for prv in auth.auth_providers:
if prv.type == 'legacy_api_password':
found = prv
break
if found is None:
providers = auth.get_auth_providers(AUTH_PROVIDER_TYPE)
if not providers:
raise ValueError('Legacy API password provider not found')
return await auth.async_get_or_create_user(
await found.async_get_or_create_credentials({})
)
try:
provider = cast(LegacyApiPasswordAuthProvider, providers[0])
provider.async_validate_login(password)
return await auth.async_get_or_create_user(
await provider.async_get_or_create_credentials({})
)
except InvalidAuthError:
return None
@AUTH_PROVIDERS.register('legacy_api_password')
@AUTH_PROVIDERS.register(AUTH_PROVIDER_TYPE)
class LegacyApiPasswordAuthProvider(AuthProvider):
"""Example auth provider based on hardcoded usernames and passwords."""
"""An auth provider support legacy api_password."""
DEFAULT_TITLE = 'Legacy API Password'
@property
def api_password(self) -> str:
"""Return api_password."""
return str(self.config[CONF_API_PASSWORD])
async def async_login_flow(self, context: Optional[Dict]) -> LoginFlow:
"""Return a flow to login."""
return LegacyLoginFlow(self)
@callback
def async_validate_login(self, password: str) -> None:
"""Validate a username and password."""
hass_http = getattr(self.hass, 'http', None) # type: HomeAssistantHTTP
"""Validate password."""
api_password = str(self.config[CONF_API_PASSWORD])
if not hmac.compare_digest(hass_http.api_password.encode('utf-8'),
if not hmac.compare_digest(api_password.encode('utf-8'),
password.encode('utf-8')):
raise InvalidAuthError
@@ -99,12 +100,6 @@ class LegacyLoginFlow(LoginFlow):
"""Handle the step of the form."""
errors = {}
hass_http = getattr(self.hass, 'http', None)
if hass_http is None or not hass_http.api_password:
return self.async_abort(
reason='no_api_password_set'
)
if user_input is not None:
try:
cast(LegacyApiPasswordAuthProvider, self._auth_provider)\

View File

@@ -3,18 +3,41 @@
It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from typing import Any, Dict, Optional, cast
from ipaddress import ip_network, IPv4Address, IPv6Address, IPv4Network,\
IPv6Network
from typing import Any, Dict, List, Optional, Union, cast
import voluptuous as vol
from homeassistant.components.http import HomeAssistantHTTP # noqa: F401
import homeassistant.helpers.config_validation as cv
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from . import AuthProvider, AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, LoginFlow
from ..models import Credentials, UserMeta
IPAddress = Union[IPv4Address, IPv6Address]
IPNetwork = Union[IPv4Network, IPv6Network]
CONF_TRUSTED_NETWORKS = 'trusted_networks'
CONF_TRUSTED_USERS = 'trusted_users'
CONF_GROUP = 'group'
CONF_ALLOW_BYPASS_LOGIN = 'allow_bypass_login'
CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend({
vol.Required(CONF_TRUSTED_NETWORKS): vol.All(
cv.ensure_list, [ip_network]
),
vol.Optional(CONF_TRUSTED_USERS, default={}): vol.Schema(
# we only validate the format of user_id or group_id
{ip_network: vol.All(
cv.ensure_list,
[vol.Or(
cv.uuid4_hex,
vol.Schema({vol.Required(CONF_GROUP): cv.uuid4_hex}),
)],
)}
),
vol.Optional(CONF_ALLOW_BYPASS_LOGIN, default=False): cv.boolean,
}, extra=vol.PREVENT_EXTRA)
@@ -35,6 +58,16 @@ class TrustedNetworksAuthProvider(AuthProvider):
DEFAULT_TITLE = 'Trusted Networks'
@property
def trusted_networks(self) -> List[IPNetwork]:
"""Return trusted networks."""
return cast(List[IPNetwork], self.config[CONF_TRUSTED_NETWORKS])
@property
def trusted_users(self) -> Dict[IPNetwork, Any]:
"""Return trusted users per network."""
return cast(Dict[IPNetwork, Any], self.config[CONF_TRUSTED_USERS])
@property
def support_mfa(self) -> bool:
"""Trusted Networks auth provider does not support MFA."""
@@ -43,13 +76,34 @@ class TrustedNetworksAuthProvider(AuthProvider):
async def async_login_flow(self, context: Optional[Dict]) -> LoginFlow:
"""Return a flow to login."""
assert context is not None
ip_addr = cast(IPAddress, context.get('ip_address'))
users = await self.store.async_get_users()
available_users = {user.id: user.name
for user in users
if not user.system_generated and user.is_active}
available_users = [user for user in users
if not user.system_generated and user.is_active]
for ip_net, user_or_group_list in self.trusted_users.items():
if ip_addr in ip_net:
user_list = [user_id for user_id in user_or_group_list
if isinstance(user_id, str)]
group_list = [group[CONF_GROUP] for group in user_or_group_list
if isinstance(group, dict)]
flattened_group_list = [group for sublist in group_list
for group in sublist]
available_users = [
user for user in available_users
if (user.id in user_list or
any([group.id in flattened_group_list
for group in user.groups]))
]
break
return TrustedNetworksLoginFlow(
self, cast(str, context.get('ip_address')), available_users)
self,
ip_addr,
{
user.id: user.name for user in available_users
},
self.config[CONF_ALLOW_BYPASS_LOGIN],
)
async def async_get_or_create_credentials(
self, flow_result: Dict[str, str]) -> Credentials:
@@ -80,19 +134,17 @@ class TrustedNetworksAuthProvider(AuthProvider):
raise NotImplementedError
@callback
def async_validate_access(self, ip_address: str) -> None:
def async_validate_access(self, ip_addr: IPAddress) -> None:
"""Make sure the access from trusted networks.
Raise InvalidAuthError if not.
Raise InvalidAuthError if trusted_networks is not configured.
"""
hass_http = getattr(self.hass, 'http', None) # type: HomeAssistantHTTP
if not hass_http or not hass_http.trusted_networks:
if not self.trusted_networks:
raise InvalidAuthError('trusted_networks is not configured')
if not any(ip_address in trusted_network for trusted_network
in hass_http.trusted_networks):
if not any(ip_addr in trusted_network for trusted_network
in self.trusted_networks):
raise InvalidAuthError('Not in trusted_networks')
@@ -100,12 +152,14 @@ class TrustedNetworksLoginFlow(LoginFlow):
"""Handler for the login flow."""
def __init__(self, auth_provider: TrustedNetworksAuthProvider,
ip_address: str, available_users: Dict[str, Optional[str]]) \
-> None:
ip_addr: IPAddress,
available_users: Dict[str, Optional[str]],
allow_bypass_login: bool) -> None:
"""Initialize the login flow."""
super().__init__(auth_provider)
self._available_users = available_users
self._ip_address = ip_address
self._ip_address = ip_addr
self._allow_bypass_login = allow_bypass_login
async def async_step_init(
self, user_input: Optional[Dict[str, str]] = None) \
@@ -123,6 +177,11 @@ class TrustedNetworksLoginFlow(LoginFlow):
if user_input is not None:
return await self.async_finish(user_input)
if self._allow_bypass_login and len(self._available_users) == 1:
return await self.async_finish({
'user': next(iter(self._available_users.keys()))
})
return self.async_show_form(
step_id='init',
data_schema=vol.Schema({'user': vol.In(self._available_users)}),

View File

@@ -1,18 +1,19 @@
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict
from typing import Any, Optional, Dict, Set
import voluptuous as vol
from homeassistant import (
core, config as conf_util, config_entries, components as core_components,
loader)
from homeassistant.components import persistent_notification
from homeassistant import core, config as conf_util, config_entries, loader
from homeassistant.components import (
persistent_notification, homeassistant as core_component
)
from homeassistant.const import EVENT_HOMEASSISTANT_CLOSE
from homeassistant.setup import async_setup_component
from homeassistant.util.logging import AsyncHandler
@@ -28,8 +29,16 @@ ERROR_LOG_FILENAME = 'home-assistant.log'
# hass.data key for logging information.
DATA_LOGGING = 'logging'
FIRST_INIT_COMPONENT = {'system_log', 'recorder', 'mqtt', 'mqtt_eventstream',
'logger', 'introduction', 'frontend', 'history'}
LOGGING_COMPONENT = {'logger', 'system_log'}
FIRST_INIT_COMPONENT = {
'recorder',
'mqtt',
'mqtt_eventstream',
'introduction',
'frontend',
'history',
}
def from_config_dict(config: Dict[str, Any],
@@ -85,14 +94,18 @@ async def async_from_config_dict(config: Dict[str, Any],
async_enable_logging(hass, verbose, log_rotate_days, log_file,
log_no_color)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning("Skipping pip installation of required modules. "
"This may cause issues")
core_config = config.get(core.DOMAIN, {})
has_api_password = bool((config.get('http') or {}).get('api_password'))
has_trusted_networks = bool((config.get('http') or {})
.get('trusted_networks'))
api_password = config.get('http', {}).get('api_password')
trusted_networks = config.get('http', {}).get('trusted_networks')
try:
await conf_util.async_process_ha_core_config(
hass, core_config, has_api_password, has_trusted_networks)
hass, core_config, api_password, trusted_networks)
except vol.Invalid as config_err:
conf_util.async_log_exception(
config_err, 'homeassistant', core_config, hass)
@@ -105,11 +118,6 @@ async def async_from_config_dict(config: Dict[str, Any],
await hass.async_add_executor_job(
conf_util.process_ha_config_upgrade, hass)
hass.config.skip_pip = skip_pip
if skip_pip:
_LOGGER.warning("Skipping pip installation of required modules. "
"This may cause issues")
# Make a copy because we are mutating it.
config = OrderedDict(config)
@@ -118,12 +126,9 @@ async def async_from_config_dict(config: Dict[str, Any],
hass, config, core_config.get(conf_util.CONF_PACKAGES, {}))
hass.config_entries = config_entries.ConfigEntries(hass, config)
await hass.config_entries.async_load()
await hass.config_entries.async_initialize()
# Filter out the repeating and common config section [homeassistant]
components = set(key.split(' ')[0] for key in config.keys()
if key != core.DOMAIN)
components.update(hass.config_entries.async_domains())
components = _get_components(hass, config)
# Resolve all dependencies of all components.
for component in list(components):
@@ -135,7 +140,7 @@ async def async_from_config_dict(config: Dict[str, Any],
pass
# setup components
res = await core_components.async_setup(hass, config)
res = await core_component.async_setup(hass, config)
if not res:
_LOGGER.error("Home Assistant core failed to initialize. "
"Further initialization aborted")
@@ -145,17 +150,31 @@ async def async_from_config_dict(config: Dict[str, Any],
_LOGGER.info("Home Assistant core initialized")
# stage 0, load logging components
for component in components:
if component in LOGGING_COMPONENT:
hass.async_create_task(
async_setup_component(hass, component, config))
await hass.async_block_till_done()
# Kick off loading the registries. They don't need to be awaited.
asyncio.gather(
hass.helpers.device_registry.async_get_registry(),
hass.helpers.entity_registry.async_get_registry(),
hass.helpers.area_registry.async_get_registry())
# stage 1
for component in components:
if component not in FIRST_INIT_COMPONENT:
continue
hass.async_create_task(async_setup_component(hass, component, config))
if component in FIRST_INIT_COMPONENT:
hass.async_create_task(
async_setup_component(hass, component, config))
await hass.async_block_till_done()
# stage 2
for component in components:
if component in FIRST_INIT_COMPONENT:
if component in FIRST_INIT_COMPONENT or component in LOGGING_COMPONENT:
continue
hass.async_create_task(async_setup_component(hass, component, config))
@@ -376,3 +395,21 @@ async def async_mount_local_lib_path(config_dir: str) -> str:
if lib_dir not in sys.path:
sys.path.insert(0, lib_dir)
return deps_dir
@core.callback
def _get_components(hass: core.HomeAssistant,
config: Dict[str, Any]) -> Set[str]:
"""Get components to set up."""
# Filter out the repeating and common config section [homeassistant]
components = set(key.split(' ')[0] for key in config.keys()
if key != core.DOMAIN)
# Add config entry domains
components.update(hass.config_entries.async_domains()) # type: ignore
# Make sure the Hass.io component is loaded
if 'HASSIO' in os.environ:
components.add('hassio')
return components

View File

@@ -7,33 +7,12 @@ Component design guidelines:
format "<DOMAIN>.<OBJECT_ID>".
- Each component should publish services only under its own domain.
"""
import asyncio
import itertools as it
import logging
from typing import Awaitable
import voluptuous as vol
import homeassistant.core as ha
import homeassistant.config as conf_util
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.service import extract_entity_ids
from homeassistant.helpers import intent
from homeassistant.const import (
ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE,
SERVICE_HOMEASSISTANT_STOP, SERVICE_HOMEASSISTANT_RESTART,
RESTART_EXIT_CODE)
from homeassistant.helpers import config_validation as cv
from homeassistant.core import split_entity_id
_LOGGER = logging.getLogger(__name__)
SERVICE_RELOAD_CORE_CONFIG = 'reload_core_config'
SERVICE_CHECK_CONFIG = 'check_config'
SERVICE_UPDATE_ENTITY = 'update_entity'
SCHEMA_UPDATE_ENTITY = vol.Schema({
ATTR_ENTITY_ID: cv.entity_ids
})
def is_on(hass, entity_id=None):
"""Load up the module to call the is_on method.
@@ -46,7 +25,7 @@ def is_on(hass, entity_id=None):
entity_ids = hass.states.entity_ids()
for ent_id in entity_ids:
domain = ha.split_entity_id(ent_id)[0]
domain = split_entity_id(ent_id)[0]
try:
component = getattr(hass.components, domain)
@@ -64,112 +43,3 @@ def is_on(hass, entity_id=None):
return True
return False
async def async_setup(hass: ha.HomeAssistant, config: dict) -> Awaitable[bool]:
"""Set up general services related to Home Assistant."""
async def async_handle_turn_service(service):
"""Handle calls to homeassistant.turn_on/off."""
entity_ids = extract_entity_ids(hass, service)
# Generic turn on/off method requires entity id
if not entity_ids:
_LOGGER.error(
"homeassistant/%s cannot be called without entity_id",
service.service)
return
# Group entity_ids by domain. groupby requires sorted data.
by_domain = it.groupby(sorted(entity_ids),
lambda item: ha.split_entity_id(item)[0])
tasks = []
for domain, ent_ids in by_domain:
# We want to block for all calls and only return when all calls
# have been processed. If a service does not exist it causes a 10
# second delay while we're blocking waiting for a response.
# But services can be registered on other HA instances that are
# listening to the bus too. So as an in between solution, we'll
# block only if the service is defined in the current HA instance.
blocking = hass.services.has_service(domain, service.service)
# Create a new dict for this call
data = dict(service.data)
# ent_ids is a generator, convert it to a list.
data[ATTR_ENTITY_ID] = list(ent_ids)
tasks.append(hass.services.async_call(
domain, service.service, data, blocking))
await asyncio.wait(tasks, loop=hass.loop)
hass.services.async_register(
ha.DOMAIN, SERVICE_TURN_OFF, async_handle_turn_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_TURN_ON, async_handle_turn_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_TOGGLE, async_handle_turn_service)
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TURN_ON, ha.DOMAIN, SERVICE_TURN_ON, "Turned {} on"))
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TURN_OFF, ha.DOMAIN, SERVICE_TURN_OFF,
"Turned {} off"))
hass.helpers.intent.async_register(intent.ServiceIntentHandler(
intent.INTENT_TOGGLE, ha.DOMAIN, SERVICE_TOGGLE, "Toggled {}"))
async def async_handle_core_service(call):
"""Service handler for handling core services."""
if call.service == SERVICE_HOMEASSISTANT_STOP:
hass.async_create_task(hass.async_stop())
return
try:
errors = await conf_util.async_check_ha_config_file(hass)
except HomeAssistantError:
return
if errors:
_LOGGER.error(errors)
hass.components.persistent_notification.async_create(
"Config error. See dev-info panel for details.",
"Config validating", "{0}.check_config".format(ha.DOMAIN))
return
if call.service == SERVICE_HOMEASSISTANT_RESTART:
hass.async_create_task(hass.async_stop(RESTART_EXIT_CODE))
async def async_handle_update_service(call):
"""Service handler for updating an entity."""
tasks = [hass.helpers.entity_component.async_update_entity(entity)
for entity in call.data[ATTR_ENTITY_ID]]
if tasks:
await asyncio.wait(tasks)
hass.services.async_register(
ha.DOMAIN, SERVICE_HOMEASSISTANT_STOP, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_HOMEASSISTANT_RESTART, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_CHECK_CONFIG, async_handle_core_service)
hass.services.async_register(
ha.DOMAIN, SERVICE_UPDATE_ENTITY, async_handle_update_service,
schema=SCHEMA_UPDATE_ENTITY)
async def async_handle_reload_config(call):
"""Service handler for reloading core config."""
try:
conf = await conf_util.async_hass_config_yaml(hass)
except HomeAssistantError as err:
_LOGGER.error(err)
return
await conf_util.async_process_ha_core_config(
hass, conf.get(ha.DOMAIN) or {})
hass.services.async_register(
ha.DOMAIN, SERVICE_RELOAD_CORE_CONFIG, async_handle_reload_config)
return True

View File

@@ -17,7 +17,8 @@ REQUIREMENTS = ['abodepy==0.15.0']
_LOGGER = logging.getLogger(__name__)
CONF_ATTRIBUTION = "Data provided by goabode.com"
ATTRIBUTION = "Data provided by goabode.com"
CONF_POLLING = 'polling'
DOMAIN = 'abode'
@@ -280,7 +281,7 @@ class AbodeDevice(Entity):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
'device_id': self._device.device_id,
'battery_low': self._device.battery_low,
'no_response': self._device.no_response,
@@ -327,7 +328,7 @@ class AbodeAutomation(Entity):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
'automation_id': self._automation.automation_id,
'type': self._automation.type,
'sub_type': self._automation.sub_type

View File

@@ -2,12 +2,12 @@
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.abode import CONF_ATTRIBUTION, AbodeDevice
from homeassistant.components.abode import DOMAIN as ABODE_DOMAIN
from homeassistant.const import (
ATTR_ATTRIBUTION, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED)
from . import ATTRIBUTION, DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES = ['abode']
_LOGGER = logging.getLogger(__name__)
@@ -73,7 +73,7 @@ class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanel):
def device_state_attributes(self):
"""Return the state attributes."""
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
'device_id': self._device.device_id,
'battery_backup': self._device.battery,
'cellular_backup': self._device.is_cellular,

View File

@@ -1,10 +1,10 @@
"""Support for Abode Security System binary sensors."""
import logging
from homeassistant.components.abode import (AbodeDevice, AbodeAutomation,
DOMAIN as ABODE_DOMAIN)
from homeassistant.components.binary_sensor import BinarySensorDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['abode']

View File

@@ -1,13 +1,14 @@
"""Support for Abode Security System cameras."""
from datetime import timedelta
import logging
from datetime import timedelta
import requests
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.components.camera import Camera
from homeassistant.util import Throttle
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES = ['abode']
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)

View File

@@ -1,9 +1,10 @@
"""Support for Abode Security System covers."""
import logging
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.components.cover import CoverDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES = ['abode']
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,13 +1,14 @@
"""Support for Abode Security System lights."""
import logging
from math import ceil
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_HS_COLOR, ATTR_COLOR_TEMP,
SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, Light)
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, SUPPORT_COLOR_TEMP, Light)
from homeassistant.util.color import (
color_temperature_kelvin_to_mired, color_temperature_mired_to_kelvin)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES = ['abode']

View File

@@ -1,9 +1,10 @@
"""Support for Abode Security System locks."""
import logging
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.components.lock import LockDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
DEPENDENCIES = ['abode']
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,10 +1,11 @@
"""Support for Abode Security System sensors."""
import logging
from homeassistant.components.abode import AbodeDevice, DOMAIN as ABODE_DOMAIN
from homeassistant.const import (
DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE)
from . import DOMAIN as ABODE_DOMAIN, AbodeDevice
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['abode']

View File

@@ -1,10 +1,10 @@
"""Support for Abode Security System switches."""
import logging
from homeassistant.components.abode import (AbodeDevice, AbodeAutomation,
DOMAIN as ABODE_DOMAIN)
from homeassistant.components.switch import SwitchDevice
from . import DOMAIN as ABODE_DOMAIN, AbodeAutomation, AbodeDevice
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['abode']

View File

@@ -0,0 +1 @@
"""The acer_projector component."""

View File

@@ -0,0 +1 @@
"""The actiontec component."""

View File

@@ -4,9 +4,11 @@ import struct
import logging
import ctypes
from collections import namedtuple
import voluptuous as vol
from homeassistant.const import CONF_DEVICE, CONF_PORT, CONF_IP_ADDRESS, \
EVENT_HOMEASSISTANT_STOP
from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyads==3.0.7']
@@ -16,18 +18,20 @@ _LOGGER = logging.getLogger(__name__)
DATA_ADS = 'data_ads'
# Supported Types
ADSTYPE_INT = 'int'
ADSTYPE_UINT = 'uint'
ADSTYPE_BYTE = 'byte'
ADSTYPE_BOOL = 'bool'
ADSTYPE_BYTE = 'byte'
ADSTYPE_DINT = 'dint'
ADSTYPE_INT = 'int'
ADSTYPE_UDINT = 'udint'
ADSTYPE_UINT = 'uint'
DOMAIN = 'ads'
CONF_ADS_FACTOR = 'factor'
CONF_ADS_TYPE = 'adstype'
CONF_ADS_VALUE = 'value'
CONF_ADS_VAR = 'adsvar'
CONF_ADS_VAR_BRIGHTNESS = 'adsvar_brightness'
CONF_ADS_TYPE = 'adstype'
CONF_ADS_FACTOR = 'factor'
CONF_ADS_VALUE = 'value'
DOMAIN = 'ads'
SERVICE_WRITE_DATA_BY_NAME = 'write_data_by_name'
@@ -41,7 +45,8 @@ CONFIG_SCHEMA = vol.Schema({
SCHEMA_SERVICE_WRITE_DATA_BY_NAME = vol.Schema({
vol.Required(CONF_ADS_TYPE):
vol.In([ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_BOOL]),
vol.In([ADSTYPE_INT, ADSTYPE_UINT, ADSTYPE_BYTE, ADSTYPE_BOOL,
ADSTYPE_DINT, ADSTYPE_UDINT]),
vol.Required(CONF_ADS_VALUE): vol.Coerce(int),
vol.Required(CONF_ADS_VAR): cv.string,
})
@@ -61,15 +66,19 @@ def setup(hass, config):
AdsHub.ADS_TYPEMAP = {
ADSTYPE_BOOL: pyads.PLCTYPE_BOOL,
ADSTYPE_BYTE: pyads.PLCTYPE_BYTE,
ADSTYPE_DINT: pyads.PLCTYPE_DINT,
ADSTYPE_INT: pyads.PLCTYPE_INT,
ADSTYPE_UDINT: pyads.PLCTYPE_UDINT,
ADSTYPE_UINT: pyads.PLCTYPE_UINT,
}
AdsHub.ADSError = pyads.ADSError
AdsHub.PLCTYPE_BOOL = pyads.PLCTYPE_BOOL
AdsHub.PLCTYPE_BYTE = pyads.PLCTYPE_BYTE
AdsHub.PLCTYPE_DINT = pyads.PLCTYPE_DINT
AdsHub.PLCTYPE_INT = pyads.PLCTYPE_INT
AdsHub.PLCTYPE_UDINT = pyads.PLCTYPE_UDINT
AdsHub.PLCTYPE_UINT = pyads.PLCTYPE_UINT
AdsHub.ADSError = pyads.ADSError
try:
ads = AdsHub(client)
@@ -162,13 +171,12 @@ class AdsHub:
hnotify, huser = self._client.add_device_notification(
name, attr, self._device_notification_callback)
hnotify = int(hnotify)
self._notification_items[hnotify] = NotificationItem(
hnotify, huser, name, plc_datatype, callback)
_LOGGER.debug(
"Added device notification %d for variable %s", hnotify, name)
self._notification_items[hnotify] = NotificationItem(
hnotify, huser, name, plc_datatype, callback)
def _device_notification_callback(self, notification, name):
"""Handle device notifications."""
contents = notification.contents
@@ -178,9 +186,10 @@ class AdsHub:
data = contents.data
try:
notification_item = self._notification_items[hnotify]
with self._lock:
notification_item = self._notification_items[hnotify]
except KeyError:
_LOGGER.debug("Unknown device notification handle: %d", hnotify)
_LOGGER.error("Unknown device notification handle: %d", hnotify)
return
# Parse data to desired datatype
@@ -192,6 +201,10 @@ class AdsHub:
value = struct.unpack('<B', bytearray(data)[:1])[0]
elif notification_item.plc_datatype == self.PLCTYPE_UINT:
value = struct.unpack('<H', bytearray(data)[:2])[0]
elif notification_item.plc_datatype == self.PLCTYPE_DINT:
value = struct.unpack('<i', bytearray(data)[:4])[0]
elif notification_item.plc_datatype == self.PLCTYPE_UDINT:
value = struct.unpack('<I', bytearray(data)[:4])[0]
else:
value = bytearray(data)
_LOGGER.warning("No callback available for this datatype")

View File

@@ -3,12 +3,13 @@ import logging
import voluptuous as vol
from homeassistant.components.ads import CONF_ADS_VAR, DATA_ADS
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA, PLATFORM_SCHEMA, BinarySensorDevice)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, DATA_ADS
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'ADS binary sensor'

View File

@@ -1,13 +1,15 @@
"""Support for ADS light sources."""
import logging
import voluptuous as vol
from homeassistant.components.light import Light, ATTR_BRIGHTNESS, \
SUPPORT_BRIGHTNESS, PLATFORM_SCHEMA
from homeassistant.components.light import (
ATTR_BRIGHTNESS, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS, Light)
from homeassistant.const import CONF_NAME
from homeassistant.components.ads import DATA_ADS, CONF_ADS_VAR, \
CONF_ADS_VAR_BRIGHTNESS
import homeassistant.helpers.config_validation as cv
from . import CONF_ADS_VAR, CONF_ADS_VAR_BRIGHTNESS, DATA_ADS
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['ads']
DEFAULT_NAME = 'ADS Light'

View File

@@ -4,13 +4,13 @@ import logging
import voluptuous as vol
from homeassistant.components import ads
from homeassistant.components.ads import (
CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR)
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME, CONF_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from . import CONF_ADS_FACTOR, CONF_ADS_TYPE, CONF_ADS_VAR
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "ADS sensor"
@@ -20,7 +20,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_ADS_VAR): cv.string,
vol.Optional(CONF_ADS_FACTOR): cv.positive_int,
vol.Optional(CONF_ADS_TYPE, default=ads.ADSTYPE_INT):
vol.In([ads.ADSTYPE_INT, ads.ADSTYPE_UINT, ads.ADSTYPE_BYTE]),
vol.In([ads.ADSTYPE_INT, ads.ADSTYPE_UINT, ads.ADSTYPE_BYTE,
ads.ADSTYPE_DINT, ads.ADSTYPE_UDINT]),
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_UNIT_OF_MEASUREMENT, default=''): cv.string,
})

View File

@@ -3,12 +3,13 @@ import logging
import voluptuous as vol
from homeassistant.components.ads import CONF_ADS_VAR, DATA_ADS
from homeassistant.components.switch import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import ToggleEntity
from . import CONF_ADS_VAR, DATA_ADS
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['ads']

View File

@@ -0,0 +1 @@
"""The aftership component."""

View File

@@ -0,0 +1 @@
"""The airvisual component."""

View File

@@ -18,7 +18,7 @@ from homeassistant.helpers import aiohttp_client, config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['pyairvisual==2.0.1']
REQUIREMENTS = ['pyairvisual==3.0.1']
_LOGGER = getLogger(__name__)
ATTR_CITY = 'city'
@@ -141,7 +141,7 @@ async def async_setup_platform(
"Using city, state, and country: %s, %s, %s", city, state, country)
location_id = ','.join((city, state, country))
data = AirVisualData(
Client(config[CONF_API_KEY], websession),
Client(websession, api_key=config[CONF_API_KEY]),
city=city,
state=state,
country=country,
@@ -152,7 +152,7 @@ async def async_setup_platform(
"Using latitude and longitude: %s, %s", latitude, longitude)
location_id = ','.join((str(latitude), str(longitude)))
data = AirVisualData(
Client(config[CONF_API_KEY], websession),
Client(websession, api_key=config[CONF_API_KEY]),
latitude=latitude,
longitude=longitude,
show_on_map=config[CONF_SHOW_ON_MAP],
@@ -278,11 +278,11 @@ class AirVisualData:
try:
if self.city and self.state and self.country:
resp = await self._client.data.city(
resp = await self._client.api.city(
self.city, self.state, self.country)
self.longitude, self.latitude = resp['location']['coordinates']
else:
resp = await self._client.data.nearest_city(
resp = await self._client.api.nearest_city(
self.latitude, self.longitude)
_LOGGER.debug("New data retrieved: %s", resp)

View File

@@ -0,0 +1 @@
"""The aladdin_connect component."""

View File

@@ -5,7 +5,7 @@ from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_HOST
from homeassistant.helpers.discovery import load_platform
from homeassistant.util import dt as dt_util
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
@@ -20,7 +20,6 @@ DATA_AD = 'alarmdecoder'
CONF_DEVICE = 'device'
CONF_DEVICE_BAUD = 'baudrate'
CONF_DEVICE_HOST = 'host'
CONF_DEVICE_PATH = 'path'
CONF_DEVICE_PORT = 'port'
CONF_DEVICE_TYPE = 'type'
@@ -55,7 +54,7 @@ SIGNAL_REL_MESSAGE = 'alarmdecoder.rel_message'
DEVICE_SOCKET_SCHEMA = vol.Schema({
vol.Required(CONF_DEVICE_TYPE): 'socket',
vol.Optional(CONF_DEVICE_HOST, default=DEFAULT_DEVICE_HOST): cv.string,
vol.Optional(CONF_HOST, default=DEFAULT_DEVICE_HOST): cv.string,
vol.Optional(CONF_DEVICE_PORT, default=DEFAULT_DEVICE_PORT): cv.port})
DEVICE_SERIAL_SCHEMA = vol.Schema({
@@ -165,7 +164,7 @@ def setup(hass, config):
controller = False
if device_type == 'socket':
host = device.get(CONF_DEVICE_HOST)
host = device.get(CONF_HOST)
port = device.get(CONF_DEVICE_PORT)
controller = AlarmDecoder(SocketDevice(interface=(host, port)))
elif device_type == 'serial':

View File

@@ -4,12 +4,13 @@ import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarmdecoder import DATA_AD, SIGNAL_PANEL_MESSAGE
from homeassistant.const import (
ATTR_CODE, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME,
STATE_ALARM_DISARMED, STATE_ALARM_TRIGGERED)
import homeassistant.helpers.config_validation as cv
from . import DATA_AD, SIGNAL_PANEL_MESSAGE
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['alarmdecoder']
@@ -131,6 +132,11 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
if code:
self.hass.data[DATA_AD].send("{!s}3".format(code))
def alarm_arm_night(self, code=None):
"""Send arm night command."""
if code:
self.hass.data[DATA_AD].send("{!s}33".format(code))
def alarm_toggle_chime(self, code=None):
"""Send toggle chime command."""
if code:

View File

@@ -2,11 +2,11 @@
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.alarmdecoder import (
ZONE_SCHEMA, CONF_ZONES, CONF_ZONE_NAME, CONF_ZONE_TYPE,
CONF_ZONE_RFID, CONF_ZONE_LOOP, SIGNAL_ZONE_FAULT, SIGNAL_ZONE_RESTORE,
SIGNAL_RFX_MESSAGE, SIGNAL_REL_MESSAGE, CONF_RELAY_ADDR,
CONF_RELAY_CHAN)
from . import (
CONF_RELAY_ADDR, CONF_RELAY_CHAN, CONF_ZONE_LOOP, CONF_ZONE_NAME,
CONF_ZONE_RFID, CONF_ZONE_TYPE, CONF_ZONES, SIGNAL_REL_MESSAGE,
SIGNAL_RFX_MESSAGE, SIGNAL_ZONE_FAULT, SIGNAL_ZONE_RESTORE, ZONE_SCHEMA)
DEPENDENCIES = ['alarmdecoder']

View File

@@ -2,7 +2,8 @@
import logging
from homeassistant.helpers.entity import Entity
from homeassistant.components.alarmdecoder import (SIGNAL_PANEL_MESSAGE)
from . import SIGNAL_PANEL_MESSAGE
_LOGGER = logging.getLogger(__name__)

View File

@@ -0,0 +1 @@
"""The alarmdotcom component."""

View File

@@ -89,7 +89,7 @@ async def async_setup(hass, config):
async def async_handle_alert_service(service_call):
"""Handle calls to alert services."""
alert_ids = service.extract_entity_ids(hass, service_call)
alert_ids = await service.async_extract_entity_ids(hass, service_call)
for alert_id in alert_ids:
for alert in entities:

View File

@@ -1,20 +1,21 @@
"""Support for alexa Smart Home Skill API."""
import asyncio
from collections import OrderedDict
from datetime import datetime
import json
import logging
import math
from collections import OrderedDict
from datetime import datetime
from uuid import uuid4
import aiohttp
import async_timeout
import homeassistant.core as ha
import homeassistant.util.color as color_util
from homeassistant.components import (
alert, automation, binary_sensor, climate, cover, fan, group, http,
alert, automation, binary_sensor, cover, fan, group, http,
input_boolean, light, lock, media_player, scene, script, sensor, switch)
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.event import async_track_state_change
from homeassistant.components.climate import const as climate
from homeassistant.const import (
ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE, ATTR_UNIT_OF_MEASUREMENT, CLOUD_NEVER_EXPOSED_ENTITIES,
@@ -22,16 +23,16 @@ from homeassistant.const import (
SERVICE_MEDIA_PLAY, SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_MEDIA_STOP,
SERVICE_SET_COVER_POSITION, SERVICE_TURN_OFF, SERVICE_TURN_ON,
SERVICE_UNLOCK, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_UP, SERVICE_VOLUME_SET,
SERVICE_VOLUME_MUTE, STATE_LOCKED, STATE_ON, STATE_UNAVAILABLE,
SERVICE_VOLUME_MUTE, STATE_LOCKED, STATE_ON, STATE_OFF, STATE_UNAVAILABLE,
STATE_UNLOCKED, TEMP_CELSIUS, TEMP_FAHRENHEIT, MATCH_ALL)
import homeassistant.core as ha
import homeassistant.util.color as color_util
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.event import async_track_state_change
from homeassistant.util.decorator import Registry
from homeassistant.util.temperature import convert as convert_temperature
from .auth import Auth
from .const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, CONF_ENDPOINT, \
CONF_ENTITY_CONFIG, CONF_FILTER, DATE_FORMAT, DEFAULT_TIMEOUT
from .auth import Auth
_LOGGER = logging.getLogger(__name__)
@@ -58,12 +59,18 @@ API_THERMOSTAT_MODES = OrderedDict([
(climate.STATE_AUTO, 'AUTO'),
(climate.STATE_ECO, 'ECO'),
(climate.STATE_MANUAL, 'AUTO'),
(climate.STATE_OFF, 'OFF'),
(STATE_OFF, 'OFF'),
(climate.STATE_IDLE, 'OFF'),
(climate.STATE_FAN_ONLY, 'OFF'),
(climate.STATE_DRY, 'OFF'),
])
PERCENTAGE_FAN_MAP = {
fan.SPEED_LOW: 33,
fan.SPEED_MEDIUM: 66,
fan.SPEED_HIGH: 100,
}
SMART_HOME_HTTP_ENDPOINT = '/api/alexa/smart_home'
CONF_DESCRIPTION = 'description'
@@ -579,6 +586,26 @@ class _AlexaPercentageController(_AlexaInterface):
def name(self):
return 'Alexa.PercentageController'
def properties_supported(self):
return [{'name': 'percentage'}]
def properties_retrievable(self):
return True
def get_property(self, name):
if name != 'percentage':
raise _UnsupportedProperty(name)
if self.entity.domain == fan.DOMAIN:
speed = self.entity.attributes.get(fan.ATTR_SPEED)
return PERCENTAGE_FAN_MAP.get(speed, 0)
if self.entity.domain == cover.DOMAIN:
return self.entity.attributes.get(cover.ATTR_CURRENT_POSITION, 0)
return 0
class _AlexaSpeaker(_AlexaInterface):
"""Implements Alexa.Speaker.
@@ -765,7 +792,7 @@ class _AlexaThermostatController(_AlexaInterface):
unit = self.hass.config.units.temperature_unit
if name == 'targetSetpoint':
temp = self.entity.attributes.get(climate.ATTR_TEMPERATURE)
temp = self.entity.attributes.get(ATTR_TEMPERATURE)
elif name == 'lowerSetpoint':
temp = self.entity.attributes.get(climate.ATTR_TARGET_TEMP_LOW)
elif name == 'upperSetpoint':
@@ -1114,12 +1141,15 @@ class SmartHomeView(http.HomeAssistantView):
the response.
"""
hass = request.app['hass']
user = request[http.KEY_HASS_USER]
message = await request.json()
_LOGGER.debug("Received Alexa Smart Home request: %s", message)
response = await async_handle_message(
hass, self.smart_home_config, message)
hass, self.smart_home_config, message,
context=ha.Context(user_id=user.id)
)
_LOGGER.debug("Sending Alexa Smart Home response: %s", response)
return b'' if response is None else self.json(response)

View File

@@ -0,0 +1 @@
"""The alpha_vantage component."""

View File

@@ -23,7 +23,8 @@ ATTR_CLOSE = 'close'
ATTR_HIGH = 'high'
ATTR_LOW = 'low'
CONF_ATTRIBUTION = "Stock market information provided by Alpha Vantage"
ATTRIBUTION = "Stock market information provided by Alpha Vantage"
CONF_FOREIGN_EXCHANGE = 'foreign_exchange'
CONF_FROM = 'from'
CONF_SYMBOL = 'symbol'
@@ -143,7 +144,7 @@ class AlphaVantageSensor(Entity):
"""Return the state attributes."""
if self.values is not None:
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
ATTR_CLOSE: self.values['4. close'],
ATTR_HIGH: self.values['2. high'],
ATTR_LOW: self.values['3. low'],
@@ -203,7 +204,7 @@ class AlphaVantageForeignExchange(Entity):
"""Return the state attributes."""
if self.values is not None:
return {
ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
ATTR_ATTRIBUTION: ATTRIBUTION,
CONF_FROM: self._from_currency,
CONF_TO: self._to_currency,
}

View File

@@ -0,0 +1 @@
"""Support for Amazon Polly integration."""

View File

@@ -8,7 +8,7 @@ import logging
import voluptuous as vol
from homeassistant.components.tts import Provider, PLATFORM_SCHEMA
from homeassistant.components.tts import PLATFORM_SCHEMA, Provider
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['boto3==1.9.16']

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Application \u0438/\u0438\u043b\u0438 API \u043a\u043b\u044e\u0447\u044a\u0442 \u0432\u0435\u0447\u0435 \u0441\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0430\u043d\u0438",
"invalid_key": "\u041d\u0435\u0432\u0430\u043b\u0438\u0434\u0435\u043d API \u043a\u043b\u044e\u0447 \u0438/\u0438\u043b\u0438 Application \u043a\u043b\u044e\u0447",
"no_devices": "\u041d\u0435 \u0441\u0430 \u043d\u0430\u043c\u0435\u0440\u0435\u043d\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0430"
},
"step": {
"user": {
"data": {
"api_key": "API \u043a\u043b\u044e\u0447",
"app_key": "Application \u043a\u043b\u044e\u0447"
},
"title": "\u041f\u043e\u043f\u044a\u043b\u043d\u0435\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f\u0442\u0430 \u0441\u0438"
}
},
"title": "\u0410\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u0430 PWS"
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Anwendungsschl\u00fcssel und / oder API-Schl\u00fcssel bereits registriert",
"invalid_key": "Ung\u00fcltiger API Key und / oder Anwendungsschl\u00fcssel",
"no_devices": "Keine Ger\u00e4te im Konto gefunden"
},
"step": {
"user": {
"data": {
"api_key": "API Key",
"app_key": "Anwendungsschl\u00fcssel"
},
"title": "Gib deine Informationen ein"
}
},
"title": "Ambient PWS"
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Clave de aplicaci\u00f3n y/o clave de API ya registrada",
"invalid_key": "Clave de API y/o clave de aplicaci\u00f3n no v\u00e1lida",
"no_devices": "No se han encontrado dispositivos en la cuenta."
},
"step": {
"user": {
"data": {
"api_key": "Clave API",
"app_key": "Clave de aplicaci\u00f3n"
},
"title": "Completa tu informaci\u00f3n"
}
},
"title": "Ambient PWS"
}
}

View File

@@ -0,0 +1,9 @@
{
"config": {
"step": {
"user": {
"title": "Completa tu informaci\u00f3n"
}
}
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"error": {
"no_devices": "\u05dc\u05d0 \u05e0\u05de\u05e6\u05d0\u05d5 \u05d4\u05ea\u05e7\u05df \u05d1\u05d7\u05e9\u05d1\u05d5\u05df"
},
"step": {
"user": {
"data": {
"api_key": "\u05de\u05e4\u05ea\u05d7 API"
},
"title": "\u05de\u05dc\u05d0 \u05d0\u05ea \u05d4\u05e4\u05e8\u05d8\u05d9\u05dd \u05e9\u05dc\u05da"
}
}
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Alkalmaz\u00e1s kulcsot \u00e9s/vagy az API kulcsot m\u00e1r regisztr\u00e1lt\u00e1k",
"invalid_key": "\u00c9rv\u00e9nytelen API kulcs \u00e9s / vagy alkalmaz\u00e1skulcs",
"no_devices": "Nincs a fi\u00f3kodban tal\u00e1lhat\u00f3 eszk\u00f6z"
},
"step": {
"user": {
"data": {
"api_key": "API kulcs",
"app_key": "Alkalmaz\u00e1skulcs"
},
"title": "T\u00f6ltsd ki az adataid"
}
},
"title": "Ambient PWS"
}
}

View File

@@ -0,0 +1,18 @@
{
"config": {
"error": {
"identifier_exists": "API Key e/o Application Key gi\u00e0 registrata",
"invalid_key": "API Key e/o Application Key non valida",
"no_devices": "Nessun dispositivo trovato nell'account"
},
"step": {
"user": {
"data": {
"api_key": "API Key",
"app_key": "Application Key"
},
"title": "Inserisci i tuoi dati"
}
}
}
}

View File

@@ -1,11 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Chave de aplica\u00e7\u00e3o e/ou chave de API j\u00e1 registradas.",
"invalid_key": "Chave de API e/ou chave de aplica\u00e7\u00e3o inv\u00e1lidas",
"no_devices": "Nenhum dispositivo encontrado na conta"
},
"step": {
"user": {
"data": {
"api_key": "Chave de API"
}
"api_key": "Chave de API",
"app_key": "Chave de aplica\u00e7\u00e3o"
},
"title": "Preencha as suas informa\u00e7\u00f5es"
}
}
},
"title": "Ambient PWS"
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Aplikacijski klju\u010d in / ali klju\u010d API je \u017ee registriran",
"invalid_key": "Neveljaven klju\u010d API in / ali klju\u010d aplikacije",
"no_devices": "V ra\u010dunu ni najdene nobene naprave"
},
"step": {
"user": {
"data": {
"api_key": "API Klju\u010d",
"app_key": "Klju\u010d aplikacije"
},
"title": "Izpolnite svoje podatke"
}
},
"title": "Ambient PWS"
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Applikationsnyckel och/eller API-nyckel \u00e4r redan registrerade",
"invalid_key": "Ogiltigt API-nyckel och/eller applikationsnyckel",
"no_devices": "Inga enheter hittades i kontot"
},
"step": {
"user": {
"data": {
"api_key": "API-nyckel",
"app_key": "Applikationsnyckel"
},
"title": "Fyll i dina uppgifter"
}
},
"title": "Ambient Weather PWS (Personal Weather Station)"
}
}

View File

@@ -0,0 +1,13 @@
{
"config": {
"step": {
"user": {
"data": {
"api_key": "\u0e04\u0e35\u0e22\u0e4c API",
"app_key": "\u0e23\u0e2b\u0e31\u0e2a\u0e41\u0e2d\u0e1b\u0e1e\u0e25\u0e34\u0e40\u0e04\u0e0a\u0e31\u0e19"
},
"title": "\u0e01\u0e23\u0e2d\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e2d\u0e07\u0e04\u0e38\u0e13"
}
}
}
}

View File

@@ -0,0 +1,19 @@
{
"config": {
"error": {
"identifier_exists": "Application Key \u548c/\u6216 API Key \u5df2\u6ce8\u518c",
"invalid_key": "\u65e0\u6548\u7684 API \u5bc6\u94a5\u548c/\u6216 Application Key",
"no_devices": "\u6ca1\u6709\u5728\u5e10\u6237\u4e2d\u627e\u5230\u8bbe\u5907"
},
"step": {
"user": {
"data": {
"api_key": "API Key",
"app_key": "Application Key"
},
"title": "\u586b\u5199\u60a8\u7684\u4fe1\u606f"
}
},
"title": "Ambient PWS"
}
}

View File

@@ -20,13 +20,14 @@ from .const import (
ATTR_LAST_DATA, CONF_APP_KEY, DATA_CLIENT, DOMAIN, TOPIC_UPDATE,
TYPE_BINARY_SENSOR, TYPE_SENSOR)
REQUIREMENTS = ['aioambient==0.1.2']
REQUIREMENTS = ['aioambient==0.2.0']
_LOGGER = logging.getLogger(__name__)
DATA_CONFIG = 'config'
DEFAULT_SOCKET_MIN_RETRY = 15
DEFAULT_WATCHDOG_SECONDS = 5 * 60
TYPE_24HOURRAININ = '24hourrainin'
TYPE_BAROMABSIN = 'baromabsin'
@@ -295,19 +296,41 @@ class AmbientStation:
def __init__(self, hass, config_entry, client, monitored_conditions):
"""Initialize."""
self._config_entry = config_entry
self._entry_setup_complete = False
self._hass = hass
self._watchdog_listener = None
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
self.client = client
self.monitored_conditions = monitored_conditions
self.stations = {}
async def _attempt_connect(self):
"""Attempt to connect to the socket (retrying later on fail)."""
from aioambient.errors import WebsocketError
try:
await self.client.websocket.connect()
except WebsocketError as err:
_LOGGER.error("Error with the websocket connection: %s", err)
self._ws_reconnect_delay = min(
2 * self._ws_reconnect_delay, 480)
async_call_later(
self._hass, self._ws_reconnect_delay, self.ws_connect)
async def ws_connect(self):
"""Register handlers and connect to the websocket."""
from aioambient.errors import WebsocketError
async def _ws_reconnect(event_time):
"""Forcibly disconnect from and reconnect to the websocket."""
_LOGGER.debug('Watchdog expired; forcing socket reconnection')
await self.client.websocket.disconnect()
await self._attempt_connect()
def on_connect():
"""Define a handler to fire when the websocket is connected."""
_LOGGER.info('Connected to websocket')
_LOGGER.debug('Watchdog starting')
self._watchdog_listener = async_call_later(
self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect)
def on_data(data):
"""Define a handler to fire when the data is received."""
@@ -317,6 +340,11 @@ class AmbientStation:
self.stations[mac_address][ATTR_LAST_DATA] = data
async_dispatcher_send(self._hass, TOPIC_UPDATE)
_LOGGER.debug('Resetting watchdog')
self._watchdog_listener()
self._watchdog_listener = async_call_later(
self._hass, DEFAULT_WATCHDOG_SECONDS, _ws_reconnect)
def on_disconnect():
"""Define a handler to fire when the websocket is disconnected."""
_LOGGER.info('Disconnected from websocket')
@@ -346,27 +374,25 @@ class AmbientStation:
'name', station['macAddress']),
}
for component in ('binary_sensor', 'sensor'):
self._hass.async_create_task(
self._hass.config_entries.async_forward_entry_setup(
self._config_entry, component))
# If the websocket disconnects and reconnects, the on_subscribed
# handler will get called again; in that case, we don't want to
# attempt forward setup of the config entry (because it will have
# already been done):
if not self._entry_setup_complete:
for component in ('binary_sensor', 'sensor'):
self._hass.async_create_task(
self._hass.config_entries.async_forward_entry_setup(
self._config_entry, component))
self._entry_setup_complete = True
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
self._ws_reconnect_delay = DEFAULT_SOCKET_MIN_RETRY
self.client.websocket.on_connect(on_connect)
self.client.websocket.on_data(on_data)
self.client.websocket.on_disconnect(on_disconnect)
self.client.websocket.on_subscribed(on_subscribed)
try:
await self.client.websocket.connect()
except WebsocketError as err:
_LOGGER.error("Error with the websocket connection: %s", err)
self._ws_reconnect_delay = min(2 * self._ws_reconnect_delay, 480)
async_call_later(
self._hass, self._ws_reconnect_delay, self.ws_connect)
await self._attempt_connect()
async def ws_disconnect(self):
"""Disconnect from the websocket."""
@@ -388,6 +414,12 @@ class AmbientWeatherEntity(Entity):
self._state = None
self._station_name = station_name
@property
def available(self):
"""Return True if entity is available."""
return self._ambient.stations[self._mac_address][ATTR_LAST_DATA].get(
self._sensor_type) is not None
@property
def device_info(self):
"""Return device registry information for this entity."""

View File

@@ -1,13 +1,13 @@
"""Support for Ambient Weather Station binary sensors."""
import logging
from homeassistant.components.ambient_station import (
SENSOR_TYPES, TYPE_BATT1, TYPE_BATT10, TYPE_BATT2, TYPE_BATT3, TYPE_BATT4,
TYPE_BATT5, TYPE_BATT6, TYPE_BATT7, TYPE_BATT8, TYPE_BATT9, TYPE_BATTOUT,
AmbientWeatherEntity)
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import ATTR_NAME
from . import (
SENSOR_TYPES, TYPE_BATT1, TYPE_BATT2, TYPE_BATT3, TYPE_BATT4, TYPE_BATT5,
TYPE_BATT6, TYPE_BATT7, TYPE_BATT8, TYPE_BATT9, TYPE_BATT10, TYPE_BATTOUT,
AmbientWeatherEntity)
from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_BINARY_SENSOR
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,10 +1,9 @@
"""Support for Ambient Weather Station sensors."""
import logging
from homeassistant.components.ambient_station import (
SENSOR_TYPES, AmbientWeatherEntity)
from homeassistant.const import ATTR_NAME
from . import SENSOR_TYPES, AmbientWeatherEntity
from .const import ATTR_LAST_DATA, DATA_CLIENT, DOMAIN, TYPE_SENSOR
_LOGGER = logging.getLogger(__name__)

View File

@@ -4,8 +4,6 @@ from datetime import timedelta
import aiohttp
import voluptuous as vol
from requests.exceptions import HTTPError, ConnectTimeout
from requests.exceptions import ConnectionError as ConnectError
from homeassistant.const import (
CONF_NAME, CONF_HOST, CONF_PORT, CONF_USERNAME, CONF_PASSWORD,
@@ -13,7 +11,8 @@ from homeassistant.const import (
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['amcrest==1.2.3']
REQUIREMENTS = ['amcrest==1.2.7']
DEPENDENCIES = ['ffmpeg']
_LOGGER = logging.getLogger(__name__)
@@ -27,6 +26,7 @@ DEFAULT_NAME = 'Amcrest Camera'
DEFAULT_PORT = 80
DEFAULT_RESOLUTION = 'high'
DEFAULT_STREAM_SOURCE = 'snapshot'
DEFAULT_ARGUMENTS = '-pred 1'
TIMEOUT = 10
DATA_AMCREST = 'amcrest'
@@ -78,7 +78,8 @@ CONFIG_SCHEMA = vol.Schema({
vol.All(vol.In(RESOLUTION_LIST)),
vol.Optional(CONF_STREAM_SOURCE, default=DEFAULT_STREAM_SOURCE):
vol.All(vol.In(STREAM_SOURCE_LIST)),
vol.Optional(CONF_FFMPEG_ARGUMENTS): cv.string,
vol.Optional(CONF_FFMPEG_ARGUMENTS, default=DEFAULT_ARGUMENTS):
cv.string,
vol.Optional(CONF_SCAN_INTERVAL, default=SCAN_INTERVAL):
cv.time_period,
vol.Optional(CONF_SENSORS):
@@ -91,7 +92,7 @@ CONFIG_SCHEMA = vol.Schema({
def setup(hass, config):
"""Set up the Amcrest IP Camera component."""
from amcrest import AmcrestCamera
from amcrest import AmcrestCamera, AmcrestError
hass.data[DATA_AMCREST] = {}
amcrest_cams = config[DOMAIN]
@@ -105,7 +106,7 @@ def setup(hass, config):
# pylint: disable=pointless-statement
camera.current_time
except (ConnectError, ConnectTimeout, HTTPError) as ex:
except AmcrestError as ex:
_LOGGER.error("Unable to connect to Amcrest camera: %s", str(ex))
hass.components.persistent_notification.create(
'Error: {}<br />'

View File

@@ -1,14 +1,16 @@
"""Support for Amcrest IP cameras."""
import asyncio
import logging
from homeassistant.components.amcrest import (
DATA_AMCREST, STREAM_SOURCE_LIST, TIMEOUT)
from homeassistant.components.camera import Camera
from homeassistant.components.camera import (
Camera, SUPPORT_STREAM)
from homeassistant.components.ffmpeg import DATA_FFMPEG
from homeassistant.const import CONF_NAME
from homeassistant.helpers.aiohttp_client import (
async_get_clientsession, async_aiohttp_proxy_web,
async_aiohttp_proxy_stream)
async_aiohttp_proxy_stream, async_aiohttp_proxy_web,
async_get_clientsession)
from . import DATA_AMCREST, STREAM_SOURCE_LIST, TIMEOUT
DEPENDENCIES = ['amcrest', 'ffmpeg']
@@ -43,12 +45,22 @@ class AmcrestCam(Camera):
self._stream_source = amcrest.stream_source
self._resolution = amcrest.resolution
self._token = self._auth = amcrest.authentication
self._snapshot_lock = asyncio.Lock()
def camera_image(self):
async def async_camera_image(self):
"""Return a still image response from the camera."""
# Send the request to snap a picture and return raw jpg data
response = self._camera.snapshot(channel=self._resolution)
return response.data
from amcrest import AmcrestError
async with self._snapshot_lock:
try:
# Send the request to snap a picture and return raw jpg data
response = await self.hass.async_add_executor_job(
self._camera.snapshot, self._resolution)
return response.data
except AmcrestError as error:
_LOGGER.error(
'Could not get camera image due to error %s', error)
return None
async def handle_async_mjpeg_stream(self, request):
"""Return an MJPEG stream."""
@@ -67,7 +79,7 @@ class AmcrestCam(Camera):
self.hass, request, stream_coro)
# streaming via ffmpeg
from haffmpeg import CameraMjpeg
from haffmpeg.camera import CameraMjpeg
streaming_url = self._camera.rtsp_url(typeno=self._resolution)
stream = CameraMjpeg(self._ffmpeg.binary, loop=self.hass.loop)
@@ -75,8 +87,9 @@ class AmcrestCam(Camera):
streaming_url, extra_cmd=self._ffmpeg_arguments)
try:
stream_reader = await stream.get_reader()
return await async_aiohttp_proxy_stream(
self.hass, request, stream,
self.hass, request, stream_reader,
self._ffmpeg.ffmpeg_stream_content_type)
finally:
await stream.close()
@@ -85,3 +98,13 @@ class AmcrestCam(Camera):
def name(self):
"""Return the name of this camera."""
return self._name
@property
def supported_features(self):
"""Return supported features."""
return SUPPORT_STREAM
@property
def stream_source(self):
"""Return the source of the stream."""
return self._camera.rtsp_url(typeno=self._resolution)

View File

@@ -2,9 +2,10 @@
from datetime import timedelta
import logging
from homeassistant.components.amcrest import DATA_AMCREST, SENSORS
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_NAME, CONF_SENSORS
from homeassistant.helpers.entity import Entity
from . import DATA_AMCREST, SENSORS
DEPENDENCIES = ['amcrest']

View File

@@ -1,11 +1,11 @@
"""Support for toggling Amcrest IP camera settings."""
import logging
from homeassistant.components.amcrest import DATA_AMCREST, SWITCHES
from homeassistant.const import (
CONF_NAME, CONF_SWITCHES, STATE_OFF, STATE_ON)
from homeassistant.const import CONF_NAME, CONF_SWITCHES, STATE_OFF, STATE_ON
from homeassistant.helpers.entity import ToggleEntity
from . import DATA_AMCREST, SWITCHES
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['amcrest']

View File

@@ -18,7 +18,7 @@ from homeassistant.helpers.dispatcher import (
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import async_track_point_in_utc_time
from homeassistant.util.dt import utcnow
from homeassistant.components.camera.mjpeg import (
from homeassistant.components.mjpeg.camera import (
CONF_MJPEG_URL, CONF_STILL_IMAGE_URL)
REQUIREMENTS = ['pydroid-ipcam==0.8']

View File

@@ -1,7 +1,7 @@
"""Support for Android IP Webcam binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST, CONF_NAME)
from . import CONF_HOST, CONF_NAME, DATA_IP_WEBCAM, KEY_MAP, AndroidIPCamEntity
DEPENDENCIES = ['android_ip_webcam']

View File

@@ -1,9 +1,10 @@
"""Support for Android IP Webcam sensors."""
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST,
CONF_NAME, CONF_SENSORS)
from homeassistant.helpers.icon import icon_for_battery_level
from . import (
CONF_HOST, CONF_NAME, CONF_SENSORS, DATA_IP_WEBCAM, ICON_MAP, KEY_MAP,
AndroidIPCamEntity)
DEPENDENCIES = ['android_ip_webcam']

View File

@@ -1,8 +1,9 @@
"""Support for Android IP Webcam settings."""
from homeassistant.components.switch import SwitchDevice
from homeassistant.components.android_ip_webcam import (
KEY_MAP, ICON_MAP, DATA_IP_WEBCAM, AndroidIPCamEntity, CONF_HOST,
CONF_NAME, CONF_SWITCHES)
from . import (
CONF_HOST, CONF_NAME, CONF_SWITCHES, DATA_IP_WEBCAM, ICON_MAP, KEY_MAP,
AndroidIPCamEntity)
DEPENDENCIES = ['android_ip_webcam']

View File

@@ -0,0 +1,6 @@
"""
Support for functionality to interact with Android TV and Fire TV devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.androidtv/
"""

View File

@@ -0,0 +1,468 @@
"""
Support for functionality to interact with Android TV and Fire TV devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.androidtv/
"""
import functools
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, SUPPORT_PLAY, SUPPORT_PREVIOUS_TRACK,
SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON,
SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_STEP)
from homeassistant.const import (
ATTR_COMMAND, ATTR_ENTITY_ID, CONF_DEVICE_CLASS, CONF_HOST, CONF_NAME,
CONF_PORT, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING,
STATE_STANDBY)
import homeassistant.helpers.config_validation as cv
ANDROIDTV_DOMAIN = 'androidtv'
REQUIREMENTS = ['androidtv==0.0.14']
_LOGGER = logging.getLogger(__name__)
SUPPORT_ANDROIDTV = SUPPORT_PAUSE | SUPPORT_PLAY | \
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
SUPPORT_NEXT_TRACK | SUPPORT_STOP | SUPPORT_VOLUME_MUTE | \
SUPPORT_VOLUME_STEP
SUPPORT_FIRETV = SUPPORT_PAUSE | SUPPORT_PLAY | \
SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_PREVIOUS_TRACK | \
SUPPORT_NEXT_TRACK | SUPPORT_SELECT_SOURCE | SUPPORT_STOP
CONF_ADBKEY = 'adbkey'
CONF_ADB_SERVER_IP = 'adb_server_ip'
CONF_ADB_SERVER_PORT = 'adb_server_port'
CONF_APPS = 'apps'
CONF_GET_SOURCES = 'get_sources'
CONF_TURN_ON_COMMAND = 'turn_on_command'
CONF_TURN_OFF_COMMAND = 'turn_off_command'
DEFAULT_NAME = 'Android TV'
DEFAULT_PORT = 5555
DEFAULT_ADB_SERVER_PORT = 5037
DEFAULT_GET_SOURCES = True
DEFAULT_DEVICE_CLASS = 'auto'
DEVICE_ANDROIDTV = 'androidtv'
DEVICE_FIRETV = 'firetv'
DEVICE_CLASSES = [DEFAULT_DEVICE_CLASS, DEVICE_ANDROIDTV, DEVICE_FIRETV]
SERVICE_ADB_COMMAND = 'adb_command'
SERVICE_ADB_COMMAND_SCHEMA = vol.Schema({
vol.Required(ATTR_ENTITY_ID): cv.entity_ids,
vol.Required(ATTR_COMMAND): cv.string,
})
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_DEVICE_CLASS, default=DEFAULT_DEVICE_CLASS):
vol.In(DEVICE_CLASSES),
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
vol.Optional(CONF_ADBKEY): cv.isfile,
vol.Optional(CONF_ADB_SERVER_IP): cv.string,
vol.Optional(CONF_ADB_SERVER_PORT, default=DEFAULT_ADB_SERVER_PORT):
cv.port,
vol.Optional(CONF_GET_SOURCES, default=DEFAULT_GET_SOURCES): cv.boolean,
vol.Optional(CONF_APPS, default=dict()):
vol.Schema({cv.string: cv.string}),
vol.Optional(CONF_TURN_ON_COMMAND): cv.string,
vol.Optional(CONF_TURN_OFF_COMMAND): cv.string
})
# Translate from `AndroidTV` / `FireTV` reported state to HA state.
ANDROIDTV_STATES = {'off': STATE_OFF,
'idle': STATE_IDLE,
'standby': STATE_STANDBY,
'playing': STATE_PLAYING,
'paused': STATE_PAUSED}
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])
if CONF_ADB_SERVER_IP not in config:
# Use "python-adb" (Python ADB implementation)
if CONF_ADBKEY in config:
aftv = setup(host, config[CONF_ADBKEY],
device_class=config[CONF_DEVICE_CLASS])
adb_log = " using adbkey='{0}'".format(config[CONF_ADBKEY])
else:
aftv = setup(host, device_class=config[CONF_DEVICE_CLASS])
adb_log = ""
else:
# Use "pure-python-adb" (communicate with ADB server)
aftv = setup(host, adb_server_ip=config[CONF_ADB_SERVER_IP],
adb_server_port=config[CONF_ADB_SERVER_PORT],
device_class=config[CONF_DEVICE_CLASS])
adb_log = " using ADB server at {0}:{1}".format(
config[CONF_ADB_SERVER_IP], config[CONF_ADB_SERVER_PORT])
if not aftv.available:
# Determine the name that will be used for the device in the log
if CONF_NAME in config:
device_name = config[CONF_NAME]
elif config[CONF_DEVICE_CLASS] == DEVICE_ANDROIDTV:
device_name = 'Android TV device'
elif config[CONF_DEVICE_CLASS] == DEVICE_FIRETV:
device_name = 'Fire TV device'
else:
device_name = 'Android TV / Fire TV device'
_LOGGER.warning("Could not connect to %s at %s%s",
device_name, host, adb_log)
return
if host in hass.data[ANDROIDTV_DOMAIN]:
_LOGGER.warning("Platform already setup on %s, skipping", host)
else:
if aftv.DEVICE_CLASS == DEVICE_ANDROIDTV:
device = AndroidTVDevice(aftv, config[CONF_NAME],
config[CONF_APPS],
config.get(CONF_TURN_ON_COMMAND),
config.get(CONF_TURN_OFF_COMMAND))
device_name = config[CONF_NAME] if CONF_NAME in config \
else 'Android TV'
else:
device = FireTVDevice(aftv, config[CONF_NAME], config[CONF_APPS],
config[CONF_GET_SOURCES],
config.get(CONF_TURN_ON_COMMAND),
config.get(CONF_TURN_OFF_COMMAND))
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)
hass.data[ANDROIDTV_DOMAIN][host] = device
if hass.services.has_service(ANDROIDTV_DOMAIN, SERVICE_ADB_COMMAND):
return
def service_adb_command(service):
"""Dispatch service calls to target entities."""
cmd = service.data.get(ATTR_COMMAND)
entity_id = service.data.get(ATTR_ENTITY_ID)
target_devices = [dev for dev in hass.data[ANDROIDTV_DOMAIN].values()
if dev.entity_id in entity_id]
for target_device in target_devices:
output = target_device.adb_command(cmd)
# log the output if there is any
if output and (not isinstance(output, str) or output.strip()):
_LOGGER.info("Output of command '%s' from '%s': %s",
cmd, target_device.entity_id, repr(output))
hass.services.register(ANDROIDTV_DOMAIN, SERVICE_ADB_COMMAND,
service_adb_command,
schema=SERVICE_ADB_COMMAND_SCHEMA)
def adb_decorator(override_available=False):
"""Send an ADB command if the device is available and catch exceptions."""
def _adb_decorator(func):
"""Wait if previous ADB commands haven't finished."""
@functools.wraps(func)
def _adb_exception_catcher(self, *args, **kwargs):
# If the device is unavailable, don't do anything
if not self.available and not override_available:
return None
try:
return func(self, *args, **kwargs)
except self.exceptions as err:
_LOGGER.error(
"Failed to execute an ADB command. ADB connection re-"
"establishing attempt in the next update. Error: %s", err)
self._available = False # pylint: disable=protected-access
return None
return _adb_exception_catcher
return _adb_decorator
class ADBDevice(MediaPlayerDevice):
"""Representation of an Android TV or Fire TV device."""
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.update(apps)
self._keys = KEYS
self.turn_on_command = turn_on_command
self.turn_off_command = turn_off_command
# ADB exceptions to catch
if not self.aftv.adb_server_ip:
# Using "python-adb" (Python ADB implementation)
from adb.adb_protocol import (InvalidChecksumError,
InvalidCommandError,
InvalidResponseError)
from adb.usb_exceptions import TcpTimeoutException
self.exceptions = (AttributeError, BrokenPipeError, TypeError,
ValueError, InvalidChecksumError,
InvalidCommandError, InvalidResponseError,
TcpTimeoutException)
else:
# Using "pure-python-adb" (communicate with ADB server)
self.exceptions = (ConnectionResetError, RuntimeError)
# Property attributes
self._available = self.aftv.available
self._current_app = None
self._state = None
@property
def app_id(self):
"""Return the current app."""
return self._current_app
@property
def app_name(self):
"""Return the friendly name of the current app."""
return self._apps.get(self._current_app, self._current_app)
@property
def available(self):
"""Return whether or not the ADB connection is valid."""
return self._available
@property
def name(self):
"""Return the device name."""
return self._name
@property
def should_poll(self):
"""Device should be polled."""
return True
@property
def state(self):
"""Return the state of the player."""
return self._state
@adb_decorator()
def media_play(self):
"""Send play command."""
self.aftv.media_play()
@adb_decorator()
def media_pause(self):
"""Send pause command."""
self.aftv.media_pause()
@adb_decorator()
def media_play_pause(self):
"""Send play/pause command."""
self.aftv.media_play_pause()
@adb_decorator()
def turn_on(self):
"""Turn on the device."""
if self.turn_on_command:
self.aftv.adb_shell(self.turn_on_command)
else:
self.aftv.turn_on()
@adb_decorator()
def turn_off(self):
"""Turn off the device."""
if self.turn_off_command:
self.aftv.adb_shell(self.turn_off_command)
else:
self.aftv.turn_off()
@adb_decorator()
def media_previous_track(self):
"""Send previous track command (results in rewind)."""
self.aftv.media_previous()
@adb_decorator()
def media_next_track(self):
"""Send next track command (results in fast-forward)."""
self.aftv.media_next()
@adb_decorator()
def adb_command(self, cmd):
"""Send an ADB command to an Android TV / Fire TV device."""
key = self._keys.get(cmd)
if key:
return self.aftv.adb_shell('input keyevent {}'.format(key))
if cmd == 'GET_PROPERTIES':
return self.aftv.get_properties_dict()
return self.aftv.adb_shell(cmd)
class AndroidTVDevice(ADBDevice):
"""Representation of an Android TV device."""
def __init__(self, aftv, name, apps, turn_on_command,
turn_off_command):
"""Initialize the Android TV device."""
super().__init__(aftv, name, apps, turn_on_command,
turn_off_command)
self._device = None
self._muted = None
self._device_properties = self.aftv.device_properties
self._unique_id = 'androidtv-{}-{}'.format(
name, self._device_properties['serialno'])
self._volume = None
@adb_decorator(override_available=True)
def update(self):
"""Update the device state and, if necessary, re-connect."""
# Check if device is disconnected.
if not self._available:
# Try to connect
self._available = self.aftv.connect(always_log_errors=False)
# To be safe, wait until the next update to run ADB commands.
return
# If the ADB connection is not intact, don't update.
if not self._available:
return
# Get the `state`, `current_app`, and `running_apps`.
state, self._current_app, self._device, self._muted, self._volume = \
self.aftv.update()
self._state = ANDROIDTV_STATES[state]
@property
def is_volume_muted(self):
"""Boolean if volume is currently muted."""
return self._muted
@property
def source(self):
"""Return the current playback device."""
return self._device
@property
def supported_features(self):
"""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."""
return self._volume
@adb_decorator()
def media_stop(self):
"""Send stop command."""
self.aftv.media_stop()
@adb_decorator()
def mute_volume(self, mute):
"""Mute the volume."""
self.aftv.mute_volume()
@adb_decorator()
def volume_down(self):
"""Send volume down command."""
self.aftv.volume_down()
@adb_decorator()
def volume_up(self):
"""Send volume up command."""
self.aftv.volume_up()
class FireTVDevice(ADBDevice):
"""Representation of a Fire TV device."""
def __init__(self, aftv, name, apps, get_sources,
turn_on_command, turn_off_command):
"""Initialize the Fire TV device."""
super().__init__(aftv, name, apps, turn_on_command,
turn_off_command)
self._get_sources = get_sources
self._running_apps = None
@adb_decorator(override_available=True)
def update(self):
"""Update the device state and, if necessary, re-connect."""
# Check if device is disconnected.
if not self._available:
# Try to connect
self._available = self.aftv.connect(always_log_errors=False)
# To be safe, wait until the next update to run ADB commands.
return
# If the ADB connection is not intact, don't update.
if not self._available:
return
# Get the `state`, `current_app`, and `running_apps`.
state, self._current_app, self._running_apps = \
self.aftv.update(self._get_sources)
self._state = ANDROIDTV_STATES[state]
@property
def source(self):
"""Return the current app."""
return self._current_app
@property
def source_list(self):
"""Return a list of running apps."""
return self._running_apps
@property
def supported_features(self):
"""Flag media player features that are supported."""
return SUPPORT_FIRETV
@adb_decorator()
def media_stop(self):
"""Send stop (back) command."""
self.aftv.back()
@adb_decorator()
def select_source(self, source):
"""Select input source.
If the source starts with a '!', then it will close the app instead of
opening it.
"""
if isinstance(source, str):
if not source.startswith('!'):
self.aftv.launch_app(source)
else:
self.aftv.stop_app(source[1:].lstrip())

View File

@@ -0,0 +1,11 @@
# Describes the format for available Android TV and Fire TV services
adb_command:
description: Send an ADB command to an Android TV / Fire TV device.
fields:
entity_id:
description: Name(s) of Android TV / Fire TV entities.
example: 'media_player.android_tv_living_room'
command:
description: Either a key command or an ADB shell command.
example: 'HOME'

View File

@@ -0,0 +1 @@
"""The anel_pwrctrl component."""

View File

@@ -0,0 +1 @@
"""The anthemav component."""

View File

@@ -18,7 +18,7 @@ from homeassistant.const import (
STATE_ON)
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['anthemav==1.1.8']
REQUIREMENTS = ['anthemav==1.1.10']
_LOGGER = logging.getLogger(__name__)

View File

@@ -6,7 +6,7 @@ import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.components import apcupsd
from homeassistant.const import (TEMP_CELSIUS, CONF_RESOURCES)
from homeassistant.const import (TEMP_CELSIUS, CONF_RESOURCES, POWER_WATT)
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
@@ -57,7 +57,7 @@ SENSOR_TYPES = {
'nombattv': ['Battery Nominal Voltage', 'V', 'mdi:flash'],
'nominv': ['Nominal Input Voltage', 'V', 'mdi:flash'],
'nomoutv': ['Nominal Output Voltage', 'V', 'mdi:flash'],
'nompower': ['Nominal Output Power', 'W', 'mdi:flash'],
'nompower': ['Nominal Output Power', POWER_WATT, 'mdi:flash'],
'nomapnt': ['Nominal Apparent Power', 'VA', 'mdi:flash'],
'numxfers': ['Transfer Count', '', 'mdi:counter'],
'outcurnt': ['Output Current', 'A', 'mdi:flash'],
@@ -93,7 +93,7 @@ INFERRED_UNITS = {
' Volts': 'V',
' Ampere': 'A',
' Volt-Ampere': 'VA',
' Watts': 'W',
' Watts': POWER_WATT,
' Hz': 'Hz',
' C': TEMP_CELSIUS,
' Percent Load Capacity': '%',

View File

@@ -168,11 +168,11 @@ class APIDiscoveryView(HomeAssistantView):
def get(self, request):
"""Get discovery information."""
hass = request.app['hass']
needs_auth = hass.config.api.api_password is not None
return self.json({
ATTR_BASE_URL: hass.config.api.base_url,
ATTR_LOCATION_NAME: hass.config.location_name,
ATTR_REQUIRES_API_PASSWORD: needs_auth,
# always needs authentication
ATTR_REQUIRES_API_PASSWORD: True,
ATTR_VERSION: __version__,
})

View File

@@ -0,0 +1 @@
"""The api_streams component."""

View File

@@ -0,0 +1 @@
"""The apns component."""

View File

@@ -9,13 +9,14 @@ import os
import voluptuous as vol
from homeassistant.helpers.event import track_state_change
from homeassistant.config import load_yaml_config_file
from homeassistant.components.notify import (
ATTR_TARGET, ATTR_DATA, BaseNotificationService, DOMAIN, PLATFORM_SCHEMA)
from homeassistant.const import CONF_NAME, CONF_PLATFORM, ATTR_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.const import ATTR_NAME, CONF_NAME, CONF_PLATFORM
from homeassistant.helpers import template as template_helper
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_state_change
from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, DOMAIN, PLATFORM_SCHEMA, BaseNotificationService)
REQUIREMENTS = ['apns2==0.3.0']

View File

@@ -1,8 +1,6 @@
"""Support for Apple TV media player."""
import logging
from homeassistant.components.apple_tv import (
ATTR_ATV, ATTR_POWER, DATA_APPLE_TV, DATA_ENTITIES)
from homeassistant.components.media_player import MediaPlayerDevice
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_TVSHOW, MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK,
@@ -14,6 +12,8 @@ from homeassistant.const import (
from homeassistant.core import callback
import homeassistant.util.dt as dt_util
from . import ATTR_ATV, ATTR_POWER, DATA_APPLE_TV, DATA_ENTITIES
DEPENDENCIES = ['apple_tv']
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,8 +1,8 @@
"""Remote control support for Apple TV."""
from homeassistant.components.apple_tv import (
ATTR_ATV, ATTR_POWER, DATA_APPLE_TV)
from homeassistant.components import remote
from homeassistant.const import (CONF_NAME, CONF_HOST)
from homeassistant.const import CONF_HOST, CONF_NAME
from . import ATTR_ATV, ATTR_POWER, DATA_APPLE_TV
DEPENDENCIES = ['apple_tv']

View File

@@ -4,12 +4,13 @@ import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_MONITORED_CONDITIONS,
TEMP_CELSIUS, TEMP_FAHRENHEIT)
from homeassistant.const import (
CONF_MONITORED_CONDITIONS, TEMP_CELSIUS, TEMP_FAHRENHEIT)
from homeassistant.core import callback
from homeassistant.helpers.entity import Entity
import homeassistant.components.aqualogic as aq
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from . import DOMAIN, UPDATE_TOPIC
_LOGGER = logging.getLogger(__name__)
@@ -46,7 +47,7 @@ async def async_setup_platform(
"""Set up the sensor platform."""
sensors = []
processor = hass.data[aq.DOMAIN]
processor = hass.data[DOMAIN]
for sensor_type in config.get(CONF_MONITORED_CONDITIONS):
sensors.append(AquaLogicSensor(processor, sensor_type))
@@ -95,7 +96,7 @@ class AquaLogicSensor(Entity):
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
aq.UPDATE_TOPIC, self.async_update_callback)
UPDATE_TOPIC, self.async_update_callback)
@callback
def async_update_callback(self):

View File

@@ -3,11 +3,12 @@ import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
import homeassistant.components.aqualogic as aq
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import (CONF_MONITORED_CONDITIONS)
import homeassistant.helpers.config_validation as cv
from . import DOMAIN, UPDATE_TOPIC
DEPENDENCIES = ['aqualogic']
@@ -37,7 +38,7 @@ async def async_setup_platform(
"""Set up the switch platform."""
switches = []
processor = hass.data[aq.DOMAIN]
processor = hass.data[DOMAIN]
for switch_type in config.get(CONF_MONITORED_CONDITIONS):
switches.append(AquaLogicSwitch(processor, switch_type))
@@ -101,7 +102,7 @@ class AquaLogicSwitch(SwitchDevice):
async def async_added_to_hass(self):
"""Register callbacks."""
self.hass.helpers.dispatcher.async_dispatcher_connect(
aq.UPDATE_TOPIC, self.async_update_callback)
UPDATE_TOPIC, self.async_update_callback)
@callback
def async_update_callback(self):

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