Compare commits

..

916 Commits

Author SHA1 Message Date
Paulus Schoutsen
50714fbedf Merge pull request #30064 from home-assistant/rc
0.103.2
2019-12-19 08:03:47 +01:00
Paulus Schoutsen
c9de5b9fef Bumped version to 0.103.2 2019-12-19 07:53:38 +01:00
Paulus Schoutsen
aae80dca1c Fix recursion 2019-12-19 07:53:32 +01:00
Paulus Schoutsen
82a5c23c9c Merge pull request #30056 from home-assistant/rc
0.103.1
2019-12-18 22:15:02 +01:00
Paulus Schoutsen
952b21facc Bumped version to 0.103.1 2019-12-18 21:24:39 +01:00
Aaron Bach
9f64656603 Bump simplisafe-python to 5.3.6 (#30055) 2019-12-18 21:23:57 +01:00
Andrew Onyshchuk
6d06cec0e0 Fix support for legacy Z-Wave thermostats (#29955)
This brings back support for Z-Wave thermostats
of SETPOINT_THERMOSTAT specific device class.
Such devices don't have COMMAND_CLASS_THERMOSTAT_MODE
and are now handled separately.
2019-12-18 21:19:59 +01:00
Chris Mandich
9836e78120 Fix loading flume integration (#29926)
* Fix https://github.com/home-assistant/home-assistant/issues/29853

* Run script.gen_requirements

* Update to store Token File in config directory

* Update to store Token File in config directory

* Update to store Token File in config directory
2019-12-18 21:18:49 +01:00
Justin Bassett
f1d22db009 Fix mobile app device identifiers (#29920)
Fix identifiers when updating device registration.
2019-12-18 21:18:49 +01:00
Anders Melchiorsen
24c87638e6 Support entity_id: all in lifx.set_state (#29919) 2019-12-18 21:18:48 +01:00
springstan
9b65d83e28 Fix setup error for logbook (#29908)
* Fix setup error by moving an import back into the setup function

* Revert c741664d4d

* Add homekit as after_dependency to logbook manifest.json
2019-12-18 21:18:10 +01:00
springstan
29e412a6c4 Fix setup for tank_utility component (#29902) 2019-12-18 21:17:26 +01:00
Aaron Bach
a466ae0279 Bump aioambient to 1.0.2 (#29850) 2019-12-18 21:17:25 +01:00
Paulus Schoutsen
628a148944 Install requirements of after_dependencies when loading integrations (#29491)
* Install requirements of after_dependencies when loading integrations

* Fix smartthings test
2019-12-18 21:17:24 +01:00
Paulus Schoutsen
87164e2129 Bumped version to 0.103.0 2019-12-11 15:55:23 +01:00
Pascal Vizeli
ce041f131e Remove uvloop event policy (#29835)
* Remove uvloop event policy

* Clean tests

* Fix lint

* Cleanup statment
2019-12-11 15:55:09 +01:00
Robert Svensson
2fb36d3dea UniFi - Handle disabled switches (#29824) 2019-12-11 15:55:09 +01:00
Robert Svensson
4dd1c51186 UniFi - honor detection time when UniFi wire bug happens (#29820) 2019-12-11 15:55:08 +01:00
Robert Svensson
4c9c22bc3a Add more logging to help future debug situations (#29800) 2019-12-11 15:55:07 +01:00
springstan
0cb9d0746a Add user-agent to fix dwd_weather_warnings setup error (#29596)
* Added dummy user-agent to http request to fix setup error

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

* Adjust comment and rename user-agent constant
2019-12-11 15:52:10 +01:00
Paulus Schoutsen
302d5d66ab Bumped version to 0.103.0b1 2019-12-10 13:05:22 +01:00
Brett T. Warden
807badea93 Bump Roku to 4.0.0 (#29809) 2019-12-10 13:05:17 +01:00
Bram Kragten
d53c6be50a Updated frontend to 20191204.1 (#29787) 2019-12-10 13:05:16 +01:00
Pascal Vizeli
19920e48ba HomeAssistant-pyozw 0.1.7 (#29743) 2019-12-10 13:04:07 +01:00
Nikolay Vasilchuk
70fe5d3238 Fix unit_of_measurement for Starline temperature sensors (#29740) 2019-12-10 13:04:06 +01:00
Robert Svensson
f7015703bb Only update disabled_by when enabled default and entity enabled states differ (#29643) 2019-12-10 13:04:05 +01:00
Santobert
90de5652b9 Change source of device_info (#29570) 2019-12-10 13:04:04 +01:00
Ville Skyttä
2d6599fdd2 Huawei LTE device tracker fixes (#29551)
* Include MAC address in device state attributes for absent devices too

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

* Fix initialization of known entities

Closes https://github.com/home-assistant/home-assistant/issues/29354
2019-12-10 13:04:03 +01:00
Malte Franken
d9280330a6 Bump georss_generic_client to 0.3 (#29532)
* bump version of georss_generic_client library

* updated requirements
2019-12-10 13:04:02 +01:00
tetienne
a4fc4bb281 Increase somfy SCAN_INTERVAL (#29524)
- There was too many errors 504
2019-12-10 13:04:01 +01:00
David K
22e7ece315 Limit available heat/cool modes for HomeKit thermostats (#28586)
* Limit available heat/cool modes for HomeKit thermostats.
The Home app only shows appropriate modes (heat/cool/auto) for the device. Depending on the climate integration, disabling the auto start might be needed.

* Include improved mapping for HVAC modes in tests
2019-12-10 13:04:01 +01:00
Paulus Schoutsen
f10076a4ad Bumped version to 0.103.0b0 2019-12-04 22:52:20 -08:00
Paulus Schoutsen
1646aab36d Version bump to 0.103.0dev0 2019-12-04 22:51:53 -08:00
Paulus Schoutsen
6885167fcc Merge remote-tracking branch 'origin/master' into dev 2019-12-04 22:51:08 -08:00
Daniel Perna
c6ac2a5705 Update pyhomematic (#29477) 2019-12-04 22:50:18 -08:00
Rohan Kapoor
b2d5de6a79 Switch iperf3 to generate a new client every time it runs a test (#29495)
* Switch iperf3 to generate a new client every time it runs a test

* Add myself to CODEOWNERS

* Fix imperative mood
2019-12-04 22:49:26 -08:00
Paulus Schoutsen
dad11f8208 Fix tests & lint 2019-12-04 22:47:40 -08:00
Paulus Schoutsen
28e9f1d0b8 Fix deconz import 2019-12-04 21:57:08 -08:00
Paulus Schoutsen
41440d4f1b Fix litejet tests 2019-12-04 21:47:35 -08:00
springstan
52926f1961 Move imports to top for canary (#29449) 2019-12-04 21:30:22 -08:00
springstan
d70ad369de Move imports to top for asuswrt (#29436) 2019-12-04 21:24:20 -08:00
springstan
f874a9df13 Move imports to top for clementine (#29437) 2019-12-04 21:24:08 -08:00
springstan
69ae469148 Move imports to top for deluge (#29438) 2019-12-04 21:23:56 -08:00
springstan
4c0f73a2b9 Move imports to top for datadog (#29440) 2019-12-04 21:23:17 -08:00
springstan
2773328134 Move imports to top for directv (#29441) 2019-12-04 21:23:05 -08:00
springstan
5ee20b61b3 Move imports to top for doorbird (#29442) 2019-12-04 21:22:51 -08:00
springstan
27200865ee Move imports to top for dlink (#29443) 2019-12-04 21:22:37 -08:00
springstan
50ee0c6727 Move imports to top for dunehd (#29444) 2019-12-04 21:22:27 -08:00
springstan
f2a08c438b Move imports to top for duke_energy (#29445) 2019-12-04 21:22:14 -08:00
Anders Melchiorsen
94297e96cb Update eternalegypt to 0.0.11 (#29446) 2019-12-04 21:22:03 -08:00
springstan
b2cce05405 Move imports to top for eight_sleep (#29447) 2019-12-04 21:21:50 -08:00
springstan
85e188db52 Move imports to top for egardia (#29448) 2019-12-04 21:21:40 -08:00
springstan
10759b7ca6 Move imports to top for enphase_envoy (#29450) 2019-12-04 21:21:25 -08:00
springstan
0158f29e4e Move imports to top for envisalink (#29457) 2019-12-04 21:21:12 -08:00
springstan
5586f40ab0 Move imports to top for enocean (#29451) 2019-12-04 21:20:26 -08:00
springstan
cdf53aed93 Move imports to top for enigma2 (#29452) 2019-12-04 21:20:11 -08:00
springstan
f422cdbfef Move imports to top for eq3btsmart (#29456) 2019-12-04 21:20:01 -08:00
springstan
06a156c091 Move imports to top for emby (#29453) 2019-12-04 21:19:43 -08:00
Ville Skyttä
ebc9d17558 Fix setup of Huawei LTE for which we can't get a MAC address (#29455)
Closes https://github.com/home-assistant/home-assistant/issues/29188
2019-12-04 21:19:25 -08:00
springstan
6c863a8948 Move imports to top for sonarr (#29462) 2019-12-04 21:18:57 -08:00
springstan
58ba6052e2 Move imports to top for environment_canada (#29458) 2019-12-04 21:18:52 -08:00
springstan
a4ac5dc6b8 Move imports to top for entur_public_transport (#29459) 2019-12-04 21:18:29 -08:00
springstan
24878f109c Move imports to top for solaredge (#29463) 2019-12-04 21:18:12 -08:00
springstan
dbd231b3a0 Move imports to top for somfy_mylink (#29464) 2019-12-04 21:17:45 -08:00
springstan
270d97d789 Move imports to top for daikin (#29490) 2019-12-04 21:17:33 -08:00
springstan
89c7629215 Move imports to top for deconz (#29489) 2019-12-04 21:17:18 -08:00
springstan
8647ba3dd5 Move imports to top for emulated_hue (#29488) 2019-12-04 21:16:51 -08:00
springstan
f5550509d4 Move imports to top for geo_json_events (#29486) 2019-12-04 21:16:25 -08:00
springstan
bbe57d6673 Move imports to top for history (#29484) 2019-12-04 21:15:39 -08:00
springstan
95de802fbd Move imports to top for hlk_sw16 (#29483) 2019-12-04 21:15:18 -08:00
springstan
3e634aaf5d Move imports to top for logi_circle (#29482) 2019-12-04 21:14:57 -08:00
springstan
81e4e9e26b Move imports to top for mailgun (#29480) 2019-12-04 21:14:39 -08:00
springstan
12e1c695ca Move imports to top for mfi (#29479) 2019-12-04 21:14:26 -08:00
springstan
7df4c1e676 Move imports to top for mhz19 (#29478) 2019-12-04 21:14:03 -08:00
springstan
653e0078a4 Move imports to top for skybell (#29475) 2019-12-04 21:13:49 -08:00
springstan
c6066d8b98 Move imports to top for ring (#29474) 2019-12-04 21:13:28 -08:00
springstan
c02d551cd5 Move imports to top for random (#29473) 2019-12-04 21:13:05 -08:00
springstan
d9661b408b Move imports to top for rainmachine (#29472) 2019-12-04 21:12:44 -08:00
springstan
c6b8d35c16 Move imports to top for ps4 (#29471) 2019-12-04 21:12:26 -08:00
springstan
43665466f5 Move imports to top for point (#29470) 2019-12-04 21:12:09 -08:00
springstan
96cf20ad81 Move imports to top for zoneminder (#29468) 2019-12-04 21:11:30 -08:00
springstan
72995f6ce6 Move imports to top for tuya (#29467) 2019-12-04 21:11:13 -08:00
springstan
5573504508 Move imports to top for litejet (#29481) 2019-12-04 21:08:22 -08:00
Bram Kragten
b829c46e18 Updated frontend to 20191204.0 (#29461) 2019-12-04 11:28:23 -08:00
springstan
a2a3c50555 Move imports to top for danfoss_air (#29435) 2019-12-04 20:27:51 +01:00
springstan
f8d607bdf5 Move imports to top for fixer (#29430)
* Move imports to top for fixer

* Only import FixerioException instead of all exceptions
2019-12-04 17:08:22 +01:00
springstan
0d1a389602 Move imports to top for etherscan (#29426) 2019-12-04 15:21:18 +01:00
springstan
af18c668d2 Move imports to top for familyhub (#29427) 2019-12-04 15:20:50 +01:00
springstan
4b6a2496c7 Move imports to top for fastdotcom (#29428) 2019-12-04 15:20:14 +01:00
springstan
12791a687b Move imports to top for fints (#29429) 2019-12-04 15:19:03 +01:00
springstan
c6ad57eb2b Move imports to top for fleetgo (#29431) 2019-12-04 15:15:30 +01:00
springstan
9bb6bcad70 Move imports to top for gearbest (#29432) 2019-12-04 15:14:46 +01:00
springstan
bef1c00b49 Move imports to top for hunterdouglas_powerview (#29420) 2019-12-04 14:15:39 +01:00
springstan
c880f09714 Move imports to top for horizon (#29419)
* Move imports to top for horizon

* Fix Pylint redefining name keys
2019-12-04 14:15:17 +01:00
springstan
46c306685d Move imports to top for hikvision (#29417) 2019-12-04 14:14:49 +01:00
springstan
c79e99318d Move imports to top for habitica (#29416) 2019-12-04 14:14:19 +01:00
springstan
d8dcf17cb5 Move imports to top for gstreamer (#29415) 2019-12-04 14:12:27 +01:00
springstan
4a7004b791 Move imports to top for greeneye_monitor (#29414) 2019-12-04 14:12:07 +01:00
springstan
88c1a630d8 Move imports to top for gpmdp (#29413) 2019-12-04 14:11:47 +01:00
springstan
95bc97fb6a Move imports to top for homeworks (#29418) 2019-12-04 14:11:14 +01:00
springstan
e6f7cbe53e Move imports to top for gitter (#29412) 2019-12-04 14:10:47 +01:00
springstan
6f5b59da15 Move imports to top for ialarm (#29422) 2019-12-04 14:10:15 +01:00
springstan
497674835b Move imports to top for ihc (#29425) 2019-12-04 14:09:57 +01:00
springstan
f4f4c695d9 Move imports to top for hydrawise (#29421) 2019-12-04 14:09:35 +01:00
springstan
c159ad52a4 Move imports to top for gogogate2 (#29411)
* Move imports to top for gogogate2

* Isorted imports
2019-12-04 14:09:04 +01:00
springstan
6c45c1969b Move imports to top for idteck_prox (#29423) 2019-12-04 14:08:01 +01:00
springstan
56b60577de Move imports to top for iglo (#29424) 2019-12-04 14:07:36 +01:00
Fabian Affolter
992d9273bb Upgrade psutil to 5.6.7 (#29407) 2019-12-04 11:45:56 +01:00
springstan
73e25296ca Move imports to top for joaoapps_join (#29402) 2019-12-04 11:18:05 +01:00
springstan
e04a208af0 Move imports to top for irish_rail_transport (#29401) 2019-12-04 11:17:38 +01:00
springstan
45c7c7a439 Move imports to top for keenetic-ndms2 (#29400) 2019-12-04 11:17:20 +01:00
springstan
a24e7832b5 Move imports to top for modem_callerid (#29396) 2019-12-04 11:16:58 +01:00
springstan
048068307d Move imports to top for microsoft (#29395) 2019-12-04 11:16:35 +01:00
springstan
518ca3afa7 Move imports to top for meteo_france (#29394) 2019-12-04 11:16:16 +01:00
springstan
849d8c885d Move imports to top for maxcube (#29393) 2019-12-04 11:15:53 +01:00
springstan
d79d9e0bfb Move imports to top for matrix (#29392) 2019-12-04 11:15:29 +01:00
springstan
c6fd8582a9 Move imports to top for lyft (#29391) 2019-12-04 11:14:35 +01:00
springstan
025c1a39a7 Move imports to top for lutron_caseta (#29390) 2019-12-04 11:14:07 +01:00
springstan
1a51590711 Move imports to top for lutron (#29389) 2019-12-04 11:13:46 +01:00
springstan
49232332a1 Move imports to top for luci (#29388) 2019-12-04 11:13:22 +01:00
springstan
695ec0c219 Move imports to top for london_underground (#29387) 2019-12-04 11:13:07 +01:00
springstan
7aab0d0aa0 Move imports to top for limitlessled (#29386) 2019-12-04 11:12:32 +01:00
springstan
cfe920079c Move imports to top for lightwave (#29385) 2019-12-04 11:12:03 +01:00
springstan
3dc629db08 Move imports to top for lg_netcast (#29384) 2019-12-04 11:11:42 +01:00
springstan
c3453be17b Move imports to top for lauch_library (#29383) 2019-12-04 11:11:21 +01:00
springstan
c0c1d68858 Move imports to top for iota (#29399) 2019-12-04 11:10:28 +01:00
springstan
1d65670a71 Move imports to top for kiwi (#29403) 2019-12-04 10:50:44 +01:00
springstan
fd107f2b2e Move imports to top for kwb (#29404) 2019-12-04 10:50:22 +01:00
springstan
2df189b58e Move imports to top for lacrosse (#29405) 2019-12-04 10:49:55 +01:00
springstan
09e2be02d3 Move imports to top for lametric (#29406) 2019-12-04 10:49:33 +01:00
Paulus Schoutsen
f6780c1fa2 Allow negative altitude in location updates (#29381) 2019-12-03 22:39:12 -08:00
HomeAssistant Azure
a1a131334a [ci skip] Translation update 2019-12-04 00:32:11 +00:00
springstan
0416e5b0fc Move imports to top for openhome (#29369) 2019-12-03 15:47:22 -08:00
springstan
3205afe74e Move imports to top for nuimo_controller (#29367) 2019-12-03 15:47:11 -08:00
springstan
bd1e5fce27 Move imports to top for noaa_tides (#29366) 2019-12-03 15:47:00 -08:00
springstan
3ddd20159c Move imports to top for nmbs (#29365) 2019-12-03 15:46:48 -08:00
springstan
564c468c26 Move imports to top for nmap_tracker (#29364) 2019-12-03 15:46:38 -08:00
springstan
bc635120fa Move imports to top for netio (#29363) 2019-12-03 15:46:26 -08:00
springstan
4130f2ff1a Move imports to top for netdata (#29362) 2019-12-03 15:46:16 -08:00
springstan
b462c539eb Move imports to top for n26 (#29357) 2019-12-03 15:46:07 -08:00
springstan
01bc1e4c66 Move imports to top for nad (#29358) 2019-12-03 15:45:56 -08:00
springstan
0e223662a9 Move imports to top for nanoleaf (#29359) 2019-12-03 15:45:46 -08:00
springstan
4989d1e7a9 Move imports to top for nederlandse_spoorwegen (#29360) 2019-12-03 15:45:36 -08:00
springstan
c9c41260b2 Move imports to top for nello (#29361) 2019-12-03 15:45:24 -08:00
springstan
be316af303 Move imports to top for mystrom (#29356) 2019-12-03 15:44:50 -08:00
springstan
9d213e70f0 Move imports to top for opensensemap (#29370) 2019-12-03 15:44:04 -08:00
Paulus Schoutsen
e26eebfc19 Remove cloud dependency from mobile_app (#29373) 2019-12-03 15:43:48 -08:00
Heine Furubotten
98b6905738 Upgrade enturclient to 0.2.1 (#29375) 2019-12-03 15:42:45 -08:00
springstan
bbf99c61fa Move imports to top for mycroft (#29355) 2019-12-03 15:42:21 -08:00
springstan
655780447c Move imports to top for nut (#29368) 2019-12-03 18:19:43 -05:00
springstan
f220c73e8f Move imports to top for orvibo (#29371) 2019-12-03 18:16:57 -05:00
springstan
f8ffcd6caf Move imports to top for opple (#29372) 2019-12-03 18:15:42 -05:00
Paulus Schoutsen
eef91f843d Rendering complex template objects to leave non-template values alone (#29353) 2019-12-03 14:15:45 -08:00
springstan
b1b784484e Move imports to top for owlet (#29352) 2019-12-03 14:13:37 -08:00
springstan
4f8200d15a Ignore state of climate entities in prometheus (#29346) 2019-12-03 12:54:25 -08:00
Luca Angemi
cae802f7ee Include telegram_bot message id for all messages (#29315)
* Include telegram_bot message id for all messages

* Update __init__.py
2019-12-03 12:51:45 -08:00
springstan
25b6740466 Move imports to top for pencom (#29348) 2019-12-03 19:02:09 +01:00
springstan
078e907178 Move imports to top for pushetta (#29332)
* Move imports to top for pushetta

* Make Pushetta.exceptions import lowercase and snakecase
2019-12-03 12:23:41 +01:00
Pascal Vizeli
e9647f8814 Update ozw 0.1.6 2019-12-03 10:51:46 +00:00
Pascal Vizeli
841ce8ade9 Fix uvloop warning (#29341) 2019-12-03 11:08:28 +01:00
Joakim Plate
26b63e73ad Add initial test suite for arcam_fmj integration (#29335)
* Add initial tests

* Adjust test

* Typo
2019-12-02 22:52:25 -08:00
Joakim Plate
4191d9ca8d Report unavailable entities to google (#28501)
* Report unavailable entites to google.

Entities should only removed when removed from HA. Removing a temporarily unavailable entity from google causes it to need to re-configured once it become available again.

* Fix test for unavailable entities
2019-12-02 22:14:16 -08:00
Paulus Schoutsen
32e04e1dce Lint 2019-12-02 22:08:19 -08:00
Joakim Plate
2569c4ae37 Google assistant storage of connected agents (#29158)
* Make async_report_state take agent_user_id

* Attempt to store synced agents

* Drop now not needed initialization

* Make sure cloud uses the all sync on changed preferences

* Some more places to use all version of sync

* Get the agent_user_id from the request context if available

* Minor cleanup

* Remove the old fixed agent_user_id for cloud

Instead pass along cloud_user where appropriate.

* async_delay_save takes a function

* Adjust test for delayed store

* Remove unused save function

* Add login check.
2019-12-02 22:05:59 -08:00
Andy Loughran
434b783b4c Update heatmiserv3 integration (#29006)
* Updated heatmiserV3 initial commit

* Fixing heatmiser component

* Updated codeowners and heatmiserV3 version

* Updating files as part of PR process

* Removed extra _LOGGER statements.

* Added in HVAC_MODE_OFF to allowed states to track whether heating on/off

* Handling PR comments

* Removed legacy tests

* fixing pylint errors

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/heatmiser/climate.py

Removed .get from config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Updated climate based on latest feedback

* Removed cast to int and update requirements

* Update requirements

* Updated heatmiser deps
2019-12-03 06:48:51 +01:00
HomeAssistant Azure
d5ee34e504 [ci skip] Translation update 2019-12-03 00:32:23 +00:00
Paulus Schoutsen
02d9ed5e36 Do not select all entities when omitting entity ID in service call (#29178)
* Do not select all entities when omitting entity ID

* Address comments Matthew

* Require either area_id or entity_id

* Fix tests

* Fix test
2019-12-02 16:23:12 -08:00
Marius
9587afc5ce delete incorrect "mdi:brightness-3" (#29309)
delete incorrect 'mdi:brightness-3' in final 
```
def icon(self):
        """Icon to use in the frontend, if any."""
        return MOON_ICONS.get(self.state, "mdi:brightness-3")
```

which still shows in the sensors attributes
2019-12-02 16:19:56 -08:00
Franck Nijhof
76aaf8b560 Improve WLED white value support for RGBW strips (#29312) 2019-12-02 16:12:18 -08:00
springstan
8f608608ed Move imports to top for radarr (#29322) 2019-12-02 16:11:22 -08:00
springstan
141fd1bffd Move imports to top for qwikswitch (#29328) 2019-12-02 16:11:10 -08:00
Alain Turbide
83b21651ce Add alexa check for "name" channelMetadata attribute (#29279)
* Added check for "name" channelMetada attribute

* Added/changed smart home media player tests for added value name in chanelMetadata payload section

* Since Alexa only expects a number/callSign/affiliate in the returned response, returning "name" is not technically valid.  Modified to return the value in the callSign field  instead since it's a text value. Since there is no returned channel number, cannot return a true numeric value in "channel" field
2019-12-02 16:10:44 -08:00
Abílio Costa
9811d63d78 Improve Alexa interface selection for binary sensors (#29120)
* Improve Alexa interface selection for binary sensors

This allows the sensor to work correctly as a contact or motion sensor
in alexa, if the user overrides its display category as such.

* add tests
2019-12-02 16:02:17 -08:00
springstan
9160d43a08 Move imports to top for rachio (#29323) 2019-12-03 00:59:13 +01:00
springstan
bacc549576 Move imports to top for plum_lightpad (#29324) 2019-12-03 00:58:18 +01:00
springstan
55ba956d3d Move imports to top for qbittorrent (#29325) 2019-12-03 00:57:47 +01:00
springstan
61cb0924db Move imports to top for qnap (#29326) 2019-12-03 00:56:58 +01:00
springstan
1adcdad5a4 Move imports to top for quantum_gateway (#29327) 2019-12-03 00:56:08 +01:00
springstan
372aa312e1 Move imports to top for prezzibenzina (#29329) 2019-12-03 00:54:17 +01:00
springstan
9868161821 Move imports to top for postnl (#29330) 2019-12-03 00:53:42 +01:00
springstan
8baba2e33d Move imports to top for python_script (#29331) 2019-12-03 00:53:04 +01:00
Felipe Martins Diel
5a24dbf599 Broadlink remote (#26528)
* Add broadlink remote control platform

* Fix order of the imports

* Add remote.py to .coveragerc

* Optimize MAC address validation

* Use storage helper class and improve code readability

* Add me to the manifest as a code owner

* Fix dosctring

* Add me to the code owners

* Remove storage schemas, rename storage keys and improve readability
2019-12-02 13:20:36 -08:00
NobleKangaroo
67498595e4 Add Emulated Hue code owner (#29319) 2019-12-02 21:29:31 +01:00
Raman Gupta
040fd9c258 Update service domains for xiaomi_miio from base domains to xiaomi_miio domain (#29134)
* move service constants to const.py, move all custom xiaomi_miio services to xiaomi_miio domain

* update service names

* try to fix black error

* try black formatting again

* final black formatting attempt

* update service names to reflect platform

* fix typo
2019-12-02 11:49:39 -08:00
Paulus Schoutsen
ffaa0e572a Inline MQTT paho imports (#29177)
* Inline MQTT paho imports

* Address comments

* Fix patch paths

* Move other imports inline

* Fix test
2019-12-02 11:32:02 -08:00
Christian Ferbar
1804c6edc5 Clear miflora sensor state on exception (#29276)
* Clear state on exception

Clear state if querying the device fails. The state is then set to unknown, so it can be tracked if a miflora device isn't responding any more.

* Add available()

Signal valid data via available()
2019-12-02 11:24:16 -08:00
Paulus Schoutsen
9771826ed6 Add capability-attributes (#29306) 2019-12-02 11:15:50 -08:00
springstan
b28bc1d6fb Add name option to season sensor (#29302)
* Add name option to season sensor

* Changed DEFAULT_NAME from season to Season
2019-12-02 12:00:07 +01:00
NobleKangaroo
3f2b6bfaa4 Overhaul Emulated Hue (#28317)
* Emulated Hue Overhaul

* Fix erroneous merge

* Remove unused code

* Modernize string format
2019-12-01 21:00:22 -08:00
HomeAssistant Azure
19241f421b [ci skip] Translation update 2019-12-02 00:32:37 +00:00
Paulus Schoutsen
d1aa0cea97 Move intent registration to own integration (#29280)
* Move intent registration to own integration.

* Lint
2019-12-01 14:12:57 -08:00
Bram Kragten
d91dd68b31 Limit parallel requests to Philips Hue (#29189)
* Limit parallel requests to Philips Hue

* Fix tests

* Remove loop

* Update homeassistant/components/hue/bridge.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>
2019-12-01 13:24:16 -08:00
Ville Skyttä
a9baa24fda Improve naming and attrs of hostnameless Huawei LTE device tracker entities (#29281) 2019-12-01 20:58:31 +01:00
springstan
22225cea4d Move imports to top for seventeentrack (#29264)
* Move imports to top for seventeentrack

* Updated patch target path in test_sensor.py
2019-12-01 10:19:17 -07:00
Ville Skyttä
9927f6c17d Upgrade mypy to 0.750 (#29294)
https://mypy-lang.blogspot.com/2019/11/mypy-0.html
2019-12-01 17:58:26 +01:00
Andreas Oberritter
64628c1f70 Add ATEN PE component for ATEN eco PDUs (#27960)
* Add ATEN PE component for ATEN eco PDUs

* aten_pe: Require host configuration

* aten_pe: Do not import from other integrations

* aten_pe: Include unnamed outlets

* aten_pe: Avoid get() for config entries having default values

* aten_pe: Fix documentation URI

* aten_pe: Remove unused return value

* aten_pe: Update atenpdu lib to 0.2.0 for asyncio

* aten_pe: Raise exception if initialization fails

* aten_pe: Update atenpdu lib to 0.3.0 for improved exception handling
2019-12-01 17:46:12 +01:00
springstan
6c9291c7a6 Move imports to top for raspyrfm (#29284) 2019-12-01 15:25:57 +01:00
springstan
a0a348a200 Move imports to top for recswitch (#29285) 2019-12-01 15:24:48 +01:00
springstan
d0ed9b32ac Move imports to top for remote_rpi_gpio (#29286) 2019-12-01 15:24:11 +01:00
springstan
e2e53be5ac Move imports to top for ripple (#29287) 2019-12-01 15:23:18 +01:00
Daniel Høyer Iversen
3c9d2b552e Upgrade Tibber library (#29290) 2019-12-01 14:20:27 +01:00
springstan
8fbfb6bf8c Move imports to top for rocketchat (#29288) 2019-12-01 12:04:47 +01:00
springstan
84d6a5369f Move imports to top for raincloud (#29283) 2019-12-01 12:04:12 +01:00
springstan
9f649ed345 Move imports to top for roku (#29289) 2019-12-01 12:03:51 +01:00
Ville Skyttä
5c8a8a631c Add Huawei LTE binary sensor support, mobile connection sensor (#28226)
* Add Huawei LTE binary sensor support, mobile connection sensor

* Improve mobile connection sensor icon docstring

* Remove device class for permission to use a more descriptive icon
2019-11-30 22:09:08 -08:00
jjlawren
6a02c6540e Stop Plex config flow imports where more user input needed (#29241)
* Abort imports that require user interaction, update logs and tests

* Disable lint
2019-11-30 22:07:12 -08:00
springstan
c4c8a1ba2d Move imports to top for sense (#29258) 2019-11-30 21:35:45 -08:00
Bram Kragten
2bdf7fc8f5 Fix Hue linking with non ASCII chars in location (#29213)
* Fix Hue linking with non ASCII chars in location

* Use slugify
2019-11-30 21:33:11 -08:00
springstan
8908dba5b4 Add device trigger for alarm_control_panel (#29068)
* Added device trigger to alarm control panel

* Added supported features to check that device has certain trigger

* Fixed tests for device_trigger

* Fixed pylint error

* Removed pending trigger and removed trigger condition
2019-11-30 21:30:51 -08:00
Franck Nijhof
d5efd0b352 Fix Espalexa being detected as Hue Bridge (#29237) 2019-11-30 21:28:42 -08:00
Santobert
c0619944fa Neato reduce API calls (#29156)
* initial commit

* Fix a bug where some values are not available

* Workaround if git_robot_info() is not available
2019-11-30 21:26:44 -08:00
springstan
bb46918d2e Move imports to top for scsgate (#29257) 2019-11-30 21:24:54 -08:00
springstan
1560d84cd7 Move imports to top for sisyphus (#29252) 2019-11-30 21:24:38 -08:00
springstan
8da7f40736 Move imports to top for smarty (#29251) 2019-11-30 21:24:17 -08:00
springstan
bea5d18c4a Move imports to top for sochain (#29250) 2019-11-30 21:23:59 -08:00
springstan
6726c4c76b Move imports to top for spider (#29249) 2019-11-30 21:23:48 -08:00
springstan
9fbb345ce0 Move imports to top for tradfri (#29247) 2019-11-30 21:23:39 -08:00
springstan
93150f6f94 Move imports to top for sensehat (#29259) 2019-11-30 21:23:09 -08:00
springstan
f2b06d9abd Move imports to top for sht31 (#29260) 2019-11-30 21:22:53 -08:00
springstan
221db3a2dd Move imports to top for simplepush (#29261) 2019-11-30 21:22:33 -08:00
springstan
11b274989a Move imports to top for satel_integra (#29263) 2019-11-30 21:22:18 -08:00
springstan
4ceddc6d35 Move imports to top for sabnzbd (#29266) 2019-11-30 21:22:05 -08:00
springstan
3aff90c0ac Move imports to top for rpi_gpio_pwm (#29270) 2019-11-30 21:21:46 -08:00
springstan
453569a469 Move imports to top for russound_rio (#29267) 2019-11-30 21:21:40 -08:00
springstan
db2f53dfc1 Move imports to top for russound_rnet (#29268) 2019-11-30 21:21:28 -08:00
springstan
82d8c9c2ca Move imports to top for rova (#29269) 2019-11-30 21:21:08 -08:00
springstan
869e71f455 Move imports to top for rpi_rf (#29271) 2019-11-30 21:20:33 -08:00
springstan
7ad139bb63 Move imports to top for roomba (#29272) 2019-11-30 21:20:17 -08:00
springstan
96a28e59bc Move imports to top for route53 (#29273) 2019-11-30 21:19:28 -08:00
HomeAssistant Azure
aa9514b774 [ci skip] Translation update 2019-12-01 00:34:59 +00:00
springstan
5dbfa16e04 Move imports to top for simplisafe (#29262) 2019-11-30 17:16:05 -07:00
Wim Haanstra
bde453be47 Address DSMR Reader review notes (#29209)
* Fix review issues

* Remove None from get method

* No longer need logging import

* Give definition without name a default name
2019-11-30 16:23:03 +01:00
Pascal Vizeli
0ea91fbf2d Merge pull request #29234 from home-assistant/rc
Release 0.102.3
2019-11-30 11:58:54 +01:00
HomeAssistant Azure
8ae0d891e4 [ci skip] Translation update 2019-11-30 00:32:19 +00:00
springstan
4bec14b0f6 Move imports to top for swiss_public_transport (#29228)
* Move imports to top for swiss_public_transport

* Remove import of exceptions since only one exception is used
2019-11-29 22:16:14 +01:00
springstan
fbfbae8ad9 Move imports to top for swiss_hydrological_data (#29227) 2019-11-29 21:50:09 +01:00
springstan
39bf1b5f5d Move imports to top for stiebel_eltron (#29224) 2019-11-29 21:32:03 +01:00
springstan
7d90b1f9ec Move imports to top for streamlabswater (#29225) 2019-11-29 21:27:00 +01:00
springstan
93bb1a6816 Move imports to top for supla (#29226) 2019-11-29 21:26:23 +01:00
springstan
bbecd55c09 Move imports to top for synology (#29230) 2019-11-29 21:22:03 +01:00
springstan
c30dfac4ed Move imports to top for synologdsm (#29231) 2019-11-29 21:21:00 +01:00
springstan
e4b26dc02b Move imports to top for tahoma (#29232) 2019-11-29 21:19:49 +01:00
springstan
11331ad26e Move imports to top for starlingbank (#29233) 2019-11-29 21:18:52 +01:00
springstan
04bad4bc74 Move imports to top for switchbot (#29229) 2019-11-29 19:34:40 +01:00
Michaël Arnauts
e405398ca4 Allow turning off a tado water heater (#29221) 2019-11-29 19:22:22 +01:00
Pascal Vizeli
ec008ddbe4 Bump version 0.102.3 2019-11-29 17:48:08 +00:00
Bram Kragten
2d5d40ce0e Fix smartthings cloud webhook (#29219)
* Fix smartthings cloud webhook

* Update smartapp.py
2019-11-29 17:46:27 +00:00
Bram Kragten
4065c46046 Fix smartthings cloud webhook (#29219)
* Fix smartthings cloud webhook

* Update smartapp.py
2019-11-29 18:29:45 +01:00
springstan
392cdf49e6 Allow controlling Tado Hot Water Devices with temperature control (#29191) 2019-11-29 16:29:39 +01:00
tetienne
12155cb66e Fix somfy switch inherit from SwitchDevice instead of ToggleEntity (#29182) 2019-11-29 12:08:20 +01:00
Malte Franken
6126d05935 Migrate NSW Rural Fire Service integration to async library (#29181)
* use async integration library

* adapted unit tests

* removed unused constants

* relocated constants

* simplified generation of new entries

* small code fixes

* increased test coverage and removed unused code

* fixed comment

* simplified patch code
2019-11-29 12:06:21 +01:00
springstan
364d1cff40 Move imports to top for xiaomi (#29197) 2019-11-29 08:09:36 +01:00
springstan
e63bca4f32 Move imports to top for xiaomi_aqara (#29196) 2019-11-29 08:09:10 +01:00
michaeldavie
1322661ee0 Handle None when trucating long Environment Canada state values (#29208)
* Handle None when trucating long state values, add info message

* Black
2019-11-29 04:13:21 +01:00
springstan
1c824f5ca7 Move imports to top for ziggo_mediabox_xl (#29193) 2019-11-29 02:10:08 +01:00
springstan
e5aa050def Move imports to top for zhong_hong (#29194) 2019-11-29 02:09:03 +01:00
springstan
fe34ea1865 Move imports to top for zabbix (#29195) 2019-11-29 02:07:52 +01:00
springstan
66aae61fd5 Move imports to top for wirelesstag (#29198) 2019-11-29 02:03:14 +01:00
Fabian Affolter
0d30a6bcac Upgrade youtube_dl to 2019.11.28 (#29199) 2019-11-29 02:02:01 +01:00
springstan
25ad933d2d Move imports to top for vultr (#29200) 2019-11-29 02:00:40 +01:00
springstan
243e80459d Move imports to top for volvooncall (#29201) 2019-11-29 01:59:48 +01:00
springstan
0e4920d6a1 Move imports to top for tof (#29203)
* Move imports to top for tof

* Isorted imports
2019-11-29 01:58:56 +01:00
springstan
7b33e57e86 Move imports to top for tautulli (#29204) 2019-11-29 01:56:39 +01:00
springstan
5001dbdcfa Move imports to top for tapsaff (#29205) 2019-11-29 01:55:52 +01:00
springstan
e1fece48e1 Move imports to top for syncthru (#29206) 2019-11-29 01:54:42 +01:00
springstan
430061a159 Move imports to top for usgs_earthquakes_feed (#29202) 2019-11-29 01:53:49 +01:00
HomeAssistant Azure
8dc366c75b [ci skip] Translation update 2019-11-29 00:32:07 +00:00
Fabian Affolter
103b917bb2 Upgrade psutil to 5.6.6 (#29192) 2019-11-28 23:20:00 +01:00
guillempages
26e674b4c3 Resolve hosts for fritzbox_callmonitor (#28761)
* Resolve hosts for fritzbox_callmonitor

If the configuration supplied "host" is not an IP address, try resolving it

* always use gethostbyname

Instead of just checking whether it is an IP and if it isn't try to resolve; just resolve it; IPs will be returned unchanged, and hostnames will be resolved.

* Catch error if the hostname cannot be resolved

* Don't fallback to default host

If the hostname cannot be resolved; don't try to fallback; just print the error message.

* Fail setup if hostname cannot be resolved

If the hostname cannot be resolved, log an error and stop the setup;
no entities will be then created.
2019-11-28 21:14:20 +01:00
Wim Haanstra
daed314585 Dsmr reader (#28701)
* Added DSMR Reader platform

- Added DSMR Reader platform
- Updated codeowners for other components I added earlier

* Move sensor definitions to new file

* Sensor definitions in new file

* Add energy prices from MQTT

* lint fixes

* Black formatted some files

* Update .coveragerc

* Support transform methods on definitions

* Manifest mangled by Black, fixed

* Visual studio code reformatting dictionary error

* Fix issues with code, remove unrelated manifest changes

* Update CODEOWNERS
2019-11-28 20:30:24 +01:00
Paulus Schoutsen
b847d55077 Only create cloud user if cloud in use (#29150)
* Only create cloud user if cloud in use

* Pass context to alexa

* Update requirements

* Fix handing & design pattern for 0.30

* fix tests

* Fix lint & tests

* rename internal user
2019-11-28 14:23:59 +01:00
Pascal Vizeli
5d5d053bce Use github instead gitlab 2019-11-28 13:40:29 +01:00
tetienne
4e107a2bcf Add support for Somfy Camera Shutter (#29057) 2019-11-28 10:42:17 +01:00
jjlawren
9c9e9bc92a Bump plexwebsocket to 0.0.6 (#29175) 2019-11-27 22:40:08 -08:00
Joakim Plate
69991bf3a2 Move GoogleConfig initialization into setup of component (#29170) 2019-11-27 20:45:43 -08:00
Raman Gupta
3ecf5596ff update demo service domain and service description (#29164)
* update demo service domain and service description

* move DOMAIN and service name to const.py

* update per balloob's service name suggestion

* update service name in services.yaml

* update service name constant's name
2019-11-27 20:36:40 -08:00
Paulus Schoutsen
4cfd24a03a Fix mobile app device identifiers (#29173) 2019-11-27 20:27:22 -08:00
Dan Jones
665613e395 Add fan support to lutron_caseta (#29033)
* Adding lutron_caseta fan controller. Updated to pylutron 0.5.1

* Accidental import remain

* updating for black formatting

* Fix blank spaces

* Moving third party import

* update to 0.5.1 to pass checks

* fix deletion of new line

* Update fan.py

* Update with dev branch, update from comments, added mediumhigh
2019-11-28 02:45:36 +01:00
Raman Gupta
f1a4e212cc Update service domain for alarmdecoder from 'alarm_control_panel' to 'alarmdecoder' (#29127)
* update alarmdecoder service domain

* update alarmdecoder service name

* black formatting
2019-11-27 16:51:40 -08:00
Raman Gupta
88376bf363 move wemo services to wemo domain (#29135) 2019-11-27 16:49:12 -08:00
Raman Gupta
9fd058aa33 move soundtouch services to soundtouch domain (#29140) 2019-11-27 16:47:45 -08:00
HomeAssistant Azure
f6dd51a7fb [ci skip] Translation update 2019-11-28 00:32:18 +00:00
Raman Gupta
7ecd5b5e5a add services.yaml description for service (#29160) 2019-11-27 14:18:21 -08:00
Raman Gupta
ceb1528b50 Update bluetooth_tracker service name and domain from 'device_tracker' to 'bluetooth_tracker' (#29161)
* move service constants to const.py, update service domain, add service description

* update .coveragerc
2019-11-27 14:18:01 -08:00
Raman Gupta
b6d94bcc96 Change apns service domain and remove unused variable (#29165)
* change apns service domain and remove unused variable

* fix tests

* move DOMAIN to const.py and import DEVICE_TRACKER_DOMAIN from base component
2019-11-27 14:15:25 -08:00
Robert Svensson
bdb3eb1683 Handle case when device can be None (#29171) 2019-11-27 14:14:19 -08:00
jjlawren
88441d5f68 Reduce connection timeout to avoid config flow timeouts (#29172) 2019-11-27 14:14:01 -08:00
Raman Gupta
acc10c296e move import to top and add service definition for pilight (#29163)
* move import to top and add service definition for pilight

* move import above HA imports
2019-11-27 21:26:54 +01:00
Tsvi Mostovicz
d7a66e6e4c Return Jewish Calendar holiday type id support (#29168)
* Bring back holiday type id as a attribute to the holiday sensor

* Add test for holiday type id attribute
2019-11-27 20:52:03 +01:00
Brett T. Warden
fa1622fe8b Use roku.poweron method for media_player.turn_on (#29123)
Instead of using the roku.power method, which toggles power,
implement the media_player.turn_on command for the roku component
by calling the new roku.poweron method.

Fixes #28961, but depends on upstream
https://github.com/jcarbaugh/python-roku/pull/53
2019-11-27 18:19:10 +01:00
Raman Gupta
8ef8a314df Update service domain for ifttt from 'alarm_control_panel' to 'ifttt' (#29129)
* update service domain for ifttt

* update missed variable references
2019-11-27 18:17:56 +01:00
Raman Gupta
82fe409961 add services.yaml description for matrix service (#29159) 2019-11-27 18:15:15 +01:00
Raman Gupta
b274fcba05 Update service domain for harmony from 'remote' to 'harmony' (#29146)
* move harmoney services to harmony domain

* update service names
2019-11-27 18:14:46 +01:00
Raman Gupta
d577868190 move yamaha service to yamaha domain (#29142) 2019-11-27 18:13:54 +01:00
Raman Gupta
ef21fd2536 Update services.yaml for nuheat (#29133)
* update services.yaml for nuheat

* update tests

* black formatting
2019-11-27 15:20:40 +01:00
mvn23
fdf0793fdd Add opentherm_gw device support (#28722)
* Add opentherm_gw device support

* Add support for enabling/disabling of opentherm_gw entities

* Disable sensors by default, base climate entity_id on gw_id instead of friendly_name to guarantee uniqueness

* Remove platform name from unique_id
2019-11-27 08:14:41 -05:00
Raman Gupta
12ae8b025f move squeezebox service to squeezebox domain (#29141) 2019-11-27 13:54:00 +01:00
Raman Gupta
59939004bf Update service domain for mill from 'climate' to 'mill' (#29132) 2019-11-27 13:47:38 +01:00
Abílio Costa
a08df53dbc Add "gentle" mode for Xiaomi Roborock vacuum (#29004)
* Add "gentle" mode for Xiaomi Roborock vacuum

* fix tests
2019-11-27 13:46:13 +01:00
Tom Brien
8f05388bc5 Remove ios warning for no devices subscribed to ios.notify (#29153)
Since 2019.1 has launched there is a perfectly reasonable (in fact the standard) case where ios component is loaded (i.e. actionable notifications) but no devices are registed for the now defunct `ios.notify` service. As such, the log warning relating to this case is no longer relevant.
2019-11-27 13:35:38 +01:00
Raman Gupta
c80f284ca4 Update service domain for mysensors from 'switch' to 'mysensor… (#29147) 2019-11-27 13:31:40 +01:00
Raman Gupta
2d2ab452ca update envisalink service domain (#29126) 2019-11-27 11:27:48 +01:00
Raman Gupta
1681d36637 Update service domain for todoist from 'calendar' to 'todoist' (#29131)
* move todoist constants to const.py and update service domain

* update .coveragerc

* remove unused variable

* save file
2019-11-27 11:26:59 +01:00
Paulus Schoutsen
004476a1f8 Add intent integration to expose intent handle API (#29124)
* Add intent integration to expose intent handle API.

* Run hassfest + fix scaffolding

* Update __init__.py
2019-11-27 11:25:43 +01:00
Raman Gupta
ec61a86678 move service constants to const.py and move channels services to channels domain (#29139) 2019-11-27 11:23:52 +01:00
Raman Gupta
1f13809c6d Update service domain for lifx from 'light' to 'lifx' (#29136)
* update service domain for lifx custom services

* fix service name
2019-11-27 11:23:06 +01:00
Raman Gupta
9e882ef6b4 move wink service definitions from lock to wink domain (#29137) 2019-11-27 11:21:52 +01:00
Raman Gupta
5120181e0e move facebox service to facebox domain (#29151) 2019-11-27 11:20:24 +01:00
Raman Gupta
c72e230432 move songpal service to songpal domain (#29143) 2019-11-27 11:19:01 +01:00
Raman Gupta
0ff0ec7d3e move econet services to econet domain (#29149) 2019-11-27 11:18:21 +01:00
Raman Gupta
ff4d256893 move icloud services to icloud domain (#29144) 2019-11-27 11:16:53 +01:00
Raman Gupta
b8f03aa3be move neato service to neato domain (#29148) 2019-11-27 11:15:59 +01:00
Raman Gupta
975ee0ea7f Update service domain for elkm1 from 'alarm_control_panel' to 'elkm1' (#29128)
* move elkm1 services to elkm1 domain

* update missed variable references
2019-11-27 11:15:27 +01:00
Raman Gupta
b7896c7b6f move nuki service to nuki domain services.yaml and remove missing service (#29138) 2019-11-27 11:14:22 +01:00
Raman Gupta
fb9f561052 move html5 service to html5 domain (#29145) 2019-11-27 11:13:27 +01:00
Chris Caron
8933540950 bumped supported apprise version to 0.8.2 (#29125) 2019-11-26 20:18:43 -08:00
Ville Skyttä
5bc8ef962b Upgrade huawei-lte-api to 1.4.4 (#29130)
https://github.com/Salamek/huawei-lte-api/releases/tag/1.4.4

Closes https://github.com/home-assistant/home-assistant/issues/28922
2019-11-26 20:18:24 -08:00
Ville Skyttä
738b3363d9 UpCloud updates (#28646)
* Upgrade upcloud-api to 0.4.5

* Fix UpCloud name spelling in manifest

* Update data at setup time for better initial states

* Clean up signal handlers on remove

* Signal data update on server start

To keep related binary sensor better up to date.

* Improve track_time_interval emulation for initial update
2019-11-26 20:17:14 -08:00
HomeAssistant Azure
2a7aac6afc [ci skip] Translation update 2019-11-27 00:32:16 +00:00
springstan
33c6ee80ad Move imports to top for traccar (#29116) 2019-11-26 16:07:12 -08:00
springstan
5eaafcfd7f Move imports to top for touchline (#29117) 2019-11-26 16:06:44 -08:00
springstan
4e96ca9486 Move imports to top for temper (#29118) 2019-11-26 16:02:50 -08:00
springstan
555190990a Move imports to top for tank_utility (#29119) 2019-11-26 16:02:36 -08:00
Joakim Plate
06231e7ac2 Move request sync logic into GoogleConfig (#28227)
* Move request sync logic into GoogleConfig

* Return http status code for request_sync same as cloud

* agent_user_id is not optional for async_sync_entities now

* No need in checking parameter here

* Adjust some things for cloud tests

* Adjust some more stuff for cloud tests

* Drop uneccessary else

* Black required change

* Let async_schedule_google_sync take agent_user_id

* Assert return value on api call

* Test old api key method

* Update homeassistant/components/google_assistant/helpers.py

Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io>
2019-11-26 22:47:13 +01:00
gjbadros
5f1b0fb15c Allow rest sensor list responses (#28835)
* Make rest sensor a little bit more flexible and allow the response to be a list with 0th element being a dictionary

* Black formatter wanted a different formatting

* Added test case for a list response with dict as 0th element

* Fixed lint error - it thinks a + STRING is an avoidance of using % sequences for log messages; I generally prefer explicit + rather than string juxtaposition for combining string literals, but sounds like that's not the standard

* Fixed test case -- I added it to the wrong scenario and need to use the one with json_attrs.
2019-11-26 22:10:58 +01:00
springstan
b72c6c4424 Update list of supported countries for Workday Sensor (#29000)
* Updated list of supported countries

* Added Honduras and Polish back to the list

* Added HND for Honduras to the list
2019-11-26 22:09:00 +01:00
Colin O'Dell
0849d42dc6 Remove the alarm_control_panel CODEOWNER (#29114)
Although I originally contributed this component, I no longer use it myself and haven't been following the internal development of HA, so I'm no longer a good person to review any further changes to this component.  I would therefore like to relinquish my CODEOWNER status over this component.
2019-11-26 21:57:45 +01:00
Evgeny
4ea47333d8 Update roomba bin state checking (#29030)
* Fixed bin full detection

* Refactored bin check

* Fix after pylint
2019-11-26 21:31:00 +01:00
Alex van den Hoogen
fe626f5669 Add Post Processing Jobs to NZBGet component (#29027)
* Added Post Processing Jobs to NZBGet component

In the current implementation of the NZBGet component there is no way of
knowing whether NZBGet is still in the Post Processing phase of a download
job. This can be very useful information. For instance when you want to
suspend the NZBGet service when all queue items have been completed.

This change adds that additional sensor.

* Renamed Count to Jobs in NZBGet component
2019-11-26 11:31:20 -08:00
sophof
078a7e446d Fix all entities triggering all observations in bayesian sensor (#28979)
* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* use get instead of direct keys for dict

* change fromkeys to dict comprehension to prevent append working on a list by reference. Now each entity id has its own seperate list

* use get instead of direct keys for dict

* changed get back to []
2019-11-26 11:26:40 -08:00
Nikolay Vasilchuk
a37260faa9 StarLine integration (#27197)
* Device Tracker works

* Device Tracker works

* Binary Sensor

* Sensor

* Lock

* Switch and service

* New switches

* Update interval options

* WIP

* Translation errors

* Check online state

* WIP

* Move to aiohttp

* Some checks

* CI

* CI

* .coveragerc

* Black

* icon_for_signal_level test

* update_interval renamed to scan_interval

* async logic

* Fix cookie read

* Requirement starline

* Reformat

* Requirements updated

* ConfigEntryNotReady

* Requirement starline

* Lint fix

* Requirement starline

* available status

* Translations

* Expiration to config

* CI

* Linter fix

* Small renaming

* Update slnet token

* Starline version bump

* Fix updates

* Black

* Small fix

* Removed unused fields

* CI

* set_scan_interval service

* deps updated

* Horn switch

* Starline lib updated

* Starline lib updated

* Black

* Support multiple integrations

* Review

* async_will_remove_from_hass

* Deps updated

* Test config flow

* Requirements

* CI

* Review

* Review

* Review

* Review

* Review

* CI

* pylint fix

* Review

* Support "mayak" devices

* Icons removed

* Removed options_flow

* Removed options_flow test

* Removed options_flow test
2019-11-26 11:17:11 -08:00
Raman Gupta
c21650473a Update service domain for epson from 'media_player' to 'epson' (#29113)
* update .coveragerc, move epson constants to const.py, move epson cutsom service to epson domain

* Newline in services.yaml
2019-11-26 11:12:50 -08:00
Raman Gupta
9e01591cac Update service domain for blackbird from 'media_player' to 'blackbird' (#29112)
* move service constants to const.py, update blackbird custom service domain

* Readd bluesound services.yaml entries since it should be part of a different branch
2019-11-26 11:10:13 -08:00
Raman Gupta
2da37778af Update service domain for bluesound from 'media_player' to 'bluesound' (#29111)
* move service constants to const.py, move services to bluesound domain

* Remove bluesound services from media_player/services.yaml
2019-11-26 11:06:34 -08:00
rappenze
1c73ac5df8 Fix Vicare imports (#29071)
* fix import

* Update water_heater.py

* use ValueError

* use ValueError
2019-11-26 10:46:53 -08:00
Aaron Bach
2cdd8ad15e Add new properties and services for V3 SimpliSafe systems (#28997)
* Add new properties and services for V3 SimpliSafe systems

* Small semantic change

* Updated docstrings

* Semantics

* Streamlined adding V3 properties

* Re-add attribute

* Bump to 5.3.5

* Owner comments

* Correct coroutine name
2019-11-26 11:44:40 -07:00
springstan
595567ad82 Move imports to top for trafikverket_weatherstation (#29108) 2019-11-26 10:23:08 -08:00
springstan
c221fc5d22 Move imports to top for thinkingcleaner (#29110) 2019-11-26 10:22:57 -08:00
springstan
23d4445de3 Move imports to top for trackr (#29109) 2019-11-26 10:22:28 -08:00
springstan
a27d8570c8 Move imports to top for unifi_direct (#29106) 2019-11-26 10:12:00 -08:00
springstan
4119ade2af Move imports to top for travisci (#29107) 2019-11-26 10:11:43 -08:00
springstan
825ac36ee7 Move imports to top for uvc (#29072)
* Move imports to top for uvc

* Fixed linting error

* Renamed parameter in constructor to avoid redefining import
2019-11-26 10:11:10 -08:00
Quentame
9a388e2dd2 Move dominos imports at top-level (#29090) 2019-11-26 10:10:20 -08:00
Quentame
c84590b18c Move free_mobile imports at top-level (#29092) 2019-11-26 10:10:05 -08:00
Quentame
274508f8fd Move fortigate imports at top-level (#29093) 2019-11-26 10:09:52 -08:00
Quentame
915d23158d Move foobot imports at top-level (#29094) 2019-11-26 10:09:32 -08:00
Quentame
4107fd9a25 Move folder_watcher imports at top-level (#29095) 2019-11-26 10:09:20 -08:00
Quentame
7a04f0c0df Move flunearyou imports at top-level (#29096) 2019-11-26 10:09:10 -08:00
Quentame
a7c4abba98 Move flexit imports at top-level (#29097) 2019-11-26 10:08:53 -08:00
springstan
21ed87a773 Move imports to top for ubee (#29105) 2019-11-26 10:08:34 -08:00
springstan
03fe7cb347 Move imports to top for twilio_call (#29104) 2019-11-26 10:08:16 -08:00
springstan
33af72a54f Move imports to top for uptimerobot (#29103)
* Move imports to top for uptimerobot

* Move imports to top for twilio_call

* Revert twilio_call
2019-11-26 10:07:46 -08:00
Raman Gupta
499838d5a7 move service constants to const.py, move custom services to monoprice domain (#29099) 2019-11-26 10:07:29 -08:00
SukramJ
c1163283ff Add hvac_action to HomematicIP Cloud Climate (#28859)
* Add hvac_action to HomematicIP Cloud Climate

* update test data

* limit hvac action to radiator only

* add checks

* Fix test to match new conditions
2019-11-26 10:02:30 -08:00
springstan
d0c47dfee2 Move imports to top for webostv (#29102) 2019-11-26 09:49:14 -08:00
Raman Gupta
42ce5e8b07 Update service domain for local_file from 'camera' to 'local_file' (#28890)
* update service domain for local_file from camera to local_file

* remove service.yaml entry in camera component as part of change

* fix test

* move constants to const.py

* add local_file/const.py to .coveragerc

* remove local_file/const.py from .coveragerc since component has tests
2019-11-26 09:22:55 -08:00
Rami Mosleh
a5960830d7 Add host field to add_torrent service (#28653)
* Add host field to add_torrent service

* Code cleanup

* use name instead of host for service

* update add_torrent
2019-11-26 09:22:12 -08:00
Matthew Donoughe
f8a36499c1 Add serial to caseta devices (#28886)
* add model and serial to caseta devices

* use just serial for unique id

* add display name for entity registry

* remove caseta device model

* just store device

* state and device are the same
2019-11-26 09:06:14 -08:00
Hmmbob
9e971495f7 Update WazeRouteCalculator, add config options, fix subscription (#27963)
* Update WazeRouteCalculator to 0.11

* Update WazeRouteCalculator to 0.11

* Adding new config options to Waze

* Fixing avoid subscription option

* Update WazeRouteCalculator to 0.12

There was an error in the underlying lib

* Update WazeRouteCalculator to 0.12
2019-11-26 09:05:06 -08:00
Quentame
44e708f72b Move ee_brightbox imports at top-level (#29054)
* Move ee_brightbox imports at top-level

* Fix tests

* Fix : Commented out code
2019-11-26 08:59:55 -08:00
Quentame
78d5184186 Move icloud imports at top-level (#29089) 2019-11-26 08:59:42 -08:00
Austin Drummond
c47ed743f1 Fix HomeKit linked battery sensor crash (#28974)
* fix homekit linked battery sensor crash

* simplified missing linked battery

* fixed formatting

* Make if faster
2019-11-26 08:55:33 -08:00
Pascal Vizeli
f9571c9637 Fix Alexa tests (#29100) 2019-11-26 16:17:41 +01:00
Bendik Brenne
c538d899a2 Fix empty data attribute in sinch service call (#28253)
* Fix empty data attribute in sinch service call

* Simplified the PR as per @MartinHjelmare`s request.
2019-11-26 14:14:09 +01:00
Paulus Schoutsen
c76f768a82 Make conversation and intent context aware (#28965)
* WIP

* LINT
2019-11-26 11:30:21 +01:00
Tim McCormick
6c6a5c50a5 Fix digest auth rest sensors (#28153)
* Fix digest auth rest sensors

* Refactor to use request()

* Fix black complaints

* Don't rename data variable

Don't rename the data variable, appears several other sensors have been coded to rely on it

* Fix tests

test_setup_missing_schema:
Change the exception to check for to PlatformNotReady. With the change away from prepared statements, we no longer get the MissingSchema error during setup - we get it when we attempt to call the endpoint. Since the result is PlatformNotReady, which is what we want, and the error log clearly contains a note that the schema is incorrect I think this is fine.

test_setup_failed_connect & test_setup_timeout:
These aren't checking for minimum config, and they're not invoking the correct method to have the default config filled in. Therefore I've just added the correct minimum config so these can continue to test what they're there to test.

test_update_request_exception:
Testing a request exception with the assert on line 404! Excellent. Anyway, we've moved from using the requests Session object to the requests.request function - so the patch needed to be altered to ensure the RequestException was raised.

* Remove no longer needed import

* Fix binary sensor test in same way
2019-11-25 23:22:11 -08:00
ochlocracy
b0925e60d7 Explicitly include "Alexa" Interface in discovery response (#28218)
* Explicitly include Alexa Interface to discovery response.

* Updated cloud component test to reflect additional Alexa interface.

* Updated test for recently added SeekController.
2019-11-25 23:05:10 -08:00
Bas Nijholt
db425f5432 Simplify getting alias from tplink smartplug.context (#28696)
* tplink: simplify getting alias from smartplug.context

* add a doc-string to private property
2019-11-25 23:03:38 -08:00
Ville Skyttä
99c7608fb4 Lint config cleanups (#28864)
* Remove bunch of unneeded lint exclusions

* Use symbolic names instead of identifiers in pylint disables

* Tighten scope of some pylint disables
2019-11-25 22:40:08 -08:00
Barry Williams
afaa464142 If volume disabled do not enable support (#28635) 2019-11-25 22:34:45 -08:00
Shulyaka
1f72de108c google_assistant: support for humidity sensors (#28695) 2019-11-25 22:12:20 -08:00
Emeric
72ccc83651 Add uptime and number of reboot for bbox sensor (#28880)
* Add uptime and reboot for bbox sensor

* Use timestamp for uptime

* Fix black format
2019-11-25 21:34:13 -08:00
Adam Cheng
6e7b5b71f5 Add scale and offset to temperature values to Modbus Climate (#27045)
* Add scale and offset to temperature values

* fix (no-else-return)

* Update manifest.json

* Added codeowners
2019-11-25 20:59:01 -08:00
Dmitry Krasnoukhov
4881bc04d8 Allow to change MQTT climate hold mode (#28988) 2019-11-25 20:53:37 -08:00
springstan
5f4fc271d4 Fixed CONFIG_SCHEMA and getting data from the config (#28985) 2019-11-25 20:27:51 -08:00
Pedro Lamas
db0008e62c Allow templates in rest_command headers (#26099) 2019-11-25 19:39:56 -08:00
springstan
cc255da038 Move imports to top for ecovacs (#29017)
* Moved imports in ecovacs integration

* Imported sucks once, reused it multiple times
2019-11-25 18:01:48 -08:00
Michaël Arnauts
cc346e57e6 Cast the volume_level of a universal media_player to a float (#29045)
* Make sure to cast the volume_level of a universal media_player to a float

* Fix test that expects the wrong bahaviour

* Catch exception instead of checking for None
2019-11-25 18:01:24 -08:00
Quentame
8a413b152d Move esphome imports at top-level (#29064) 2019-11-25 18:00:58 -08:00
olijouve
87de5db535 Fix Onvif setup error: premature end of connection on GetStreamURI (#26781)
* Fix Onvif setup error with a premature end of connection on GetStreamUri wsdl call

Reconnect to onvif camera after getting profiles to fix this error :

[homeassistant.components.onvif.camera] Retrieving stream uri                                                                                                                                 
[zeep.asyncio.transport] HTTP Post to http://192.168.1.15/onvif/Media:                                                                                                                        
b'<?xml version=\'1.0\' encoding=\'utf-8\'?>\n<soap-env:Envelope xmlns:soap-env="http://www.w3.org/2003/05/soap-envelope"><soap-env:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecur
2019-09-20 01:08:51 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform onvif                                                                                                                       
Traceback (most recent call last):                                                                                                                                                                                                   
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 553, in write_bytes                                                                                                                                   
    await self.body.write(writer)                                                                                                                                                                                                    
  File "/usr/local/lib/python3.7/site-packages/aiohttp/payload.py", line 231, in write                                                                                                                                               
    await writer.write(self._value)                                                                                                                                                                                                  
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 101, in write                                                                                                                                           
    self._write(chunk)                                                                                                                                                                                                               
  File "/usr/local/lib/python3.7/site-packages/aiohttp/http_writer.py", line 67, in _write                                                                                                                                           
    raise ConnectionResetError('Cannot write to closing transport')                                                                                                                                                                  
ConnectionResetError: Cannot write to closing transport                                                                                                                                                                              
                                                                                                                                                                                                                                     
The above exception was the direct cause of the following exception:                                                                                                                                                                 
                                                                                                                                                                                                                                     
Traceback (most recent call last):                                                                                                                                                                                                   
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 150, in _async_setup_platform                                                                                                                         
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)                                                                                                                                                                
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for                                                                                                                                                            
    return fut.result()                                                                                                                                                                                                              
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 110, in async_setup_platform                                                                                                                          
    await hass_camera.async_initialize()                                                                                                                                                                                             
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 168, in async_initialize                                                                                                                              
    await self.async_obtain_input_uri()                                                                                                                                                                                              
  File "/usr/src/homeassistant/homeassistant/components/onvif/camera.py", line 266, in async_obtain_input_uri                                                                                                                        
    stream_uri = await media_service.GetStreamUri(req)                                                                                                                                                                               
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/bindings.py", line 13, in send                                                                                                                                           
    options["address"], envelope, http_headers                                                                                                                                                                                       
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 107, in post_xml                                                                                                                                     
    response = await self.post(address, message, headers)                                                                                                                                                                            
  File "/usr/local/lib/python3.7/site-packages/zeep/asyncio/transport.py", line 95, in post                                                                                                                                          
    proxy=self.proxy,                                                                                                                                                                                                                
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client.py", line 497, in _request                                                                                                                                             
    await resp.start(conn)                                                                                                                                                                                                           
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 844, in start                                                                                                                                         
    message, payload = await self._protocol.read()  # type: ignore  # noqa                                                                                                                                                           
  File "/usr/local/lib/python3.7/site-packages/aiohttp/streams.py", line 588, in read                                                                                                                                                
    await self._waiter                                                                                                                                                                                                               
aiohttp.client_exceptions.ClientOSError: [Errno None] Can not write request body for http://192.168.1.15/onvif/Media

* Add code comment

* Update camera.py

* Lint.
2019-11-25 17:56:17 -08:00
Andrew Onyshchuk
f5c01cc30d Improve z-wave thermostat support (#27040)
* Improve z-wave thermostat support

Discover thermostat using COMMAND_CLASS_THERMOSTAT_MODE
so that it is a single entitiy in case there are multiple
setpoints. z-wave docs mention it is always present.
Add support for single/range target temperature depending
on the current thermostat mode.

* Remove debug print

* Refactor Z-Wave dynamic setpoint(s) selection

- use explicit mapping between modes and setpoints as defined in
Z-Wave specs
- add tests for away (2 setpoints) and heat eco (1 setpoint) modes

* Add non-standard thermostat mode aliases
2019-11-25 16:32:37 -08:00
HomeAssistant Azure
807de1aeb3 [ci skip] Translation update 2019-11-26 00:32:24 +00:00
Gil Peeters
0088995b98 Refactor template components to extract common routines (#27064)
* Added availability_template to Template Cover platform

* Added availability_template to Template Binary Sensor platform

* Added availability_template to Template Fan platform

* Added availability_template to Template Light platform

* Added availability_template to Template Sensor platform

* Added availability_template to Template Switch platform

* Added availability_template to Template Vacuum platform

* Added availability_template to Template Lock platform

* Added to test for invalid values in availability_template

* Black and Lint fix

* black formatting

* Added to test for invalid values in availability_template

* black

* Added to test for invalid values in availability_template

* Added to test for invalid values in availability_template

* simplified exception handler

* Fixed Entity discovery big and coverage

* Added to test for invalid values in availability_template

* flake8

* fixed component ID in test

* Added to test for invalid values in availability_template

* Added to test for invalid values in availability_template

* Made availability_template redering erorr more concise

* Cleaned template setup

* I'll remember to run black every time one of these days...

* Refactored Template initialisation

* Refactored Template initialisation

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Updated AVAILABILITY_TEMPLATE Rendering error

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Moved const to package Const.py

* Fix import order (pylint)

* Fix import order (pylint)

* Fix import order (pylint)

* Fix import order (pylint)

* Fix import order (pylint)

* Fix import order (pylint)

* Fix import order (pylint)

* Fixed linting issues

* Moved availability_template rendering to common loop

* Moved availability_template rendering to common loop

* Moved availability_template rendering to common loop

* Moved availability_template rendering to common loop

* Removed 'Magic' string

* Removed 'Magic' string and removed duplicate code

* Removed 'Magic' string

* Removed 'Magic' string

* Brought contant into line

* Refactored availability_tempalte rendering to common loop

* Removed 'Magic' string

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* Cleaned up const and compare lowercase result to 'true'

* reverted _available back to boolean

* reverted _available back to boolean

* reverted _available back to boolean

* reverted _available back to boolean

* reverted _available back to boolean

* reverted _available back to boolean

* reverted _available back to boolean

* Fixed tests (magic values and state checks)

* Fixed tests (magic values and state checks)

* Fixed tests (async, magic values and state checks)

* Fixed tests (async, magic values and state checks)

* Fixed tests (async, magic values and state checks)

* Fixed tests (async, magic values and state checks)

* Fixed tests (async, magic values and state checks)

* Removed duplicate

* Clean up and remove debug

* Reverted Dev Container Change
2019-11-25 16:30:49 -08:00
Jacob McSwain
d5db55354e Add SSL configuration (#29038)
* OpenGarage: Add protocol configuration (#29037)

* OpenGarage: Change CONF_PROTOCOL to CONF_SSL

Resolves https://github.com/home-assistant/home-assistant/pull/29038#discussion_r350173095

* OpenGarage: Add `verify_ssl` as an option
2019-11-25 15:47:18 -08:00
Quentame
112a3f5e9f Move hangouts imports at top-level (#29055) 2019-11-25 15:44:11 -08:00
SukramJ
1fde0d18ed Add supported_features to Alarm Control Panel to limit device_actions (#29065)
* Add supported_features to Alarm Control Panel

* mark supported_features abstract

* Add SF to async_register_entity_service

* fix test

* Add missing SF SUPPORT_ALARM_ARM_CUSTOM_BYPASS

* isort

* fix async_register_entity_service

* Update alarm_control_panel.py
2019-11-25 15:42:53 -08:00
springstan
3203cba01f Move imports to top for xiaomi_tv (#29073) 2019-11-25 15:40:42 -08:00
springstan
c95a01ce3a Move imports to top for yale_smart_alarm (#29074) 2019-11-25 15:40:25 -08:00
springstan
729116ff3a Move imports to top for version (#29075) 2019-11-25 15:40:08 -08:00
springstan
a64d04da56 Move imports to top for xeoma (#29076) 2019-11-25 15:39:54 -08:00
springstan
d211a29cae Move imports to top for xfinity (#29077) 2019-11-25 15:39:44 -08:00
Quentame
844eb6b8ef Move dlna_dmr imports at top-level (#29082) 2019-11-25 15:37:19 -08:00
Quentame
5015993f30 Move upnp imports at top-level (#29083) 2019-11-25 15:37:03 -08:00
Quentame
29e2201446 Move velux imports at top-level (#29085) 2019-11-25 15:36:37 -08:00
Quentame
12c396fb19 Move epsonworkforce imports at top-level (#29086) 2019-11-25 15:36:04 -08:00
ochlocracy
970a80216d Add valid inputs to alexa InputController (#28483)
* Add supported Inputs for Alexa.InputController.

* Fixed Test.

* Added default parameter for get() per @quthla suggestion.

* Added additional tests, assets call data.

* Added additional tests, asserts call data.

* Accounted for space in input name, added tests to handle space.
2019-11-25 15:17:12 -08:00
mvn23
f53812f261 Fix opentherm_gw config flow migration (#28474)
* Fix opentherm_gw migration to config flow.

* Address feedback
2019-11-25 15:08:18 -08:00
ochlocracy
5ea5db32d2 Add Alexa.ModeController to cover entities, adds open/close utterances! (#28309)
* Added Alexa.ModeController to cover entities.

* Added synonyms for directives.

* Updated tests for additional synonyms for directives.

* Added Alexa.ModeController to cover entities.

* Sacrifice unused variable in split() to please the Pylint gods.

* Removed duplicate instance check.

* Corrected variable name, clarified definition and consistency.

* Changed list to tuple.
2019-11-25 15:07:33 -08:00
ochlocracy
dc8c085872 Support default display category based one switch device_class. (#28221) 2019-11-25 14:50:43 -08:00
Quentame
f971e16749 Move eddystone_temperature imports at top-level (#29052)
* Move eddystone_temperature imports at top-level

* Fix pylint ?
2019-11-25 23:46:12 +01:00
Heine Furubotten
04754b354c Entur public transport code owner (#29080)
* entur code owner

* gen codeowners file
2019-11-25 23:45:33 +01:00
Heine Furubotten
66b7dfec53 Nilu integration code owner (#29081)
* nilu code owner

* gen codeowners file
2019-11-25 23:45:14 +01:00
Quentame
c4108fec4f Move yi imports at top-level (#29001)
* Move yi imports at top-level

* Review 1 : removing useless disable=import-error

* Review 2 : removing useless disable=import-error
2019-11-25 15:32:35 -07:00
majuss
3dd5222ec7 Bumped lupupy to version 0.0.18 (#28989)
* Bumped lupupy

* Ran gen req

* Ran gen hassfest


Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2019-11-25 20:21:54 +01:00
SukramJ
9a5dc848c9 Fix climate device actions (#28660)
* limit climate device actions

* update test

* use supported_features for device_action

* Fix tests

* user support_features for device_condition
2019-11-25 11:12:00 -08:00
Bas Nijholt
ea6417bea3 track Raspberry Pi 4 image in the version integration (#29059) 2019-11-25 10:07:27 -08:00
Quentame
e40dda3ce3 Move econet imports at top-level (#29050) 2019-11-25 16:06:37 +01:00
Ville Skyttä
f504ac8c65 Drop < 0.97 Huawei LTE sensor unique id migration workaround (#29060) 2019-11-25 16:06:10 +01:00
Pascal Vizeli
9dc63419c4 Bump numpy 1.17.4 / opencv 4.1.2 for Python 3.8 (#29061) 2019-11-25 16:05:21 +01:00
fredericvl
3e4f7fddf2 Handle offline state of SAJ inverters (fixes #29007) (#29009)
* Fix for SAJ issue #29007

* Sort mapping
2019-11-25 08:46:49 -05:00
Quentame
335473cb71 Move hdmi_cec imports at top-level (#29056) 2019-11-25 14:43:17 +01:00
cgtobi
6da01904c4 Fix typo in scaffold generator script (#29058) 2019-11-25 14:42:40 +01:00
SukramJ
1043712c54 Code maintenance for HomematicIP Cloud (#28980)
* Add more type hints to Homematic IP Cloud

* Rename device to entity in async_setup_entry
2019-11-25 14:17:14 +01:00
Otto Winter
b927f40f00 Add climate hvac_action for ESPHome (#28993)
* Add climate action

* Bump aioesphomeapi
2019-11-25 14:13:19 +01:00
Quentame
5edc45e9af Move fibaro imports at top-level (#28995) 2019-11-25 14:12:01 +01:00
springstan
ccb05764b6 Move imports to top for ffmpeg_motion and ffmpeg_noise (#29026)
* Move imports to top for ffmpeg_motion and ffmpeg_noise

* Fixed tests
2019-11-25 14:11:23 +01:00
Quentame
71bafba9ec Move ecoal_boiler imports at top-level (#29049) 2019-11-25 14:08:52 +01:00
Quentame
cb5d00a07b Move ebox imports at top-level (#29048) 2019-11-25 14:08:28 +01:00
kuchel77
63f66785ad Added error checking (#29041)
Add in error checking in case disks or volumes are empty.
2019-11-25 14:08:04 +01:00
Quentame
752a4d7221 Move dyson imports at top-level (#29047) 2019-11-25 14:06:39 +01:00
Quentame
193769c791 Move vizio imports at top-level (#29046) 2019-11-25 14:05:46 +01:00
Quentame
3122182ab2 Move edimax imports at top-level (#29053) 2019-11-25 14:05:07 +01:00
Michaël Arnauts
c21c167f4e Use TADO_MODE for temperature overrides in tado climate component. (#29014)
* Use TADO_MODE for temperature overrides in tado climate component.

* Fix typo in pydoc

* Add myself as a code owner

* Update CODEOWNERS file
2019-11-25 14:04:36 +01:00
Chris Halls
5690313084 Report device unavailable state through Emulated Hue (#29029)
If an entity is in unavailable state in HA, we expose this
as unreachable to Hue clients. This helps when troubleshooting
Hue issues because you can now receive feedback if there is an issue
on the HA side.
2019-11-25 12:17:08 +01:00
springstan
aa00e56e1c Move imports to top for discovery (#29020) 2019-11-25 12:15:55 +01:00
escoand
430f7bdfd4 Catch samsungtv websocket exceptions (#28849)
* catch websocket exceptions

* fix syntax

* use exceptions from base class

* add comments

* add test
2019-11-25 10:45:50 +01:00
Fabian Affolter
5b64052d69 Upgrade discord.py to 1.2.5 (#28998) 2019-11-25 09:50:10 +01:00
springstan
cc3559d54c Move imports to top for geizhals (#29021) 2019-11-25 09:43:59 +01:00
springstan
ee038999fc Move imports to top for todoist (#29022) 2019-11-25 09:43:29 +01:00
springstan
fe9084bb3b Move imports to top for watson_tts (#29023) 2019-11-25 09:42:37 +01:00
Quentame
5822deda1d Move philips_js imports at top-level (#29003) 2019-11-25 09:41:37 +01:00
Philipp Schmitt
6307f383a7 Fix #27028 (#29042) 2019-11-25 09:40:32 +01:00
Josh Anderson
8fade79a0a Add an early start sensor for heating zones (#28732) 2019-11-25 09:13:59 +01:00
Paulus Schoutsen
ebc0ed1e22 Merge pull request #29039 from home-assistant/rc
0.102.2
2019-11-24 21:16:56 -08:00
Paulus Schoutsen
8a467bbf5c Bumped version to 0.102.2 2019-11-24 19:57:50 -08:00
Franck Nijhof
b10d42e330 Alexa gracefully handle climate devices without presets (#29010) 2019-11-24 19:57:43 -08:00
Bram Kragten
2af1ba7492 Updated frontend to 20191119.6 (#28996) 2019-11-24 19:57:42 -08:00
shred86
a56f7f5d75 Fix temp not being reported properly (#28973) 2019-11-24 19:57:42 -08:00
cgtobi
481f71107b Fix manual config (#28956) 2019-11-24 19:57:41 -08:00
Pascal Vizeli
2e85e3662f Fix ikea lights on deconz (#28949)
* Fix ikea lights on deconz

* check for None

* Use cleaner code style
2019-11-24 19:57:40 -08:00
jjlawren
c382406735 Fix Plex setup race condition v2 (#28943)
* Connect websocket when platforms ready, not when HA is ready

* Use callbacks from platform setup tasks instead

* Convert setup to async

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2019-11-24 19:57:40 -08:00
Franck Nijhof
48c289fad3 Alexa gracefully handle climate devices without presets (#29010) 2019-11-24 19:57:18 -08:00
Michaël Arnauts
647595fd67 Move imports to the top for Tado. (#29016) 2019-11-24 22:47:31 +01:00
springstan
1495df374b Made spotify playlist name validation less strict (#28684) 2019-11-24 20:53:26 +01:00
springstan
ce8e0e5489 Move imports to top for volkszaehler (#29025) 2019-11-24 20:31:15 +01:00
Franck Nijhof
94f8e634b2 Ensure wheel package is present when running Pylint (#29012) 2019-11-24 14:35:30 +01:00
HomeAssistant Azure
7c6b38d308 [ci skip] Translation update 2019-11-24 00:32:21 +00:00
Fabian Affolter
bbca6e3ac2 Upgrade shodan to 1.20.0 (#28983)
* Upgrade shodan to 1.20.0

* Upgrade mutagen to 1.43.0
2019-11-23 23:12:02 +01:00
Fabian Affolter
98eae305e2 Upgrade zeroconf to 0.24.0 (#28986) 2019-11-23 23:11:01 +01:00
Bram Kragten
6ad74fba30 Updated frontend to 20191119.6 (#28996) 2019-11-23 13:12:56 -08:00
Andrey Kupreychik
9fd8ffdc44 Bumped keenetic NDMS2 client version to 0.0.11 (#28990) 2019-11-23 21:22:50 +01:00
Fabian Affolter
2a8e99d799 Upgrade mutagen to 1.43.0 (#28984) 2019-11-23 18:01:27 +01:00
Jesse Hills
ebd38395fb Update pyjuicenet dependency (#28958)
Closes #28926
2019-11-23 16:46:48 +01:00
Fabian Affolter
f1d4a3cd6e Catch Zeroconf exception (#28728)
* Catch Zeroconf exception

* Make it an error
2019-11-23 16:46:06 +01:00
jjlawren
2c00a9ec68 Fix Plex setup race condition v2 (#28943)
* Connect websocket when platforms ready, not when HA is ready

* Use callbacks from platform setup tasks instead

* Convert setup to async

* Apply suggestions from code review

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
2019-11-23 09:16:21 -06:00
majuss
614842bcf2 Bumped pypca to 0.0.7 (#28976) 2019-11-23 14:41:52 +01:00
shred86
0a58853689 Fix temp not being reported properly (#28973) 2019-11-23 12:29:54 +01:00
Josef Schlehofer
b4f477f4de Upgrade youtube_dl to 2019.11.22 (#28964) 2019-11-23 11:13:44 +01:00
Tomasz
23737e0225 Rename rest_command request to response, add exc_info for exceptions (#28521)
* rename request to response, isort and black fixes

* Log exception details

* Add status code to success log, reformat log

* new syntax for response

* changed info to debug
2019-11-23 11:02:52 +01:00
cgtobi
0bd01ba495 Fix manual config (#28956) 2019-11-23 11:00:26 +01:00
Chris Mandich
08432c7c09 Add flume support (#27235)
* Add Flume Sensor

Add support for Flume API and sensor

* Add support for choosing timezone

Timezone is now a required option in configuration.yaml

* Add Flume to coveragerc and CODEOWNERS

Add flume to be ommited from testing. Add @ChrisMandich as Flume Code owner

* Revert "Add Flume to coveragerc and CODEOWNERS"

This reverts commit 0b27437a3b.

* Update manifest.json

Added Documentation URL for Flume to HASS.IO

* Update manifest.json

Added missing Newline at EOF.

* Update sensor.py

Update sensor to not required Device ID for configuration. Now loops through all available Type 2 devices and adds them as an entity.

* Update Manifest, CODEOWNERS, and manifest.json

Resolved errors related to code owners and requirements. Using hassfest and gen_requirements_all

* Update sensor.py

Implemented recommendations from @Quentame. Including time zone from Home Assistant, Updated variable names, and Consolidated duplicate functions.

* Implemented suggested changes from @Quentame

This includes: components name, using f-strings instead of concat, snake_case for variables, constants for the addition of future device types, clearer errors, and removed variables no longer in use.

* Update sensor.py

Restored unit_of_measurement. Updated return to "gal".

* Address pylint errors

* Update sensor.py

Include protected attributes in setup_platform.

* Address Pylint errors

homeassistant/components/flume/sensor.py:63:11: W0703: Catching too general exception Exception (broad-except)
homeassistant/components/flume/sensor.py:133:8: R1720: Unnecessary "else" after "raise" (no-else-raise)
homeassistant/components/flume/sensor.py:162:8: R1705: Unnecessary "else" after "return" (no-else-return)
homeassistant/components/flume/sensor.py:236:8: R1720: Unnecessary "else" after "raise" (no-else-raise)

* Update sensor.py

I'm okay with the broad exception clause.
homeassistant/components/flume/sensor.py:65:11: W0703: Catching too general exception Exception (broad-except)

* Update sensor.py

Add more specific exceptions for Try/Except.

* Update Flume Sensory.py

add requirements, exclude from tests, us pyflume pypi package.

* Update sensor.py to support latest pyflume package

* Update manifest

provide better flow of manifest and easier readibility.

* Update manifest.json

Reccomended by @balloob as it is already a core requirement

* Update sensor.py

Add proposed changes from @balloob

* Update requirements_all.txt

pytz is a core dependency, removing flume's requirement for it.

* Update sensor.py

Added @MartinHjelmare recommended changes.

* Update sensor.py

Resolving PyLint error

* Update sensor.py

Remove `KeyError`. Add length check for flume entity list before adding.

* Update sensor.py

* Update pyflume version

* Update imports with isort

* Add line break between standard library and thirdparty imports.

* Remove throttle from sensor.py
2019-11-23 09:55:46 +01:00
HomeAssistant Azure
b4caa4ab82 [ci skip] Translation update 2019-11-23 00:32:17 +00:00
Jonas
829e0a7c42 Add Proxmox VE integration (#27315)
* Added the Proxmox VE integration

* Fixed code as described in PR #27315

* Fixed small linting error

* Fix code as described in PR #27315 code review

* Improve code as described in PR #27315
2019-11-22 23:03:41 +01:00
Santobert
c35f9ee35f Creating a scene by snapshotting entities (#28939)
* Initial commit

* Add tests

* service.yaml

* typo

* snapshooted -> snapshot

* snapshot_entities instead of snapshot

* Edit validator

* Fix tests

* Remove keys()

* Improve coverage

* Activate scenes

* Use pytest.raise

* snapshot -> snapshotted
2019-11-22 13:21:28 -08:00
akasma74
a977f398ae Fix return values of preset_mode(s) properties (#27751)
It is incorrect to return None as a result of proprety call because in such a case state_attr call will return None as well, which means "Unknown attribute".
Instead for preset_mode(s) PRESET_NONE constant should be used for consistency.
2019-11-22 21:27:40 +01:00
Tobias Perschon
d92f48646a Add round to half template method (#28948)
* added round to half method

Signed-off-by: Tobias Perschon <tobias@perschon.at>

* testcase for new round method

Signed-off-by: Tobias Perschon <tobias@perschon.at>
2019-11-22 10:08:41 -08:00
awkwardDuck
6d77c15f28 fix typo for mediumvioletred (#28941) 2019-11-22 15:33:53 +01:00
Pascal Vizeli
051e37eb49 Fix ikea lights on deconz (#28949)
* Fix ikea lights on deconz

* check for None

* Use cleaner code style
2019-11-22 15:32:05 +01:00
kurniawan77
9a23a1c336 Add device trigger support for Aqara WXKG11LM 2016 switch to Deconz (#28946)
https://github.com/dresden-elektronik/deconz-rest-plugin/wiki/Xiaomi-WXKG11LM-2016
2019-11-22 13:54:56 +01:00
HomeAssistant Azure
1968a88336 [ci skip] Translation update 2019-11-22 00:32:10 +00:00
Paulus Schoutsen
37f808f4d8 Merge pull request #28932 from home-assistant/rc
0.102.1
2019-11-21 15:06:27 -08:00
Per Sandström
e3b2a33962 Bump verisure to vsure 1.5.4 and jsonpath 0.82 (#28933) 2019-11-21 22:53:02 +01:00
jjlawren
ab9a60f83f Delay Plex websocket connection to avoid race (#28934) 2019-11-21 12:39:39 -08:00
jjlawren
a62bd97fa5 Delay Plex websocket connection to avoid race (#28934) 2019-11-21 12:39:24 -08:00
Paulus Schoutsen
3391fc660a Bumped version to 0.102.1 2019-11-21 12:25:12 -08:00
Bram Kragten
42809ad6a9 Updated frontend to 20191119.5 (#28925)
* Updated frontend to 20191119.4

* Updated frontend to 20191119.5
2019-11-21 12:25:05 -08:00
cgtobi
dba87fd2e1 Fix missing Netatmo sensors (#28899)
* Update pyatmo to 3.0.1

* Improve sensor name

* Fix missing sensors

* Update pyatmo module

* Update pyatmo to 3.1.0

* Update requirements

* Fix method call
2019-11-21 12:25:04 -08:00
Bram Kragten
c015f94fa2 Updated frontend to 20191119.5 (#28925)
* Updated frontend to 20191119.4

* Updated frontend to 20191119.5
2019-11-21 19:05:26 +01:00
cgtobi
86e581b83d Fix missing Netatmo sensors (#28899)
* Update pyatmo to 3.0.1

* Improve sensor name

* Fix missing sensors

* Update pyatmo module

* Update pyatmo to 3.1.0

* Update requirements

* Fix method call
2019-11-21 17:35:03 +01:00
SNoof85
c7c7a9ad06 Update __init__.py (#28911) 2019-11-20 22:31:39 -08:00
HomeAssistant Azure
0e14c3f92a [ci skip] Translation update 2019-11-21 00:32:11 +00:00
Paulus Schoutsen
df3e17a983 Merge pull request #28909 from home-assistant/rc
0.102.0
2019-11-20 14:04:30 -08:00
Kevin Eifinger
9f181ac92e bump herepy to 0.6.3.3 (#28907)
* bump herepy to 0.6.3.3

* run gen_requirements_all
2019-11-20 22:37:59 +01:00
Paulus Schoutsen
138cee8069 Version bump to 0.102.0 2019-11-20 13:05:54 -08:00
Bram Kragten
787aac7cf2 Fix Almond onboarding url when using cloud (#28908) 2019-11-20 13:05:37 -08:00
Bram Kragten
ae3cf72fb2 Fix Almond onboarding url when using cloud (#28908) 2019-11-20 13:03:01 -08:00
Raman Gupta
1c630738f7 update services.yaml for keyboard component (#28889) 2019-11-20 21:40:00 +01:00
Raman Gupta
288ae8b1e7 Update services.yaml for cloudflare component (#28888)
* update services.yaml for cloudflare component

* Made description more clear
2019-11-20 15:45:11 +01:00
Alexei Chetroi
4ba2bd232c Command arguments for issue_zigbee_cluster_commands. (#28885) 2019-11-20 08:34:06 -05:00
Raman Gupta
b267d54db3 Update services.yaml for Roku component (#28887)
* update services.yaml for roku component

* add new line
2019-11-20 13:14:13 +01:00
Bram Kragten
bca93ca2ec Bumped version to 0.102.0b3 2019-11-20 12:33:39 +01:00
Bram Kragten
98c7ddc0cf Updated frontend to 20191119.2 (#28896) 2019-11-20 12:32:13 +01:00
Bram Kragten
9fb289ad93 Updated frontend to 20191119.1 (#28881) 2019-11-20 12:32:12 +01:00
Bram Kragten
69b096023a Updated frontend to 20191119.0 (#28875) 2019-11-20 12:32:11 +01:00
Santobert
ab41310847 Fix setting colors while reproducing a lights state (#28871)
* Fix setting colors while reproducing state

* Reorder list
2019-11-20 12:32:10 +01:00
Andi
687b7fc8cb Fix Synology camera whitelist (#28822)
* Fix Synology camera whitelist

If whitelist config is set, not camera is added to HA at all.

* Fix Synology Camera whitelist

Fix typo in config key.

* Update camera.py

Access config dict the voluptuous way
2019-11-20 12:32:09 +01:00
Franck Nijhof
89cd5d46cd Fix documentation URL in failed platform config check (#28814)
* Fix documentation URL in failed platform config check

* Replace pop from list by access using negative index

* Use of split instead of rsplit
2019-11-20 12:32:09 +01:00
Bram Kragten
d9f146d076 Updated frontend to 20191119.2 (#28896) 2019-11-20 12:30:32 +01:00
foxy82
9fd6afc5fb Allow connection to rfxtrx using tcp (#28297) 2019-11-19 21:11:17 -05:00
Franck Nijhof
6db4e975e3 Bump pytest to 5.3.0 (#28883) 2019-11-19 20:51:25 -05:00
Abílio Costa
e60ae77f1b Add ZHA service to issue group commands (#28823)
* add service to ZHA to issue group commands
* fix args
2019-11-19 19:49:09 -05:00
HomeAssistant Azure
6b62328c0f [ci skip] Translation update 2019-11-20 00:32:09 +00:00
Santobert
8e7a9521dc Fix setting colors while reproducing a lights state (#28871)
* Fix setting colors while reproducing state

* Reorder list
2019-11-19 16:16:59 -06:00
Bram Kragten
b92b6c40b7 Updated frontend to 20191119.1 (#28881) 2019-11-19 16:16:43 -06:00
Michael Hansen
c2161b1f5a Add HTTP view to conversation to handle intents via JSON POST (#28818) 2019-11-19 13:47:03 -06:00
Rohan Kapoor
cd8c281cb6 Add @rohankapoorcom to CODEOWNERS for speedtestdotnet and fastdotcom (#28879) 2019-11-19 13:43:21 -06:00
Paulus Schoutsen
94675ca5a7 Mark entity abc (#28869)
* Mark entity abc

* Use abstractmethod in climate

* Lint
2019-11-19 13:42:09 -06:00
Franck Nijhof
21157f9dac Downgrade duplicate YAML key log to warning (#28851) 2019-11-19 13:09:23 -06:00
Franck Nijhof
9324845aaa Move imports to top for serial_pm (#28861) 2019-11-19 13:07:29 -06:00
Franck Nijhof
9002955787 Move import to top for aftership (#28860) 2019-11-19 13:07:17 -06:00
Franck Nijhof
2d4b038b48 Move import to top for alarmdecoder (#28862) 2019-11-19 13:06:56 -06:00
Marius
5203c72fca Add state dependent icons to moon sensor (#28743)
* have sensor.moon use state dependent icons

Material design icons have icons for all sensor.states, let's use these natively in the component.
Based on the Season icons, tried to change accordingly.

* Update sensor.py

added state constants

* Update sensor.py

fixed missing mdi:

* order of constants. moon icons and use self.state

change order of constants to alphabetical, changed order in Moon_icons to alphabetical, used self.state for icon lookup

* replace the strings

 replace the strings for self.state with the constants

* removed quotes

* removed spaces, empty line

* local Black

* Sort imports and move import to file header


Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
2019-11-19 19:10:15 +01:00
Franck Nijhof
5fcfdee6b5 Fix documentation URL in failed platform config check (#28814)
* Fix documentation URL in failed platform config check

* Replace pop from list by access using negative index

* Use of split instead of rsplit
2019-11-19 18:33:09 +01:00
springstan
e915dd0d95 Pulseaudio: Changed default port from 4712 to 4713 (#28857) 2019-11-19 16:28:12 +01:00
ktnrg45
b83f92e4a5 Bump pyps4-2ndscreen to 1.0.3 (#28874) 2019-11-19 15:21:46 +01:00
Pascal Vizeli
a4ed1d69b8 Add init for run inside devcontainer 2019-11-19 13:53:12 +00:00
Bram Kragten
1f4296f688 Updated frontend to 20191119.0 (#28875) 2019-11-19 14:48:51 +01:00
Steven Impens
475c8ebae2 Add component VersaSense (#24619)
* Add component VersaSense

* Updates based on review

* Changes based on review

* Fixed whitespace

* Fixed lines too long

* Fixed lines too long

* Formatted using black

* Added available property

* Set unavailable property appropriately

* Conversion to f-strings

* Load platform only once per platform

* Fixed duplicate identifiers across multiple devices

* Single call to async_add_entities during setup

* Removed unnecessary async/await syntax

* Added constants for key-value pairs

* Removed async/await syntax

* Added breaks in measurement check

* Added guard clause for discovery_info
2019-11-19 14:05:23 +01:00
Malte Franken
4e9e9efa43 GeoNet NZ Volcanic Alert Level sensor (#26901)
* first version of new integration

* moved icon to shared consts

* added unit tests

* transformed from geolocation to sensor integration

* alert level is now the state of the sensor

* adopted unit tests

* fixed comment

* keep all sensors registered even if the feed update fails intermittently

* bumped version of upstream library

* bumped version of integration library

* regenerated requirements

* bumped version of integration library

* bumped version of integration library

* fixed generated file

* removed commented out code

* regenerated config flow file

* update to latest integration library version

* simplified code

* removed debug log statement

* simplified code structure

* defined constant

* use core interfaces

* moved test and fixture

* sorted imports

* simplified patching

* moved fixture to central config file
2019-11-19 14:00:59 +01:00
HomeAssistant Azure
8439e597ce [ci skip] Translation update 2019-11-19 00:32:19 +00:00
Andi
61bb24c423 Fix Synology camera whitelist (#28822)
* Fix Synology camera whitelist

If whitelist config is set, not camera is added to HA at all.

* Fix Synology Camera whitelist

Fix typo in config key.

* Update camera.py

Access config dict the voluptuous way
2019-11-18 17:03:10 +01:00
Evgeny
1a46294e6d Update roomba integration (#28560)
* Updated iRobot integration

* added custom delay for periodic mode

* new version of roombapy
2019-11-18 16:59:07 +01:00
Quentame
eb23846cfe Move imports in owntracks component (#27780)
* Move imports in owntracks component

* Fix nacl import

* Fix nacl import 2

* Fix nacl import 3

* Add helper.supports_encryption tests

* Fix tests helper 1

* Fix tests 2

* Add not_supports_encryption + get_cipher_error tests

* Code cov

* Fix nacl_not_imported test
2019-11-18 16:47:30 +01:00
Bram Kragten
7966411274 Bump version 2019-11-18 15:44:17 +01:00
Bram Kragten
bf4c81aa5e Updated frontend to 20191118.0 (#28852) 2019-11-18 15:43:20 +01:00
cgtobi
d91eddc4f0 Update pyatmo to 3.0.1 (#28829) 2019-11-18 15:43:19 +01:00
Jackie Yang
fb1fd19aae Fix miio air quality sensor (#28828)
Fix https://github.com/home-assistant/home-assistant/issues/28827
2019-11-18 15:43:18 +01:00
Michaël Arnauts
c6343c9e88 Fix Comfoconnect errors during startup (#28802)
* Add callback registrations to async_added_to_hass

* Fix CODEOWNERS

* Fix code formatting

* Requested changes.

* Don't pass unused hass and fix string formatting

* Fix import order.
2019-11-18 15:43:17 +01:00
Bram Kragten
b964fcc5b1 Updated frontend to 20191115.0 (#28797) 2019-11-18 15:43:17 +01:00
Peter Nijssen
31cbdbf1dd Fix broken postnl sensor (#28794)
* fix broken postnl sensor

* make sure shipment list is not growing indefinitely
2019-11-18 15:43:16 +01:00
LeoCal
f8be1512b8 Fix Swisscom empty response received (#28782) 2019-11-18 15:43:15 +01:00
SukramJ
5ff24ecf77 Fix HomematicIP Cloud Alarm Control Panel support for basic mode (#28778) 2019-11-18 15:43:14 +01:00
Morten Trab
fe5f30ba78 Fix Repetier integration entity indexing (#28766)
* Fixed multi extruder/beds/chambers index issue, #28130

* Switched from .format to f style name formatting

* Fixed incorrect indexing

* Removed VS files

* Removed not need temp_id subtraction

* Removed VS files

* Fixed access mode

* Fixed access mode

* Fixing access mode - again
2019-11-18 15:43:13 +01:00
Tyler Page
5f0f5ca557 Fix changing venstar operation_mode (#28754) 2019-11-18 15:43:12 +01:00
fredericvl
1479e7353b Change unique id for SAJ sensor based on device SN (#28663)
* Change unique id for SAJ sensor based on device SN

* Add SAJ device name + sn to state attributes

* Revert device state attributes (after review)
2019-11-18 15:43:12 +01:00
Brendon Baumgartner
326c25a766 Fix amazon dependency conflicts (#28217)
* fix amazon dependency conflicts

* bump boto3 for route53
2019-11-18 15:43:11 +01:00
Bram Kragten
f6b48dec94 Updated frontend to 20191118.0 (#28852) 2019-11-18 15:40:26 +01:00
Kevin McCormack
a4ae9a94ee Update Vivotek camera integration (#28841)
- Add optional security_level config
- Bump libpyvivotek to 0.3.1
2019-11-18 10:01:36 +01:00
Paul Romkes
5731f528d2 Make intents end Snips session without speech (#28820)
* intents should also end session without speech

* Move endSession message to try block

* Minor improvement on endSession response
2019-11-18 09:13:22 +01:00
cgtobi
90c7d0e56a Update pyatmo to 3.0.1 (#28829) 2019-11-18 09:10:59 +01:00
Ville Skyttä
d4c80f160c Add bandit, use to catch known vulnerable XML parsing (#28341)
* Add bandit to pre-commit and CI, use to catch known vulnerable XML parsing

* Use defusedxml instead of direct xml.etree to parse XML

* Move config to tests/bandit.yaml
2019-11-18 09:10:15 +01:00
HomeAssistant Azure
aef808d2bf [ci skip] Translation update 2019-11-18 00:32:22 +00:00
Michaël Arnauts
3d5b007c6b Implement more Comfoconnect sensors (#28817)
* Rework Comfoconnect sensor platform

* Sort ATTRS and fix icon

* Add unique_id to fan

* Use a different signal per sensor type

* Add more logging

* Swap to be sure.

* Remove -fan suffix from unique_id
2019-11-18 00:39:49 +01:00
Guillermo Ruffino
0c48b8ec52 Esphome climate features (#28786)
* add esphome climate fan

* adds back compatibility support

* fixes, add swing mode

* revert client config

* sort import

* rebase
2019-11-17 23:14:19 +01:00
Fabian Affolter
101ab5c3fa Align naming (#28830)
* Align naming

* Update tests
2019-11-17 15:53:34 +01:00
Jay Newstrom
cb63a9d7e1 Add broadcast address for WOL and samsungtv (#28819)
* Add broadcast address for WOL and samsungtv

* Fix style

* Fix tests, and add new test for new functionality

* Fix code style
2019-11-17 13:17:22 +01:00
Jordan Speicher
f25a3cbfcf Add broadcast_address for wake-on-lan (#28793) 2019-11-17 12:52:33 +01:00
Jeff Irion
c7f684d3f4 Bump androidtv to 0.0.34 (#28816)
* Bump androidtv to 0.0.33; add pure-python-adb requirement

* python -m script.gen_requirements_all

* Avoid redundant 'available' check

* Bump androidtv to 0.0.34

* Update docstrings for the decorator functions
2019-11-17 12:47:14 +01:00
Jackie Yang
0a9ac7e655 Fix miio air quality sensor (#28828)
Fix https://github.com/home-assistant/home-assistant/issues/28827
2019-11-17 12:18:53 +01:00
HomeAssistant Azure
d1241147c8 [ci skip] Translation update 2019-11-17 00:32:32 +00:00
Michaël Arnauts
d6e99db38e Fix Comfoconnect errors during startup (#28802)
* Add callback registrations to async_added_to_hass

* Fix CODEOWNERS

* Fix code formatting

* Requested changes.

* Don't pass unused hass and fix string formatting

* Fix import order.
2019-11-16 15:05:17 +01:00
Santobert
0996b717ce Improve coverage of input_datetime/reproduce_state (#28272)
* Improve coverage of input_datetime/reproduce_state

* Improve tests
2019-11-16 13:27:54 +01:00
Fabian Affolter
fbe3d8dade Upgrade shodan to 1.19.1 (#28809) 2019-11-16 11:58:15 +01:00
Fabian Affolter
2779d4f66e Upgrade alpha_vantage to 2.1.2 (#28810) 2019-11-16 11:58:04 +01:00
michaeldavie
d736c5f648 Truncate sensor state values (#28788) 2019-11-16 10:56:54 +01:00
Peter Nijssen
87b13ee732 Fix broken postnl sensor (#28794)
* fix broken postnl sensor

* make sure shipment list is not growing indefinitely
2019-11-16 10:37:58 +01:00
bouni
afbd966ba6 Move imports in braviatv component (#27855)
* Move imports in braviatv component

* import braviarc directly

* fixed import

* directly import BraviaRC
2019-11-16 10:25:25 +01:00
Tommy Larsson
8a28d5fbee Add ombi password authentication option (#28742)
* Add password authentication option

* Add vol.Exclusive for auth config params
2019-11-16 10:23:05 +01:00
Ville Skyttä
d88ca0f5cb Lint exclusions (#28655)
* Remove malformed pylint disable markers

* Remove some unused imports

* Remove some unneeded lint exclusions

* Remove more unneeded lint exclusions

* Add specific codes to all noqa's
2019-11-16 10:22:07 +01:00
Ville Skyttä
2aee366a1f Upgrade pylint, tweak config (#28798)
* Upgrade pylint to 2.4.4 and astroid to 2.3.3

https://pylint.readthedocs.io/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-4-4
https://github.com/PyCQA/astroid/blob/astroid-2.3.3/ChangeLog

* Disable pylint score and persistence

We don't use scoring, and it can be supposedly incorrect (so worse
than ignorable) when using more than one parallel job.
2019-11-16 09:59:26 +01:00
John Mihalic
16f8ae1535 Bump pyHik library to 0.2.5 for id, tamper fixes (#28807) 2019-11-16 09:57:04 +01:00
Fabian Affolter
d8ca2e9d71 Upgrade sqlalchemy to 1.3.11 (#28721) 2019-11-16 09:56:26 +01:00
Morten Trab
cd335bd434 Fix Repetier integration entity indexing (#28766)
* Fixed multi extruder/beds/chambers index issue, #28130

* Switched from .format to f style name formatting

* Fixed incorrect indexing

* Removed VS files

* Removed not need temp_id subtraction

* Removed VS files

* Fixed access mode

* Fixed access mode

* Fixing access mode - again
2019-11-16 09:45:43 +01:00
Bram Kragten
5e20817ea4 Updated frontend to 20191115.0 (#28797) 2019-11-16 07:22:06 +01:00
HomeAssistant Azure
adb3997547 [ci skip] Translation update 2019-11-16 00:32:13 +00:00
Davide Varricchio
d796053d9f Add support for Hisense AEH-W4A1 wifi module (AC remote control) (#28641)
* First commit

* First working release, but there's a lot to do

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* First commit

* First working release, but there's a lot to do

* new file:   requirements_test_all.txt

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* new file:   requirements_test_all.txt

* Fighting with tox

* vs Tox round 2

* Isort and updated requirements_test_all.txt

* Fighting with lint

* Implemented available state

* Changed exception type after Travis-ci pylint fails

* Support entry in configuration.yaml

* Removed commented code

* Switched to async

* Minor changes

* Updated library and fixed pylint errors

* Code optimization

* Implemented static ip addresses in configuration.yaml

* Reverted to existing constant

* Corrected pylint wrong-import-order

* Recovery from nuke event (messing all while rebase)

* Resolved Ci error

* Changes for PR

* Corrected temp scale for frontend

* Added test for config entry from configuration.yaml

* Updated dependency

* Check on manual config

* Imported custom exceptions and modified import config

* Optimized

* Change based on PR revision

* Added logging for failure event on manual config

* Tests added but to be corrected

* Edited tests

* Tests updated to ensure no I/O

* Working on tests

* Cheanges based on revision for PR

* Setting librey exception as direct side_effect in test

* Final changes for PR

* Redundand on command solved

* Improved AC logic
2019-11-15 21:22:24 +01:00
Tyler Page
35000848ed Fix changing venstar operation_mode (#28754) 2019-11-15 12:49:56 +01:00
LeoCal
4c690eace8 Fix Swisscom empty response received (#28782) 2019-11-15 10:52:15 +01:00
SukramJ
60e7440ec1 Fix HomematicIP Cloud Alarm Control Panel support for basic mode (#28778) 2019-11-15 09:55:40 +01:00
Paolo Tuninetto
b4ccc0202a Change keys for Samsung TV next and prev track command (#28213) 2019-11-15 09:53:16 +01:00
fredericvl
5e973dd017 Change unique id for SAJ sensor based on device SN (#28663)
* Change unique id for SAJ sensor based on device SN

* Add SAJ device name + sn to state attributes

* Revert device state attributes (after review)
2019-11-15 09:21:46 +01:00
Lado Kumsiashvili
bc14e93ae3 bump home mitemp_bt to 0.0.3. It has an important bugfix for reading … (#28765)
* bump home mitemp_bt to 0.0.3. It has an important bugfix for reading temperatures under 10 grade

* adjust the version number for mitemp_bt up to 0.0.3
2019-11-15 08:56:32 +01:00
Alan Tse
2aad150419 Convert Tesla to Async (#28748)
* build: bump teslajsonpy to 0.2.0

* feat: add async

* perf: convert unnecessary async calls to sync

* fix: force real login

* Revert change to HVAC_MODE_HEAT

* Remove charging rate sensor

* Remove tests

* Remove tests

* Address requested changes

* Add missing sensors

* Move update to async_setup_scanner

* Align wtih prior update behavior
2019-11-15 05:15:58 +01:00
cgtobi
806b96ef73 Bump pytest to 5.2.3 (#28785) 2019-11-15 05:14:46 +01:00
HomeAssistant Azure
f170ac48d2 [ci skip] Translation update 2019-11-15 00:32:15 +00:00
Brendon Baumgartner
0467ddb60c Fix amazon dependency conflicts (#28217)
* fix amazon dependency conflicts

* bump boto3 for route53
2019-11-14 21:07:43 +01:00
Bram Kragten
b2870b6833 DECONZ - Add device trigger support for aqara 86sw2 switches to Deconz (#28767)
* Add device trigger support for aqara 86sw2 switched to Deconz

* Update device_trigger.py

* Update naming
2019-11-14 19:15:08 +01:00
Paulus Schoutsen
f5a9bcdf6d Bumped version to 0.102.0b1 2019-11-14 14:36:30 +01:00
Paulus Schoutsen
af2443fb10 Fix account link version check (#28770) 2019-11-14 14:34:53 +01:00
Bram Kragten
520e4296ba Updated frontend to 20191114.0 (#28768) 2019-11-14 14:34:53 +01:00
David F. Mulcahey
4f089aba35 Bump ZHA quirks to 0.0.28 (#28750) 2019-11-14 14:34:52 +01:00
Paulus Schoutsen
2cf86a3554 Fix account link version check (#28770) 2019-11-14 14:34:13 +01:00
springstan
ea0bae2d1b Added plus sign to safe characters in urllib.parse.quote method (#28763) 2019-11-14 14:13:16 +01:00
Bram Kragten
962c47b666 Updated frontend to 20191114.0 (#28768) 2019-11-14 14:12:46 +01:00
Fabian Affolter
c6d6bbf3e0 Upgrade ephem to 3.7.7.0 (#28715) 2019-11-14 12:01:53 +01:00
HomeAssistant Azure
08d662c0a5 [ci skip] Translation update 2019-11-14 00:32:16 +00:00
Aaron Bach
3f2c344e4f Add small speed improvement when unloading RainMachine (#28759) 2019-11-13 14:27:42 -07:00
Aaron Bach
fae8cd48c4 Add small speed improvement when unloading OpenUV (#28758) 2019-11-13 14:27:15 -07:00
Aaron Bach
31131e4ac6 Add small speed improvement when unloading Notion (#28757) 2019-11-13 14:26:52 -07:00
Aaron Bach
c27b94c0e5 Add small speed improvement when unloading Ambient PWS (#28756) 2019-11-13 14:25:49 -07:00
Aaron Bach
8789da36be Add support for SimpliSafe locks (#28672)
* Start

* Lock init

* More stubbing

* Final pieces for PR

* Fixed incorrect property access

* Updaed .coveragerc

* Ensure we can handle unknown states

* Account for lock's offline property

* Account for device online

* Unload components concurrently

* Handle unknown states more gracefully
2019-11-13 20:48:08 +01:00
Bram Kragten
15e6278a2e Add config entry and device support to Demo (#28702)
* Add config entry and device support to Demo

* Some more devices

* Fix tests using demo

* Review comments

* Update config_flow.py

* Revert

* Disable pylint
2019-11-13 16:37:31 +01:00
mvn23
15ce738357 Bump pyotgw to 0.5b1 (#28751) 2019-11-13 09:32:22 -05:00
David F. Mulcahey
376e3def1d Bump ZHA quirks to 0.0.28 (#28750) 2019-11-13 09:25:45 -05:00
Thomas Germain
ec45e72bea Add verisure ethernet status (#28656) 2019-11-13 14:12:36 +01:00
Paulus Schoutsen
349e7b8cd1 Bumped version to 0.102.0b0 2019-11-13 13:55:02 +01:00
Paulus Schoutsen
8f390d099a Merge remote-tracking branch 'origin/master' into dev 2019-11-13 13:54:31 +01:00
Thomas
fe942c40a0 Correct openalpr_local config option name (#28746)
Previously was "alp_bin" now "alpr_bin" like it is outlined in the documentation (https://www.home-assistant.io/integrations/openalpr_local/)
2019-11-13 12:11:09 +01:00
Ville Skyttä
a48d426f18 Travis and tox config improvements (#28667)
* Use travis_wait only with pylint

pylint is the only job that is expected to be silent for extended time.
For others such a silence is a sign of a problem and using travis_wait
just lengthens the wait, and makes things harder to follow and debug,
because it also suppresses output in the web UI.

* Use pytest-xdist in tox

Similarly as in Azure.
2019-11-13 08:50:35 +01:00
Fabian Affolter
b4cec23add Upgrade psutil to 5.6.5 (#28717) 2019-11-13 08:43:14 +01:00
Dave T
4bcc669d19 Add device classes to weather sensors. (#28512) 2019-11-13 08:42:46 +01:00
Steven Looman
d7f45a47f5 Upgrade async_upnp_client==0.14.12 (#28733) 2019-11-13 07:43:38 +01:00
Fredrik Erlandsson
70e8c58254 version bump pypoint (#28737) 2019-11-13 07:42:12 +01:00
HomeAssistant Azure
d2d9f09f13 [ci skip] Translation update 2019-11-13 00:32:12 +00:00
Paulus Schoutsen
5961215e6e Set up Almond Web to connect to HA (#28603)
* Set up Almond Web to connect to HA

* Add missing string

* Add type
2019-11-12 11:01:19 -08:00
Otto Winter
a1f2b6d402 ESPHome fix missing state in certain circumstances (#28729)
* Fix ESPHome having missing state in certain situations

Fixes https://github.com/esphome/issues/issues/828

* Update requirements_all

* Also fix climate preset mode
2019-11-12 09:26:46 -08:00
Paulus Schoutsen
fc04b3e31c Remove choice word when Almond has choices (#28725) 2019-11-12 09:22:28 -08:00
jjlawren
5f177fa42e Use library method for season number (#28708) 2019-11-12 10:05:30 -06:00
Kevin Eifinger
48fd95c7db Fix Here Travel Time unable to find entity on startup (#27237)
* add support for entity_id as state of entity

* add circular reference detection

* voluptuous instead of regex

* wait for EVENT_HOMEASSISTANT_START

* move delayed_sensor_update to async_added_to_hass

* add @callback decorator

* remove nested entity resolving
2019-11-12 15:04:17 +01:00
Fabian Affolter
1208ab4c76 Upgrade discogs_client to 2.2.2 (#28723) 2019-11-12 12:28:34 +01:00
SukramJ
e8348221d4 Allow preset boost for Homematic IP Cloud power switches (#28713)
* Allow preset boost for Homematic IP Cloud  power switches

* Sort Imports

* Add test

* align test data
2019-11-12 11:32:32 +01:00
Federico Leoni
4f11eec1a1 Update binary_sensor.py (#28707)
* Update binary_sensor.py

* Fix style issues
2019-11-12 09:53:08 +01:00
jjlawren
87606bc12b Bump plexapi to 3.3.0 (#28709)
* Bump plexapi to 3.2.0

* Bump to 3.3.0
2019-11-11 19:30:07 -08:00
Aaron Bach
a89b4011ee Ensure SimpliSafe alarm control panels can return from being offline (#28710) 2019-11-11 18:55:31 -07:00
Alexei Chetroi
cfa689c3a6 Bump up ZHA dependencies. (#28711) 2019-11-11 20:53:23 -05:00
HomeAssistant Azure
25b0631264 [ci skip] Translation update 2019-11-12 00:32:11 +00:00
GaryOkie
a9a1c2b91d Update Homekit climate.py to remap current mode (#28625)
* Update Homekit climate.py to remap current mode

This update changes the mapping of Homekit's Current Mode Heating/Cooling State  to show the HASS Hvac_action attribute as "idle" instead of "off" when the returned value is 0.

* Update climate.py

removed imported constant no longer being used  (CURRENT_HVAC_OFF)

* corrected update to climate.py

trying again to remove unused constant.

* Update test_climate.py

* removed "change" comment

The added comment describing the change was not needed and should not be included, as it will already be described via "git annotate"  (per @jc2k)
2019-11-12 00:35:09 +01:00
Quentame
decab3e15b Add config flow tests for OwnTracks (#28644)
* Add config flow tests for OwnTracks

* Fix pylint

* Woops, uncomment test

* Woops again, logs removed

* Review from @MartinHjelmare + fix pylint
2019-11-11 21:30:00 +01:00
jjlawren
cfcacc2827 Bump plexwebsocket to 0.0.5 (#28703) 2019-11-11 19:26:56 +01:00
Bas Nijholt
3ce850234f fix typo in comments (#28694)
The global is called `PARALLEL_UPDATES` not `PARALLEL_UPDATE`.
2019-11-11 13:51:26 +01:00
Bram Kragten
90e723e25e Allow icons to be masked (#28692) 2019-11-11 02:53:57 -08:00
Kevin Lee
7bfde2dd33 Add Lutron hybrid keypad raise/lower buttons (#28674)
* Lutron: Add support for hybrid keypad raise/lower buttons

* Add MasterRaiseLower
2019-11-11 08:07:48 +01:00
Teemu R
b6c7976477 Add xiaomi_miio chuangmi.plug.hmi206 (#28688)
Related: https://github.com/rytilahti/python-miio/issues/574
2019-11-11 07:59:07 +01:00
Jon Gilmore
aea7c1c0ce Add codeowner for lutron integration (#28682)
* add codeowner for lutron integration

* ran hassfest
2019-11-11 01:51:24 +01:00
HomeAssistant Azure
0ac8b297cd [ci skip] Translation update 2019-11-11 00:32:13 +00:00
Rohan Kapoor
65dd7d998b #28645: Bump up zm-py to 0.4.0 (#28681) 2019-11-10 13:51:00 -08:00
Bram Kragten
66a574eca4 Hue: store current sensor entities by bridge (#28679) 2019-11-10 11:37:34 -08:00
jjlawren
206547a5d8 Skip updating idle Plex clients (#28664)
* Skip updating idle clients

* Different operators
2019-11-10 11:35:12 +01:00
Per Sandström
a9536e4ed1 verisure autolock service (#27366) 2019-11-10 08:25:10 +01:00
HomeAssistant Azure
65bf0a30f0 [ci skip] Translation update 2019-11-10 00:32:12 +00:00
jjlawren
ef687a36ff Add Plex debug logging (#28665) 2019-11-09 17:02:56 -06:00
Gerard
25f0b70966 Upgrade bimmer_connected to 0.6.2 (#28651)
* Upgrade bimmer_connected to 0.6.1

* Remove time.sleep from library
2019-11-09 23:43:04 +01:00
Aaron Bach
179a2eb187 Create base entity for SimpliSafe 2019-11-09 23:41:02 +01:00
Franck Nijhof
a39cac765e Add sensor platform to WLED integration (#28632)
* Add sensor platform to WLED integration

* Process review comments
2019-11-09 20:18:41 +01:00
Martin Hjelmare
fc95a3d088 Fix xiaomi vacuum tests (#28658)
* Fix xiaomi exceptions test

* Fix xiaomi_specific_services test

* Fix remaining xiaomi miio vacuum tests

* Clean up
2019-11-09 14:07:01 +01:00
bluestripe
0954f7d3be Add bluesound speaker group attribute (#28142)
* Added bluesound speaker group attribute.

* Changed code to fix failing tests.

* Changed condition checking for empty group list.

* Investigating CI pipeline error

* Changed back to the code that passed CI earlier

* Changed condition on existence of list and sorting of bluesound_group

* Re-introduced guard on group_name None
2019-11-09 08:16:53 +01:00
Shulyaka
58eeea903f Add pcal9535a integration (#26563)
* Support for PCAL9535A chip

Signed-off-by: Denis Shulyaka <Shulyaka@gmail.com>

* Code review changes

* Code review changes

* Fix import order

* Fix import order

* Apply suggestions from code review
2019-11-09 08:14:46 +01:00
shred86
97224df4fd Fix Abode capture_image and trigger_quick_action services (#28546)
* Fix Abode services

* Bump abodepy version

* Updated using dispatcher helper

* Code review fixes

* Removed init method from AbodeQuickActionBinary Sensor
2019-11-09 07:35:45 +01:00
HomeAssistant Azure
45b53c8e82 [ci skip] Translation update 2019-11-09 00:32:20 +00:00
LeoCal
bc53e9d0c8 Fix unhandled exception when Swisscom Internet Box is not responsive (#28618)
* Update device_tracker.py

From time to time, Swisscom Internet Box fails to respond and this causes an exception, which is currently not handled by the code:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/device_tracker/setup.py", line 164, in async_device_tracker_scan
    found_devices = await scanner.async_scan_devices()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 46, in scan_devices
    self._update_info()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 67, in _update_info
    data = self.get_swisscom_data()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/swisscom/device_tracker.py", line 83, in get_swisscom_data
    request = requests.post(url, headers=headers, data=data, timeout=10)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/sessions.py", line 686, in send
    r.content
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 828, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/srv/homeassistant/lib/python3.7/site-packages/requests/models.py", line 757, in generate
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.1.1', port=80): Read timed out.

I've just added a try-except around the post.

* Update device_tracker.py

Addressed blank line issue reported by flake8

* Update device_tracker.py

Fixed alignment to be Black compliant.

* Update device_tracker.py

Fixed one more alignment issue
2019-11-08 11:01:35 -08:00
Ari
504ad6488c Add support for Heat Mode detection for ecobee Heat Pumps (#28273)
* Add support for Heat Mode detection for Heat Pumps - Fixes #26547

Since the ecobee component started to dynamically set the supported HVAC modes based on querying the device a few releases ago, users with Heat Pumps noticed that the Heat mode was no longer offered as an option by HA. Some of us did not actually notice until the summer was over :). This commit fixes that.

For heatpumps, ecobee returns:
'coolStages': 1, 
'heatStages': 0,
'hasHeatPump': True,

Fix tested on HA 100.1 and 100.3

Fixes bug https://github.com/home-assistant/home-assistant/issues/26547

* changed line formatted with black
2019-11-08 19:08:50 +01:00
fredericvl
caedc14b00 Added support for multiple SAJ solar inverters (#28612)
Changes after review
2019-11-08 10:48:28 -07:00
Tomasz
f8d3ea20b6 Move imports in xiaomi_miio (#27773)
* move imports in xiaomi_miio

* reorder imports with isort

* fix pylint error

* Rename imports
2019-11-08 18:32:44 +01:00
David F. Mulcahey
f2c56cff43 Bump ZHA quirks version (#28636) 2019-11-08 09:12:50 -08:00
Bram Kragten
d0f1e9fc01 Updated frontend to 20191108.0 (#28638) 2019-11-08 09:12:20 -08:00
Bram Kragten
28c6837f00 Add attribution and onboarding commands to conversation and Almond (#28621)
* Add attribution and onboarding commands to conversation and Almond

* False -> None

* Comments

* Update __init__.py

* Comments + websocket for convert

* Lint
2019-11-08 09:06:23 -08:00
cgtobi
4435b3a5c9 Fix issue with multiple Netatmo home coach devices (#28407)
* Retrieve more detailed module infos

* Switch to using IDs

* Bump pyatmo version to 2.3.3

* Update requirements

* Undo the change of the unique id

* Rename variable
2019-11-08 17:12:41 +01:00
Fredrik Erlandsson
cffadf919a Add turn_on/off to tfiac (#27712)
* Add turn_on/off to tfiac

* fix ws issue
2019-11-08 17:02:44 +01:00
Paulus Schoutsen
bd54ff3c02 Add TT WS API (#28599)
* Add TT WS API

* Add a test

* Correctly convert TT errrors
2019-11-08 10:06:16 +01:00
Franck Nijhof
b2071b81c1 Add switch platform to WLED integration (#28606)
* Add switch platform to WLED integration

* Use async_schedule_update_ha_state in async context

* Process review comments
2019-11-08 09:48:46 +01:00
akasma74
e96b5ef2b0 Fix generic_thermostat too_hot/too_cold (#27860)
* fix for too_hot/too_cold

Closes #27802

* too_hot correction
2019-11-08 09:25:37 +01:00
Ville Skyttä
4f56f4e7e9 Add Huawei LTE device registry support (#28594) 2019-11-08 09:19:59 +01:00
HomeAssistant Azure
64166583b3 [ci skip] Translation update 2019-11-08 00:32:12 +00:00
Jeff Irion
a71d852f16 Use friendly app names for Fire TV sources (#28417)
* Use friendly app names for Fire TV sources

* Remove debugging statement

* Tests pass

* Use 'blocking=True' to patch service calls

* Remove parentheses
2019-11-07 15:04:59 -07:00
Brett T. Warden
1012215709 Match ALARM in NUT UPS status message (#28591)
If ups.status contains "ALARM", add "Alarm" to virtual sensor ups.status.display.

Fixes #28580
2019-11-07 15:03:32 -07:00
jjlawren
2bdfa9928b Allow to skip SSL validation on Plex websocket (#28615) 2019-11-07 21:54:48 +01:00
Paulus Schoutsen
fadb6a3979 Add support for conversation ID (#28620) 2019-11-07 12:21:12 -08:00
Paulus Schoutsen
9b5fa2e67c Add device conditions to climate (#28553)
* Add device conditions to climate

* Update strings.json
2019-11-07 17:03:06 +01:00
SukramJ
9d3d35ad79 Add cool mode to HomematicIP climate (#28525)
* Add cool mode to HomematicIP climate

* Update test

* remove preset_party

* Fix profile_names check
2019-11-07 16:41:33 +01:00
Paulus Schoutsen
899306c8ec Add vacuum device conditions (#28551) 2019-11-07 16:29:39 +01:00
Paulus Schoutsen
a80baf2e5f Add fan device condition (#28549) 2019-11-07 16:29:10 +01:00
Paulus Schoutsen
48660585f1 Add climate device triggers (#28544)
* Add climate device triggers

* Test capabilities
2019-11-07 16:28:45 +01:00
Heine Furubotten
af73e54aee Add azure servicebus notify service (#27566)
* Add azure servicebus notify service

* files added to .coveragerc

* fix: import content type from const

* Moved imports to top level

* Code review fixes
+ added code owner
+ fixed config validation with has at least one
+ seperate attributes for dto to asb
* fixed doc link
* async setup instead of sync

* rename all the things
- removed too many ifs
* changed setup back to sync
+ comment about sync IO in lib

* More informative logging

* logging exception -> error
2019-11-07 14:47:44 +01:00
Pascal Vizeli
abb78a0d13 Fix fan strings 2019-11-07 13:48:23 +01:00
Pascal Vizeli
50f1b6c689 Fix vacuum strings 2019-11-07 13:47:26 +01:00
Paulus Schoutsen
d34caf50f1 Add climate device actions (#28552) 2019-11-07 13:44:59 +01:00
Bram Kragten
76aae0c23e Fix demo TTS (#28608) 2019-11-07 13:43:43 +01:00
Paulus Schoutsen
6999a712ef Add device triggers to vacuum (#28548)
* Add device triggers to vacuum

* Update strings
2019-11-07 13:39:35 +01:00
Tim Gates
c3f07347a1 Fix simple typo: unhasable -> unhashable (#28605) 2019-11-07 12:39:16 +01:00
Paulus Schoutsen
5032c5a04c Add fan device trigger (#28545) 2019-11-07 12:38:58 +01:00
Paulus Schoutsen
78657bfbaf Add lock device triggers (#28547)
* Add lock device triggers

* Lint
2019-11-07 12:26:59 +01:00
Paulus Schoutsen
2c607c836f Add device action to fan (#28550) 2019-11-07 12:26:10 +01:00
Paulus Schoutsen
11cdce3758 Add device actions to vacuum (#28554) 2019-11-07 12:24:58 +01:00
Jonathan Keljo
68fd39e321 Upgrade greeneye_monitor to 1.0.1 (#28600)
This release has a fix for a crash we were seeing occasionally, and a totally
revamped packet handler which should be more robust and CPU-efficient.

Fixes #25887
2019-11-07 10:42:42 +01:00
Malte Franken
b5587348f5 update to latest integration library version (#28597) 2019-11-06 21:37:29 -08:00
HomeAssistant Azure
265c390b65 [ci skip] Translation update 2019-11-07 00:32:16 +00:00
Franck Nijhof
78b83c653a Add WLED integration (#28542)
* Add WLED integration

* Use f-string for uniq id in sensor platform

* Typing improvements

* Removes sensor & light platform

* Remove PARALLEL_UPDATES from integration level

* Correct type in code comment 'themselves'

* Use async_track_time_interval in async context

* Remove stale code

* Remove decorator from Flow handler

* Remove unused __init__ from config flow

* Move show form methods to sync

* Only wrap lines that can raise in try except block

* Remove domain and platform from uniq id

* Wrap light state in bool object in is_on method

* Use async_schedule_update_ha_state in async context

* Return empty dict in device state attributes instead of None

* Remove unneeded setdefault call in setup entry

* Cancel update timer on entry unload

* Restructure config flow code

* Adjust tests for new uniq id

* Correct typo AdGuard Home -> WLED in config flow file comment

* Convert internal package imports to be relative

* Reformat JSON files with Prettier

* Improve tests based on review comments

* Add test for zeroconf when no data is provided

* Cleanup and extended tests
2019-11-06 23:55:39 +01:00
Hans Oischinger
3d2ff841d3 Handle exceptions from PyViCare library (#28536)
* ViCare: Handle exceptions from PyViCare library (#28072)

Sometimes Viessmann server failures or other connection problems may
lead to exceptions thrown when updating data.

This commit handles those exceptions with some error logging and
makes sure that the component does not break completely in that case.

* Remove unneeded returns

* Remove unneeded returns
2019-11-06 22:46:18 +01:00
Ville Skyttä
bb37bc32e3 Always run flake8 through pre-commit, and with doctests (#28490)
* Enable flake8 doctests everywhere

* Always run flake8 through pre-commit
2019-11-06 21:38:00 +02:00
Paulus Schoutsen
d9edd42532 Update to latest Somfy changes (#28207)
* Update to latest Somfy changes

* Update api.py

* Update api.py
2019-11-06 10:55:56 -08:00
Paulus Schoutsen
9a0a889492 Fix token sent to Almond Web (#28584) 2019-11-06 08:32:33 -08:00
ssenart
9ba3abd1b7 Add Netatmo camera services (#27970)
* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement turn_on and turn_off methods.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Netatmo camera : Implement enable_motion_detection(), disable_motion_detection() operations.

* Add Presence Netatmo Camera services (set_light_auto, set_light_on, set_light_off) to control its internal flood light status.

* Add Presence Netatmo Camera services (set_light_auto, set_light_on, set_light_off) to control its internal flood light status.

* Netatmo camera : Use new style string formatting.

* Make the file compliant with flake8 linter.

* Make the file compliant with flake8 linter.

* Make it compliant with black formatter.

* Make it compliant with black formatter.

* Bug fix : Flood light control was not working with VPN url.
2019-11-06 07:52:59 -05:00
Kevin Köck
b7153ca207 Add mqtt temp_low/high_template in SCHEMA_BASE (#28257)
* fix missing temp_low/high_template in SCHEMA_BASE

* temperature_high/low_state_template test

* Update test_climate.py

* paste error

* Update test_climate.py

* Update test_climate.py

* Update test_climate.py

* Update test_climate.py
2019-11-06 07:50:54 -05:00
temeteke
2e1d05560f Reset states when connection to MPC-HC is lost (#27541)
* Reset states when connection to MPC-HC is lost

* Add the available property of mpchc
2019-11-06 07:47:34 -05:00
Josef Schlehofer
ac4d8ee07f Upgrade youtube_dl to 2019.11.05 (#28578) 2019-11-06 09:51:20 +01:00
Zach
e99bb8f75e Fix Doods error when detection labels are specified in list form (#28574) 2019-11-06 08:45:16 +01:00
Jeff Irion
438ee99175 Bump adb-shell to 0.0.8 (#28582)
* Bump 'adb-shell' to 0.0.8

* Update requirements_test_all.txt

* Update manifest.json
2019-11-06 08:02:07 +01:00
Grodesh
f8712b4d7f Update nextbus stop tag to accept strings (#27765) 2019-11-06 07:24:11 +01:00
Paulus Schoutsen
a63e976496 Fix invalid JSON in deconz strings.json 2019-11-05 20:33:37 -08:00
HomeAssistant Azure
8ab04d5fc7 [ci skip] Translation update 2019-11-06 00:31:46 +00:00
Aaron Bach
e69cd271dd Bump pytile and re-order imports (#28570) 2019-11-05 22:40:12 +01:00
Pascal Vizeli
005a1b2713 Add additional support over NC (#28527)
* Add voice support over NC

* Add disocery support for TTS / STT

* fix cloud TTS discovery

* Fix dev config

* Fix discovery

* Bump hass-nabucasa 0.25

* Add channel support

* Fix lint

* Update homeassistant/components/cloud/__init__.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/cloud/tts.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/cloud/tts.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* Update homeassistant/components/cloud/tts.py

Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>

* bump hass-nabucasa

* Update tts.py

* fix lint
2019-11-05 22:39:15 +01:00
Pascal Vizeli
925e26b061 Update azure-pipelines-ci.yml 2019-11-05 21:58:35 +01:00
Pascal Vizeli
10247f6799 Fix dev dockerfile 2019-11-05 21:38:30 +01:00
Pascal Vizeli
1e398a8966 Try fix tests (#28470) 2019-11-05 21:12:29 +01:00
Paulus Schoutsen
a48ac4d18f Merge pull request #28568 from home-assistant/rc
0.101.3
2019-11-05 10:57:08 -08:00
Paulus Schoutsen
a0443b0238 Fix flaky test 2019-11-05 09:46:36 -08:00
Paulus Schoutsen
b2a5c75fbd Bumped version to 0.101.3 2019-11-05 09:09:00 -08:00
Santobert
2814a24f9e Add deprecated attributes to light.reproduce_state (#28557)
* Add deprecated attributes to light.reproduce_state

* Add blank line

* fix minor bug

* Typo
2019-11-05 09:08:06 -08:00
Maciej Bieniek
f5306f769c Fix Airly if more than one config entry (#28498) 2019-11-05 09:08:05 -08:00
Tim McCormick
1618c5c040 Fix missing import (#28460) 2019-11-05 09:08:04 -08:00
Santobert
7b86f0f926 Add deprecated attributes to light.reproduce_state (#28557)
* Add deprecated attributes to light.reproduce_state

* Add blank line

* fix minor bug

* Typo
2019-11-05 06:43:50 -08:00
Quentame
136f1f7fe9 Move imports in samsungtv component (#27775)
* Move imports in samsungtv component

* Fix tests

* Fix review 1

* Fix review 2

* wakeonlan is a module
2019-11-05 15:04:19 +01:00
Jesse Hills
a43095b2b5 Add override switch for juicenet (#28049)
* Add override switch for juicenet

* Update generated files

* Update indentation

* Fix indentation

* Remove unnecessary else statement

* Update homeassistant/components/juicenet/switch.py

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

* Update homeassistant/components/juicenet/switch.py

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

* Remove state property

* Change string formatting

* Bump juicenet package version again
2019-11-05 14:24:20 +01:00
Zach
11efb2c2eb Avoid drawing image_processing font text inside the bow line (#27796)
* Adjust font text such that it won't be drawn inside the bow line in image_processing.draw_box

* Adjust font_height after actually counting the pixels

* Thinned out line_width and adjusted font size
2019-11-05 11:43:36 +01:00
Ville Skyttä
804b6bbc0e Reduce test requirements duplication, sync flake8 and related (#28538)
* Generate pre-commit test dependencies instead of duplicating

* Upgrade/sync to flake8 3.7.9, flake8-docstrings 1.5.0, and pydocstyle 4.0.1

https://flake8.readthedocs.io/en/latest/release-notes/3.7.9.html
https://gitlab.com/pycqa/flake8-docstrings/blob/1.4.0/HISTORY.rst
https://gitlab.com/pycqa/flake8-docstrings/blob/1.5.0/HISTORY.rst
http://www.pydocstyle.org/en/4.0.1/release_notes.html

* Include requirements_test.txt from *_all.txt instead of copying
2019-11-04 21:21:52 -08:00
Santobert
ef20f0985a Improve scene.create service (#28533)
* Improve scene.create service

* Typo

* Improve coverage

* Add from_yaml attribute

* from_service instead of from_yaml
2019-11-04 21:15:58 -08:00
Bouwe Westerdijk
fb0e20543e Update Plugwise (#28237)
* Plugwise update

* Fix DEFAULT_NAME

* Fix pylint errors

* Remove showing of DHW-status

* Remove `if not None` where possible

* Forgot to remove dhw-related code

* Updated w.r.t. comments from MartinHjelmare

* Remove the illuminance attribute - move to sensor

* Update homeassistant/components/plugwise/climate.py

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

* Breaking lines

* Remove thermostat_temperature

* Try fix lint errors.

* Remove spaces

* Remove more spaces
2019-11-05 02:58:17 +01:00
HomeAssistant Azure
ade60742d4 [ci skip] Translation update 2019-11-05 00:31:48 +00:00
Paulus Schoutsen
16a80beb43 Fix scaffold 2019-11-04 14:14:57 -08:00
Paulus Schoutsen
83a9f4ddb8 rate is a separate word (#28535) 2019-11-04 14:01:10 -08:00
Marius Flage
f5fb9fc580 Checking state before actually sending a new state change. Some projectors return ERR if you try to turn off a projector that's already off. (#28529) 2019-11-04 21:54:36 +01:00
Thom Troy
6e58a0c996 Update ephember library version (#28507)
* update ephember library version

* update requirements_all.txt for new pyephember version

* update imports to top of module
2019-11-04 21:49:53 +01:00
shred86
fe749fc0f8 Fix sensor device in the Abode component (#28516)
* Fix for occupancy sensor unique_id

* Add check for sensor attributes before adding entity

* Fixes temperature key issue

* Clean up code with better use of keys

* Code clean up
2019-11-04 21:49:11 +01:00
Bram Kragten
e419689229 Add config endpoint for scene (#28429)
* Add config endpoint for scene

* Add scenes to default config

* Fix test and add context to websocket service call

* Update scene.py

* Add tests
2019-11-04 12:38:18 -08:00
kennedyshead
bbe0cf3a0c Bump version for asuswrt to 1.1.22 (#28322)
* Bumping version

* Fix requirements

* Fix requirements
2019-11-04 20:52:55 +01:00
Martin
06c26f3ffc Add heating_type for ViCare integration (#27296)
* Add heating_type for ViCare

* Add additional gas heating properties

* Update requirements_all

* Add hvac action

* Remove measurements

* Remove unused property
2019-11-04 20:12:43 +01:00
chriscla
aaad8eac0a Fire an event when nzbget download completes (#27763)
* Fire an event when download completes

* Rename event and use a set

* Use a set comprehension

* Renaming method
2019-11-04 19:39:03 +01:00
Ville Skyttä
6a7b5657ac Support Huawei LTE SSDP discovery (#28214)
* Support Huawei LTE SSDP discovery

* Avoid KeyError on simultaneous user initiated flow

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

* Format code

* Add already configured check

* Initialize context in test flows

* Move deviceType match to manifest

* Update generated.ssdp

* Add SSDP config flow test case

* Remove stale debug print from tests
2019-11-04 19:56:49 +02:00
Charles Garwood
f3ea44cd92 Cleanup Device Registry on Z-Wave Node Removal (#28240)
* Remove device from device registry on node removal

* Make async_get_registry from entity registry more concise

* Lower log level to debug
2019-11-04 10:17:32 -05:00
Jess
5b85456759 Add switches (on/off zones) to geniushub (#28182)
* New switch platform for geniushub
* Update to new geniushub-client with support for on/off zones
2019-11-04 13:32:33 +00:00
Pascal Vizeli
99c0559a0c Speech to Text component (#28434)
* Initial commit for STT

* Fix code review
2019-11-04 13:10:42 +01:00
SukramJ
33c8cba30d Enable transition time for HmIP-BSL - HomematicIP Cloud (#28201)
* Enable transition time for HmIP-BSL - HomematicIP Cloud

harden ACP
fix hao device name

* update test, initalize instance var
2019-11-04 12:22:28 +01:00
SukramJ
b7296c61bc Align attribute naming between light and switch for HomematicIP Cloud (#28271) 2019-11-04 12:05:39 +01:00
Paulus Schoutsen
552fbda58b Remove legacy reproduce state (#28458)
* Remove legacy reproduce state

* Fix imports
2019-11-04 11:12:04 +01:00
Luca Zimmermann
9b72a55d60 Add compatibility for other STBY Codes (#28478)
Added PWR2 as valid standby code
2019-11-04 11:11:10 +01:00
Oscar Tin Lai
6004ef3279 Expose set auto mode for all Dyson fans (#28488)
Set auto mode should be exposed to all dyson fans (e.g. *Pure Cool Link* and *Pure Hot+Cool Link*) instead of only *Pure Cool*, as it is support in all of the models (i.e. similar to the set night mode).
2019-11-04 11:10:59 +01:00
Jonas Janz
fadb9bdfb3 Add information to IFTTT services.yaml (#28385)
* docs(ifttt): add information to services.yaml

* docs(ifttt): start examples lowercase

* docs(ifttt): start examples with capital letter

* docs(ifttt): end description on period
2019-11-04 10:58:39 +01:00
Tobias Efinger
40b676c06f Add services description for ness alarm (#28250) 2019-11-04 10:29:29 +01:00
Florent Thoumie
de1799d486 iaqualink: better handling of failures (#28514) 2019-11-04 09:58:27 +01:00
Fabian Affolter
60d7f730c3 Upgrade jinja2 to >=2.10.3 (#28422) 2019-11-04 09:57:20 +01:00
Fabian Affolter
cb19827932 Upgrade paho-mqtt to 1.5.0 (#28423) 2019-11-04 09:56:58 +01:00
Fabian Affolter
fe00f3558e Imports twitch (#28517)
* Move imports

* Add unique_id
2019-11-04 09:56:46 +01:00
Tom Robinson
e91bb1ab08 Replace Netatmo CO2 sensor icon (#28520) 2019-11-04 09:56:36 +01:00
Fabian Affolter
381bf987d2 Upgrade TwitterAPI to 2.5.10 (#28401) 2019-11-04 09:56:27 +01:00
SukramJ
7cbd55a817 Add dump config service to HomematicIP Cloud (#28231)
* Add dump config service to HomematicIP Cloud

* Mock builin.open

* Fix test

* reduce SGTIN if anonymize

* apply review feedback
2019-11-04 09:55:12 +01:00
Fabian Affolter
c01b7bbf28 Upgrade pillow to 6.2.1 (#28442) 2019-11-04 09:03:58 +01:00
Ville Skyttä
7e6bcb85b7 Don't fail tox pylint if PYLINT_ARGS is not set (#28403)
Closes https://github.com/home-assistant/home-assistant/issues/28342
2019-11-04 08:12:15 +01:00
Kevin McCormack
cb2f42b336 Update Vivotek component stream source (#27941)
* Update Vivotek component

Fix building stream URL

* Update Vivotek component

Make stream path optionally configurable.

* Update Vivotek camera integration

Use f-string to build stream source URL.
This improve readability and I hear it runs faster.
2019-11-04 04:11:14 +01:00
HomeAssistant Azure
0973f1961d [ci skip] Translation update 2019-11-04 00:32:38 +00:00
Maciej Bieniek
4e40394972 Fix Airly if more than one config entry (#28498) 2019-11-04 00:58:35 +01:00
Ville Skyttä
9b038bd10d Don't use deprecated encoding to json.loads (#28509)
Will be removed in 3.9, ignored in earlier supported versions.
2019-11-04 00:24:24 +01:00
Ville Skyttä
734e982822 Import CancelledError from asyncio, not .futures (#28511)
It's no longer in .futures in Python 3.8.0.
2019-11-04 00:05:01 +01:00
escoand
0768ae2dc8 Fix flaky YesssSMS tests on debug messages (#28506) 2019-11-03 23:56:08 +01:00
Joakim Plate
5fd9b474dc Always provide brightness value (#28228)
HA will remove attribute when light is off, but google expect all trait data all the time.
2019-11-03 11:36:02 -08:00
escoand
ecf2e9c0ab Fix flaky Samsung TV tests (#28503) 2019-11-03 18:32:01 +01:00
Ville Skyttä
b904a2c5ad Handle Huawei LTE timeouts (#28465) 2019-11-02 21:28:38 -07:00
Fabian Affolter
314c3d0965 Use integration name in docstring (#28445) 2019-11-02 21:28:07 -07:00
Tim McCormick
5cbb6607a6 Fix missing import (#28460) 2019-11-02 21:25:24 -07:00
András Rutkai
31752d5736 Fixing #27722 Watson TTS platform (sdk upgrade) (#28468) 2019-11-02 21:24:02 -07:00
michaeldavie
0d432f60e2 Bump env_canada to 0.0.30 (#28487) 2019-11-02 21:21:46 -07:00
Paulus Schoutsen
67eeb8f258 Fix flaky test 2019-11-02 21:21:13 -07:00
HomeAssistant Azure
f71527d5db [ci skip] Translation update 2019-11-03 00:31:44 +00:00
Ville Skyttä
1679ec3245 SSDP matching improvements (#28285)
* SSDP matching improvements

- support multiple match groups per domain
- require matches on all, not any item in a group
- support matching on all UPnP device description data

* Manifest structure fixes
2019-11-02 12:30:09 -07:00
Ville Skyttä
a8dff2f2d0 pre-commit: ship default and full configs (#28463)
For now, the only difference between the two is mypy.
2019-11-02 12:21:09 -07:00
Nash Kaminski
b8fa5367db Fix inability to transition between specific presets in Venstar component (#28238)
This change addresses a bug where one is unable to change directly between the away and temperature hold presets, as temperature hold cannot be enabled on a Venstar thermostat if away mode is active.
Furthermore, this change removes redundant state checks as the set_away and set_schedule calls are idempotent in the venstarcolortouch library. See https://github.com/hpeyerl/venstar_colortouch/blob/master/src/venstarcolortouch/venstarcolortouch.py#L275.
2019-11-02 10:51:30 +01:00
ktnrg45
512ef2fce4 Change ps4 state off to state standby (#28261)
* Change state off to state standby

* update docstring
2019-11-02 10:32:37 +01:00
Paulus Schoutsen
6c138e2982 Merge pull request #28456 from home-assistant/rc
101.2
2019-11-01 20:08:30 -07:00
Paulus Schoutsen
969b36a447 Bumped version to 0.101.2 2019-11-01 17:32:57 -07:00
Paulus Schoutsen
3f8dc5ed75 Also install after_deps (#28453) 2019-11-01 17:32:53 -07:00
jjlawren
fc7d43269c Use server-specific unique_ids for Plex media_players (#28447) 2019-11-01 17:32:52 -07:00
Robin Pronk
b88c0cf314 SNMP switch fix integer support (#28425) 2019-11-01 17:32:52 -07:00
Mister Wil
9e9537a3d0 Change Abode cache file path, add cache path to config flow (#28389)
* Changed cache file path

* Cache file naming scheme matches original

* Restart tests

* Adding cache path to config_flow.py

* Moved DEFAULT_CACHEDB to consts file

* Use correct cache path

* Linting issues
2019-11-01 17:32:51 -07:00
phispi
84e4e94d8e Prevent TypeError when KNX RGB(W) light value contains None (#28358)
* Prevent TypeError when KNX RGB(W) light value contains None.

* Pylint doesn't like 'w' as variable name, therefore using 'white' instead.

* Simplified code as suggested by pvizeli.
2019-11-01 17:32:51 -07:00
HomeAssistant Azure
4863face69 [ci skip] Translation update 2019-11-02 00:31:48 +00:00
Fabian Affolter
15900094a1 Update MQTT sensor test (#28449) 2019-11-01 17:30:37 -07:00
Mister Wil
ad4a960ed2 Change Abode cache file path, add cache path to config flow (#28389)
* Changed cache file path

* Cache file naming scheme matches original

* Restart tests

* Adding cache path to config_flow.py

* Moved DEFAULT_CACHEDB to consts file

* Use correct cache path

* Linting issues
2019-11-01 17:28:50 -07:00
Paulus Schoutsen
50affdf953 Also install after_deps (#28453) 2019-11-01 17:21:50 -07:00
Santobert
6655b7db2c Add scene.create service (#28300)
* Initial commit

* Fix scene.create
2019-11-01 15:53:42 -07:00
Robert Svensson
c0e1b97119 deCONZ - Improve discovery logging (#28452) 2019-11-01 23:36:23 +01:00
Robert Svensson
6cc947abbf deCONZ - Add Hue dimmer gen1 (rwl020) support to device triggers(#28450) 2019-11-01 23:06:29 +01:00
jjlawren
21d48218aa Use server-specific unique_ids for Plex media_players (#28447) 2019-11-01 22:41:26 +01:00
Robert Svensson
557e585e56 deCONZ - Support creating battery sensor when reported (#27538) 2019-11-01 22:31:22 +01:00
Robert Svensson
62b09580c4 deCONZ - Add Xiaomi Aqara Cube device trigger support (#27548)
* Add Xiaomi Aqara Cube device trigger support
2019-11-01 22:29:34 +01:00
Santobert
07b7d514ac Add improved scene support to the water_heater integration (#28277) 2019-11-01 13:37:34 -07:00
Santobert
12f1a8f551 Add improved scene support to the alarm_control_panel integration (#28269)
* Add improved scene support to the alarm_control_panel integration

* Add service description for alarm_arm_custom_bypass
2019-11-01 13:36:18 -07:00
SukramJ
1fb377e61e Use defined device class constants for Homematic (#28438)
* Use defined device classes for Homematic

* Remove not required default None

* Missed on None
2019-11-01 21:25:33 +01:00
phispi
f8d779e840 Prevent TypeError when KNX RGB(W) light value contains None (#28358)
* Prevent TypeError when KNX RGB(W) light value contains None.

* Pylint doesn't like 'w' as variable name, therefore using 'white' instead.

* Simplified code as suggested by pvizeli.
2019-11-01 21:23:23 +01:00
John Mihalic
44879b323e Bump pyEight library to 0.1.2 to update API URL (#28413) 2019-11-01 18:40:35 +01:00
Robin Pronk
c7d72f55e9 SNMP switch fix integer support (#28425) 2019-11-01 15:38:13 +01:00
Fabian Affolter
07337badcd Upgrade pysnmp to 4.4.12 (#28428) 2019-11-01 14:28:38 +01:00
Michael Schoonmaker
6f24d2bb3b Add a Services YAML for the Dominos integration (#27289) (#28339) 2019-11-01 14:27:26 +01:00
Fabian Affolter
083d34cdd9 Upgrade attrs to 19.3.0 (#28421) 2019-11-01 13:10:53 +01:00
Fabian Affolter
72a17d4c67 Upgrade thingspeak to 1.0.0 (#28424) 2019-11-01 13:09:45 +01:00
HomeAssistant Azure
bb6a617a6f [ci skip] Translation update 2019-11-01 00:32:13 +00:00
Daniyar Yeralin
54361342ba Introduce SUPPORT_COLOR_TEMP for flux_led component (#26692)
* Introduce SUPPORT_COLOR_TEMP for flux_led component

* Make black linter happy

* Remove duplicate SUPPORT_COLOR_TEMP

* Make linter happy
2019-11-01 00:15:20 +01:00
Paulus Schoutsen
5c9f7484c2 Merge remote-tracking branch 'origin/master' into dev 2019-10-31 14:18:03 -07:00
Paulus Schoutsen
c10e046323 Merge pull request #28399 from home-assistant/rc
0.101.1
2019-10-31 14:16:57 -07:00
Malte Franken
d200c2dca2 fix feedreader handling unrecognized published date (#28225) 2019-10-31 21:05:42 +01:00
escoand
82729bef70 Show all UPNP/IGD sensors in one device (#27517)
* show all UPNP/IGD sensors in one device

* use device name correctly

* Use id of device
2019-10-31 20:51:35 +01:00
thoscut
ec373d90c1 Add file list to attributes of folder sensor (#28338) 2019-10-31 20:49:33 +01:00
gngj
b74711793e Fill services.yaml for squeezebox (#28247)
* fill services.yaml for squeezebox

* Minor fix
2019-10-31 20:32:05 +01:00
Paulus Schoutsen
633d006554 Bumped version to 0.101.1 2019-10-31 12:11:35 -07:00
Paulus Schoutsen
4e2a8fde86 Check for import errors before validating config (#28395) 2019-10-31 12:11:30 -07:00
Paulus Schoutsen
d57fe0334f Fix check config (#28393) 2019-10-31 12:11:29 -07:00
Tsvi Mostovicz
75b8070c99 Fix hdate spamming homeassistant log (#28392)
* Fix hdate spamming homeassistant log

* Lower verbosity of another spammy message
2019-10-31 12:11:28 -07:00
Maciej Bieniek
b71e1affdb Fix Airly asyncio timeout error (#28387)
* Raise ConfigEntryNotReady

* Better asyncio.TimeoutError handling

* Sort imports

* Increase asyncio timeout
2019-10-31 12:11:28 -07:00
Steve M
d92060a461 Bump env_canada to fixed 0.0.29 version (#28360)
* Bump env_canada to fixed 0.0.29 version

* bump env_canada to 0.29
2019-10-31 12:09:43 -07:00
fredericvl
3c9482b2d3 Bump pysaj to v0.0.13 (fix for sensor date) (#28351) 2019-10-31 12:09:43 -07:00
Aaron Bach
5571c0c60a Bump pymyq to 2.0.1 (#28348) 2019-10-31 12:09:43 -07:00
Teemu R
54481598b7 Bump songpal to fix a regression (#28115)
The new release fixes a single regression from requests to aiohttp conversion.
Some devices do not respond with the correct mimetype which was not enforced
by requests but is enforced by aiohttp.

Related PR https://github.com/rytilahti/python-songpal/pull/59
2019-10-31 12:09:43 -07:00
Nikolay Vasilchuk
abbf6595bb Fix (#28369) 2019-10-31 12:07:07 -07:00
Paulus Schoutsen
631a819bd1 Fix check config (#28393) 2019-10-31 11:39:26 -07:00
Paulus Schoutsen
70c4b4a4f0 Check for import errors before validating config (#28395) 2019-10-31 11:38:06 -07:00
Tsvi Mostovicz
674860e00e Fix hdate spamming homeassistant log (#28392)
* Fix hdate spamming homeassistant log

* Lower verbosity of another spammy message
2019-10-31 11:16:27 -07:00
ZiroNL
5854eef47b Add services.yaml to onvif component (#28349) 2019-10-31 18:57:00 +01:00
Robert Van Gorkom
226b2bc3d0 Update withings-api to avoid data parsing bugs. (#28382) 2019-10-31 18:29:10 +01:00
Alexei Chetroi
89213a4ce8 Don't set entity_id in ZHA entities (#28362)
* Don't set entity_id on ZHA entities.
* Update tests.
* Use comma as separator for multiple channel names.
* Address PR comments.
2019-10-31 12:31:06 -04:00
Maciej Bieniek
d133501735 Fix Airly asyncio timeout error (#28387)
* Raise ConfigEntryNotReady

* Better asyncio.TimeoutError handling

* Sort imports

* Increase asyncio timeout
2019-10-31 09:29:27 -07:00
ochlocracy
ff5b070f4b Implement Alexa.SeekController Interface for media_player in Alexa (#28299)
* Implement Alexa.SeekController Interface for Alexa

* Added error handling and duration checks.

* Split out media_player SeekController tests and added error test.
2019-10-31 10:38:44 +01:00
gngj
bfe4a85e9d Fill services.yaml for duckdns (#28248)
* Fill services.yaml for duckdns

* Apply suggestions from code review

Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
2019-10-31 09:51:15 +01:00
Mark Coombes
e11c9d710c Add modelnumber for ecobee4 (#28278) 2019-10-31 09:49:38 +01:00
Santobert
89df821113 Flux log with debug instead of info (#28352) 2019-10-31 09:41:44 +01:00
fredericvl
ef92c5672d Bump pysaj to v0.0.13 (fix for sensor date) (#28351) 2019-10-31 09:39:27 +01:00
Steve M
d3750401c1 Bump env_canada to fixed 0.0.29 version (#28360)
* Bump env_canada to fixed 0.0.29 version

* bump env_canada to 0.29
2019-10-31 09:38:53 +01:00
HomeAssistant Azure
ee24710524 [ci skip] Translation update 2019-10-31 00:32:14 +00:00
Pascal Vizeli
2d7208470e Merge pull request #28354 from home-assistant/rc
0.101.0
2019-10-30 21:20:32 +01:00
Pascal Vizeli
7eceedea10 Bump version 0.101.0 2019-10-30 19:50:48 +00:00
Erik Montnemery
8ae43d2de3 Add device triggers to cover (#28063)
* Add device triggers to cover

* Use numeric_state trigger instead of template trigger

* Tweak translations
2019-10-30 20:49:01 +01:00
springstan
8aee92347f Fix KeyError in decora setup (#28279)
* Imported homeassistant.util and slugified address if no name is specified

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

* Removed logger.debug line only used for testing
2019-10-30 19:47:14 +00:00
Aaron Bach
bda3aadbcf Bump pymyq to 2.0.1 (#28348) 2019-10-30 09:05:13 -06:00
ZiroNL
4350467a00 Add services.yaml to local_file component. (#28330) 2019-10-30 08:36:53 +01:00
springstan
f8efc2adc6 Fix KeyError in decora setup (#28279)
* Imported homeassistant.util and slugified address if no name is specified

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

* Removed logger.debug line only used for testing
2019-10-30 07:57:40 +01:00
Paulus Schoutsen
24c29f9227 Add OAuth2 config flow scaffold (#28220)
* Add OAuth2 scaffold

* Generate integration if non-existing domain specified

* Update URL
2019-10-29 20:34:03 -07:00
HomeAssistant Azure
e700384cce [ci skip] Translation update 2019-10-30 00:32:11 +00:00
Paulus Schoutsen
cf6d11db8d Bumped version to 0.101.0b4 2019-10-29 16:17:34 -07:00
Bram Kragten
c104efc18d Updated frontend to 20191025.1 (#28327) 2019-10-29 16:16:41 -07:00
Pascal Vizeli
f021e5832a Cleanup not needed websocket flags for ingress (#28295) 2019-10-29 16:16:10 -07:00
David Bonnes
e1eab214ad allow multiple heaters per incomfort gateway (#28324)
* add multiple heaters per gateway
* bump client to handle the above
2019-10-29 21:29:39 +00:00
Sebastian Muszynski
6d734a714e Clean up Xiaomi Air Quality Monitor support (cgllc.airmonitor.b1) (#28301)
* Clean up Xiaomi Air Quality Monitor support (cgllc.airmonitor.b1)

* Remove unused variable

* Provide a proper unique_id

* Incorporate review

* Wrap the method that cause the exception

* Undo mistakenly changed file. Fixed in the separate PR.
2019-10-29 22:17:09 +01:00
Renaud Martinet
3a9e3ce857 Add services description for sabnzbd component (#28252) 2019-10-29 15:17:49 -04:00
cgtobi
1dfb67f0c5 Bump pytest to 5.2.2 (#28230) 2019-10-29 15:16:05 -04:00
Bram Kragten
5592eb7709 Updated frontend to 20191025.1 (#28327) 2019-10-29 16:30:33 +01:00
Pascal Vizeli
c00b058e53 Cleanup not needed websocket flags for ingress (#28295) 2019-10-29 12:05:05 +01:00
Jonas Janz
502f59977a Add description for arlo.update service (#28270) 2019-10-29 11:02:25 +01:00
Franck Nijhof
756c36171d Bump youtube_dl to 2019.10.29 (#28312) 2019-10-29 09:37:51 +01:00
Franck Nijhof
4dc6d36224 Bump pre-commit to 1.20.0 (#28313) 2019-10-29 09:37:18 +01:00
Paulus Schoutsen
79ac77a93d Almond integration (#28282)
* Initial Almond integration

* Hassfest

* Update library

* Address comments

* Fix inheritance issue py36

* Remove no longer needed check

* Fix time
2019-10-28 23:47:31 -07:00
Franck Nijhof
a4ec4d5a18 Add source constants for all config entry discovery sources (#28311) 2019-10-28 23:32:57 -07:00
Franck Nijhof
04ab20846a Bump black to 19.10b0 (#28310) 2019-10-28 23:32:34 -07:00
Sebastian Muszynski
5b96704c4a Use dict[key] for required config keys (#28304)
* Use dict[key] for required config keys

* Change CONF_NAME too because it has a default
2019-10-29 01:45:22 +01:00
Sebastian Muszynski
a0f764cf6d Remove blocking I/O from the event loop (#28305) 2019-10-29 01:44:26 +01:00
HomeAssistant Azure
0e4331e922 [ci skip] Translation update 2019-10-29 00:32:16 +00:00
Josh Bendavid
1e27a1f2b9 Add keyboard_remote trigger on multiple event types and emulate key hold events (#27761)
* convert keyboard_remote to async and add possibility to trigger on multiple event types, as well as emulate key hold events

* update requirements

* cleanup shutdown handling and config handling as well as address other minor comments

* cleanup unused return values and debug message formatting

* move start and stop event listen to separate coroutine plus minor cleanup

* make setup coroutine a function

* fix import order and attribute defined outside of init

* add to codeowners

* update codeowners
2019-10-29 00:59:13 +01:00
Florent Thoumie
0ef99934b7 Add more iaqualink entity properties, fix timeout issues (#28236)
* iaqualink: implement some more entity properties

* Style fixes
2019-10-29 00:42:06 +01:00
Ville Skyttä
f88ead597a Type hint improvements (#28260)
* Add and improve core and config_entries type hints

* Complete and improve config_entries type hints

* More entity registry type hints

* Complete helpers.event type hints
2019-10-28 13:36:26 -07:00
Paulus Schoutsen
070790ccc9 Bumped version to 0.101.0b3 2019-10-28 11:28:45 -07:00
jjlawren
0e2b55e60e Bump library to 0.0.3 (#28294) 2019-10-28 11:28:40 -07:00
Erik Montnemery
4a25bab1b3 Fix broken deconz trigger (#28211) 2019-10-28 11:28:39 -07:00
Erik Montnemery
3cedee3fea Add above and below to sensor condition extra_fields (#27364)
* Add above and below to sensor condition extra_fields

* Change unit_of_measurement to suffix in extra_fields

* Check if sensor has unit when getting capabilities

* Improve tests
2019-10-28 11:28:39 -07:00
Yann Jajkiewicz
f7a64019b6 Add support for Somfy Garage door Rollixo IO DiscreteGarageOpenerIOComponent in Tahoma component (#28291) 2019-10-28 11:22:15 -07:00
jjlawren
31dd69196c Bump library to 0.0.3 (#28294) 2019-10-28 10:39:37 -07:00
Pascal Vizeli
335872b54d Revert "More header cleanup for websocket proxy (#28288)" (#28293)
This reverts commit 7887850505.
2019-10-28 16:54:15 +01:00
Bram Kragten
549e8cf2c5 Hue: Create new config flow when auth is lost (#28204)
* Hue: Create new config flow when auth is lost

* Fix tests

* Fix tests

* Comments

* Lint
2019-10-28 08:45:08 -07:00
Eliseo Martelli
30f4ee121a Remove GTT component (#28286)
* removed GTT component

* Removed gtt.py from coveragerc
2019-10-28 14:54:42 +01:00
Sören
c1d88dd7a4 Bump avea to 1.4 (#28287)
* Bump avea to 1.4

* Bump avea to 1.4 #2
2019-10-28 14:47:04 +01:00
Pascal Vizeli
7887850505 More header cleanup for websocket proxy (#28288) 2019-10-28 14:34:13 +01:00
J.P. Hutchins
54342d2a4e Add transmission info about torrents that is accessible with templating (#27111)
* Add information about current downloads.

* Cleanup: add "Torrent Info" state attribute

* Add username to codeowners

* Rename state_attributes - device_state_attributes.

* Fix snakecase keys, use f-strings, remove redundant method.

* Access started_torrent_dict directly

* Add return None condition

* Remove redundancy.

* Add missing comma in codeowners list.

* Add missing @ to username.

* Update CODEOWNERS with script.hassfest.

* Remove transmission_downloading, give started_torrents the info.

* Confirm changes.

* Actually approve changes.

* Resolve conflicts.

* Remove leftovers from old torrent_info sensor.

* Remove get_started_torrent_info method.

Old method to display boolean for the removed torrent_info sensor.
2019-10-28 10:20:59 +01:00
fwestenberg
edcf476408 Add support for Xiaomi Air Quality Monitor (cgllc.airmonitor.b1) (#27735) 2019-10-28 07:43:01 +01:00
HomeAssistant Azure
72dee7dd21 [ci skip] Translation update 2019-10-28 00:32:16 +00:00
SukramJ
75f94b9147 Reorg and test attributes for HomematicIP Cloud (#28234)
* Reorg and test attribute for HomematicIP Cloud

* Add dutyCycle check to security_group

* Edit test to improve coverage

* Add missing flow test

* apply suggestion

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

* fix assert condition
2019-10-28 01:03:26 +01:00
ZiroNL
6ac7796fb7 Add charset to imap component. (#28258) 2019-10-27 13:07:44 +01:00
Fabian Affolter
a9db2ead33 Suppress traceback (fixes #28243) (#28262) 2019-10-27 12:39:36 +01:00
Fabian Affolter
7e862e4d92 Update praw to 6.4.0 (#27324)
* Update praw to 6.4.0

* Update requirements_test_all.txt

* Fix docstrings

* Update tests
2019-10-27 10:04:43 +01:00
Floris Van der krieken
2747f08385 Add available state to unifiled integration (#28189)
* Added Unifi Led

* fixed manifest

* fixed style issue

* removed unused setting

* added sugested changes.

* fixed order

* fixed settings that are required

* Fix review issues

* fix variable name that was too short

* Testing something

* Reverted to a previous version for testing

* Reverted testing changes.

* Add available status and increase version of unifiled package version.

* No io in init function.
2019-10-27 05:18:23 +01:00
HomeAssistant Azure
868f88a4e0 [ci skip] Translation update 2019-10-27 00:32:10 +00:00
michaeldavie
82ed84ba43 Bump env_canada to 0.0.27 (#28239) 2019-10-26 22:27:21 +02:00
Fabian Affolter
bb8f139716 Upgrade speedtest-cli to 2.1.2 (#28216) 2019-10-26 13:45:42 +02:00
Ville Skyttä
2baee4ac3e Add Huawei LTE mobile data switch support (#28188)
* Add Huawei LTE mobile data switch support

* Remove stale comment

* Do HA state updates in base entity
2019-10-26 13:29:36 +03:00
HomeAssistant Azure
7096826d1d [ci skip] Translation update 2019-10-26 00:32:20 +00:00
Paulus Schoutsen
08cc9fd375 Add cloud account linking support (#28210)
* Add cloud account linking support

* Update account_link.py
2019-10-25 16:04:24 -07:00
Erik Montnemery
475b43500a Add above and below to sensor condition extra_fields (#27364)
* Add above and below to sensor condition extra_fields

* Change unit_of_measurement to suffix in extra_fields

* Check if sensor has unit when getting capabilities

* Improve tests
2019-10-26 06:55:42 +08:00
ochlocracy
d6654eaecb Implement Alexa.PlaybackStateReporter Interface for alexa (#28215) 2019-10-25 14:53:33 -07:00
Erik Montnemery
7fee44b8c5 Add additional device conditions to cover (#27830)
* Add additional device conditions to cover

* Add default value

* Add test

* Use numeric_state condition instead of template condition
2019-10-25 13:50:46 -07:00
ochlocracy
d44bfa8e88 Improved Alexa ThermostatController thermostatMode handling (#28176)
* Update ThermostatController to map directives to supported modes and add support for CUSTOM mode.

* Removed erroneous config value from test.

* Removed unnecessary use of a comprehension by dumbing down comment so pylint could comprehend.

* Removed erroneous import variable caused by removing erroneous config value from test.

* Removed unnecessary use of a comprehension.

* Reverted Removal or erroneous import variable and erroneous config value from test.
Apparently need for additional tests outside this component. Whoops.
2019-10-25 13:42:21 -07:00
Erik Montnemery
f4341c1546 Fix broken deconz trigger (#28211) 2019-10-25 13:40:05 -07:00
ochlocracy
da8a476142 Add support for supportedOperations to Alexa.PlaybackController (#28212)
* Added support for supportedOperations to Alexa.PlaybackController

* Added support for supportedOperations to Alexa.PlaybackController
2019-10-25 13:34:51 -07:00
Markus Pöschl
f2d6cc7329 Increased python-eq3bt version to latest (0.1.11) (#28175) 2019-10-25 21:25:27 +02:00
Hayley McIldoon
7ddce1d52b Add device condition support for device_tracker (#28190) 2019-10-25 10:51:35 -07:00
Paulus Schoutsen
c456b725fd Bumped version to 0.101.0b2 2019-10-25 10:49:42 -07:00
Bram Kragten
524f5a7264 Updated frontend to 20191025.0 (#28208) 2019-10-25 10:49:36 -07:00
gngj
637a16799f Fix microsoft tts (#28199)
* Update pycsspeechtts

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

* Give a option to choose region

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

This reverts commit 5a83a92390.

* move only some imports to top

* fix lint

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

* Use websocket events to update Plex

* Handle websocket disconnections

* Use aiohttp, shut down socket cleanly

* Bad rebase fix

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

* Move websocket handling to external library

* Close websocket session on HA stop

* Use external library, revert unnecessary test change

* Async & lint fixes

* Clean up websocket stopper on entry unload

* Setup websocket in component, pass actual needed object to library
2019-10-25 10:49:34 -07:00
gngj
d28f7ab120 Fix microsoft tts (#28199)
* Update pycsspeechtts

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

* Give a option to choose region

Api is now region dependent, so gave it a config
2019-10-25 10:42:23 -07:00
Hayley McIldoon
2c914e0c59 Add device condition support for media_player (#28161)
* Add device condition for media_player

* Fix typo in strings
2019-10-25 10:22:39 -07:00
ochlocracy
38428308fc Change Alexa default display category based on media_player device_class (#28191)
* Support default display category based one media_player device_class.

* Support default display category based one media_player device_class.
2019-10-25 10:21:22 -07:00
Bram Kragten
5c8a9c2815 Updated frontend to 20191025.0 (#28208) 2019-10-25 10:20:42 -07:00
Ville Skyttä
3c4caaaefc Add presentation URL to SSDP discovery info (#28196) 2019-10-25 20:09:18 +03:00
On Freund
0656f0c62b Address post-merge coolmaster config flow code review (#28163)
* Address post-merge code review comments

* Use component path for 3rd party lib
2019-10-25 18:39:16 +02:00
jjlawren
43c7b57d1e Update Plex via websockets (#28158)
* Save client identifier from auth for future use

* Use websocket events to update Plex

* Handle websocket disconnections

* Use aiohttp, shut down socket cleanly

* Bad rebase fix

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

* Move websocket handling to external library

* Close websocket session on HA stop

* Use external library, revert unnecessary test change

* Async & lint fixes

* Clean up websocket stopper on entry unload

* Setup websocket in component, pass actual needed object to library
2019-10-25 18:37:50 +02:00
gngj
9153729b21 move hass-frontend import back down (#28203) 2019-10-25 09:02:40 -07:00
guillempages
98cf3f4aa3 [homematic]Add support for HmIP-BSL LEDs (#27307)
With this commit, 3 entities are created for the HmIP-BSL device:
2 lights for the two independent LEDs and 1 switch for the relais
2019-10-25 16:08:11 +02:00
guillempages
6bfb2460f2 [homematic]Pass channel to light color functions (#27306)
The device HmIP-BSL has two independent LEDs on two different channels,
so the channel needs to be explictly specified when setting the color.
2019-10-25 16:06:52 +02:00
escoand
9661efc312 Add Samsung TV automatic protocol detection (#27492)
* added automatic protocol detection

* fix logger tests

* fix async tests

* add missin const.py

* fix log formatting

* wait for first update call

* migrate first tests

* migrated all test functions

* started to use state machine

* updated all tests to use async_setup_component

* slove hints

* update tests

* get state at correct position

* remove impossible tests

* fix autodetect tests

* use caplog fixture

* add test for duplicate

* catch concrete exceptions

* don't mock samsungctl exceptions

* add test for discovery

* get state when possible

* add test for autodetect without connection
2019-10-25 14:32:12 +02:00
HomeAssistant Azure
95295791bd [ci skip] Translation update 2019-10-25 00:32:15 +00:00
Ville Skyttä
643b3a98ee Huawei LTE sensor metadata update (#28187) 2019-10-24 16:42:54 -07:00
SukramJ
32a024c641 Partially revert tensorflow import move (#28184)
* Revert "Refactor imports for tensorflow (#27617)"

This reverts commit 5a83a92390.

* move only some imports to top

* fix lint

* add comments
2019-10-24 16:41:13 -07:00
Joakim Sørensen
67cf7c26da Removes unwanted tradfri battery sensor (#28181) 2019-10-24 23:25:47 +02:00
Josef Schlehofer
63deec3275 Bump python-slugify to 4.0.0 (#28186) 2019-10-24 23:12:41 +02:00
kennedyshead
98ac8a217d Adding device_class to samsungtv (#28168)
* Adding device_id to samsungtv

* Lint

* Adding test
2019-10-24 13:41:07 -07:00
Diefferson Koderer Môro
c96d4c978d Fix tzinfo type for onvif component (#28178) 2019-10-24 13:39:10 -07:00
Joakim Sørensen
ec478ab848 Add stop feature to tradfri covers (#28180)
* Tradfri cover enhancements

* tradfri dependency update

* Revert addition of battery attrubite

* Remove the supported_features property

* Remove unwanted file
2019-10-24 13:38:24 -07:00
Otto Winter
322d8c2dd5 Fix ESPHome stacktraces when removing entity and shutting down (#28185) 2019-10-24 13:36:47 -07:00
Joakim Sørensen
b61218f90e Tradfri config flow enhancements (#28179) 2019-10-24 21:31:58 +02:00
Otto Winter
8791a48328 Bump aioesphomeapi to 2.4.1 (#28170)
* Bump aioesphomeapi to 2.4.1

* Update requirements

* Bump to 2.4.2
2019-10-24 20:24:46 +02:00
Robert Van Gorkom
15bedd8f27 Use latest withings_api module (#27817)
* Using latest winthings_api module.
Drastically reduced complexity of tests.

* Removing import source.

* Fixing test requirements.

* Using requests_mock instead of responses module.

* Updating file formatting.

* Removing unused method.

* Adding support for new OAuth2 config flow.

* Addressing PR feedback.
Removing unecessary base_url from config, this is a potential breaking change.

* Addressing PR feedback.
2019-10-24 09:41:04 -07:00
Ville Skyttä
fc09702cc3 Modernize Huawei LTE (#26675)
* Modernization rework

- config entry support, with override support from huawei_lte platform in YAML
- device tracker entity registry support
- refactor for easier addition of more features
- internal code cleanups

* Remove log level dependent subscription/data debug hack

No longer needed, because pretty much all keys from supported
categories are exposed as sensors.

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

* Upgrade huawei-lte-api to 1.4.1

https://github.com/Salamek/huawei-lte-api/releases

* Add support for access without username and password

* Use subclass init instead of config_entries.HANDLERS

* Update huawei-lte-api to 1.4.3 (#27269)

* Convert device state attributes to snake_case

* Simplify scanner entity initialization

* Remove not needed hass reference from Router

* Return explicit None from unsupported old device tracker setup

* Mark unknown connection errors during config as such

* Drop some dead config flow code

* Run config flow sync I/O in executor

* Parametrize config flow login error tests

* Forward entry unload to platforms

* Async/sync fixups

* Improve data subscription debug logging

* Implement on the fly add of new and tracking of seen device tracker entities

* Handle device tracker entry unload cleanup in component

* Remove unnecessary _async_setup_lte, just have code in async_setup_entry

* Remove time tracker on unload

* Fix to not use same mutable default subscription set for all routers

* Pylint fixes

* Remove some redundant defensive device tracker code

* Add back explicit get_scanner None return, hush pylint

* Adjust approach to set system_options on entry create

* Enable some sensors on first add instead of disabling everything

* Fix SMS notification recipients default value

* Add option to skip new device tracker entities

* Fix SMS notification recipient option default

* Work around https://github.com/PyCQA/pylint/issues/3202

* Remove unrelated type hint additions

* Change async_add_new_entities to a regular function

* Remove option to disable polling for new device tracker entries
2019-10-24 19:31:49 +03:00
Alexei Chetroi
969322e14a Fixes/zha ieee tail (#28160)
* Fix ZHA entity_id assignment.

* Update tests.
2019-10-24 12:23:02 -04:00
Floris Van der krieken
b1fcecd526 Add Unifi Led (#27475)
* Added Unifi Led

* fixed manifest

* fixed style issue

* removed unused setting

* added sugested changes.

* fixed order

* fixed settings that are required

* Fix review issues

* fix variable name that was too short

* Testing something

* Reverted to a previous version for testing

* Reverted testing changes.
2019-10-24 17:59:25 +02:00
kennedyshead
d44de6dd2b Fix Venstar formatting to restore clean CI (#28171) 2019-10-24 16:03:29 +02:00
Diefferson Koderer Môro
dd9ca70e96 Add onvif local datetime support (#26656)
* Update camera.py

* Add onvif local datetime support

* Correct capture TimeZone

* Replace one line if-statement by if-block
2019-10-23 21:03:24 -07:00
HomeAssistant Azure
8c31afc31e [ci skip] Translation update 2019-10-24 00:32:18 +00:00
Tyler Page
6a1501b59c Cover all possible values for venstar operation_mode (#27949)
* cover all possible values for operation_mode

* Update climate.py

* Update climate.py

* Update climate.py

mapped homeassistant constants to client ones so we don't have to check for both

* black + pylint

* move mode_map to __init__()

* Update climate.py

* Update climate.py
2019-10-24 02:10:57 +02:00
Teemu R
160c201be1 Bump songpal to fix a regression (#28115)
The new release fixes a single regression from requests to aiohttp conversion.
Some devices do not respond with the correct mimetype which was not enforced
by requests but is enforced by aiohttp.

Related PR https://github.com/rytilahti/python-songpal/pull/59
2019-10-23 23:13:56 +02:00
Paulus Schoutsen
1b21685651 Version bump to 102.0.dev0" 2019-10-23 13:38:35 -07:00
1907 changed files with 41670 additions and 11727 deletions

View File

@@ -62,6 +62,7 @@ omit =
homeassistant/components/asterisk_cdr/mailbox.py
homeassistant/components/asterisk_mbox/*
homeassistant/components/asuswrt/device_tracker.py
homeassistant/components/aten_pe/*
homeassistant/components/atome/*
homeassistant/components/august/*
homeassistant/components/aurora_abb_powerone/sensor.py
@@ -69,6 +70,7 @@ omit =
homeassistant/components/avea/light.py
homeassistant/components/avion/light.py
homeassistant/components/azure_event_hub/*
homeassistant/components/azure_service_bus/*
homeassistant/components/baidu/tts.py
homeassistant/components/beewi_smartclim/sensor.py
homeassistant/components/bbb_gpio/*
@@ -82,9 +84,9 @@ omit =
homeassistant/components/blinkt/light.py
homeassistant/components/blockchain/sensor.py
homeassistant/components/bloomsky/*
homeassistant/components/bluesound/media_player.py
homeassistant/components/bluesound/*
homeassistant/components/bluetooth_le_tracker/device_tracker.py
homeassistant/components/bluetooth_tracker/device_tracker.py
homeassistant/components/bluetooth_tracker/*
homeassistant/components/bme280/sensor.py
homeassistant/components/bme680/sensor.py
homeassistant/components/bmw_connected_drive/*
@@ -92,6 +94,7 @@ omit =
homeassistant/components/bom/sensor.py
homeassistant/components/bom/weather.py
homeassistant/components/braviatv/media_player.py
homeassistant/components/broadlink/remote.py
homeassistant/components/broadlink/sensor.py
homeassistant/components/broadlink/switch.py
homeassistant/components/brottsplatskartan/sensor.py
@@ -108,7 +111,7 @@ omit =
homeassistant/components/cast/*
homeassistant/components/cert_expiry/sensor.py
homeassistant/components/cert_expiry/helper.py
homeassistant/components/channels/media_player.py
homeassistant/components/channels/*
homeassistant/components/cisco_ios/device_tracker.py
homeassistant/components/cisco_mobility_express/device_tracker.py
homeassistant/components/cisco_webex_teams/notify.py
@@ -162,6 +165,7 @@ omit =
homeassistant/components/doorbird/*
homeassistant/components/dovado/*
homeassistant/components/downloader/*
homeassistant/components/dsmr_reader/*
homeassistant/components/dte_energy_bridge/sensor.py
homeassistant/components/dublin_bus_transport/sensor.py
homeassistant/components/duke_energy/sensor.py
@@ -177,7 +181,7 @@ omit =
homeassistant/components/ecobee/notify.py
homeassistant/components/ecobee/sensor.py
homeassistant/components/ecobee/weather.py
homeassistant/components/econet/water_heater.py
homeassistant/components/econet/*
homeassistant/components/ecovacs/*
homeassistant/components/eddystone_temperature/sensor.py
homeassistant/components/edimax/switch.py
@@ -198,6 +202,7 @@ omit =
homeassistant/components/envirophat/sensor.py
homeassistant/components/envisalink/*
homeassistant/components/ephember/climate.py
homeassistant/components/epson/const.py
homeassistant/components/epson/media_player.py
homeassistant/components/epsonworkforce/sensor.py
homeassistant/components/eq3btsmart/climate.py
@@ -228,6 +233,7 @@ omit =
homeassistant/components/flexit/climate.py
homeassistant/components/flic/binary_sensor.py
homeassistant/components/flock/notify.py
homeassistant/components/flume/*
homeassistant/components/flunearyou/sensor.py
homeassistant/components/flux_led/light.py
homeassistant/components/folder/sensor.py
@@ -274,7 +280,6 @@ omit =
homeassistant/components/growatt_server/sensor.py
homeassistant/components/gstreamer/media_player.py
homeassistant/components/gtfs/sensor.py
homeassistant/components/gtt/sensor.py
homeassistant/components/habitica/*
homeassistant/components/hangouts/*
homeassistant/components/hangouts/__init__.py
@@ -282,12 +287,13 @@ omit =
homeassistant/components/hangouts/hangouts_bot.py
homeassistant/components/hangouts/hangups_utils.py
homeassistant/components/harman_kardon_avr/media_player.py
homeassistant/components/harmony/remote.py
homeassistant/components/harmony/*
homeassistant/components/haveibeenpwned/sensor.py
homeassistant/components/hdmi_cec/*
homeassistant/components/heatmiser/climate.py
homeassistant/components/hikvision/binary_sensor.py
homeassistant/components/hikvisioncam/switch.py
homeassistant/components/hisense_aehw4a1/*
homeassistant/components/hitron_coda/device_tracker.py
homeassistant/components/hive/*
homeassistant/components/hlk_sw16/*
@@ -313,7 +319,7 @@ omit =
homeassistant/components/iaqualink/light.py
homeassistant/components/iaqualink/sensor.py
homeassistant/components/iaqualink/switch.py
homeassistant/components/icloud/device_tracker.py
homeassistant/components/icloud/*
homeassistant/components/izone/climate.py
homeassistant/components/izone/discovery.py
homeassistant/components/izone/__init__.py
@@ -409,6 +415,7 @@ omit =
homeassistant/components/miflora/sensor.py
homeassistant/components/mikrotik/*
homeassistant/components/mill/climate.py
homeassistant/components/mill/const.py
homeassistant/components/minio/*
homeassistant/components/mitemp_bt/sensor.py
homeassistant/components/mjpeg/camera.py
@@ -499,6 +506,7 @@ omit =
homeassistant/components/panasonic_bluray/media_player.py
homeassistant/components/panasonic_viera/media_player.py
homeassistant/components/pandora/media_player.py
homeassistant/components/pcal9535a/*
homeassistant/components/pencom/switch.py
homeassistant/components/philips_js/media_player.py
homeassistant/components/pi_hole/sensor.py
@@ -514,6 +522,7 @@ omit =
homeassistant/components/plex/media_player.py
homeassistant/components/plex/sensor.py
homeassistant/components/plex/server.py
homeassistant/components/plex/websockets.py
homeassistant/components/plugwise/*
homeassistant/components/plum_lightpad/*
homeassistant/components/pocketcasts/sensor.py
@@ -523,6 +532,7 @@ omit =
homeassistant/components/proliphix/climate.py
homeassistant/components/prometheus/*
homeassistant/components/prowl/notify.py
homeassistant/components/proxmoxve/*
homeassistant/components/proxy/camera.py
homeassistant/components/ptvsd/*
homeassistant/components/pulseaudio_loopback/switch.py
@@ -603,6 +613,7 @@ omit =
homeassistant/components/simplepush/notify.py
homeassistant/components/simplisafe/__init__.py
homeassistant/components/simplisafe/alarm_control_panel.py
homeassistant/components/simplisafe/lock.py
homeassistant/components/simulated/sensor.py
homeassistant/components/sisyphus/*
homeassistant/components/sky_hub/device_tracker.py
@@ -630,7 +641,7 @@ omit =
homeassistant/components/somfy/*
homeassistant/components/somfy_mylink/*
homeassistant/components/sonarr/sensor.py
homeassistant/components/songpal/media_player.py
homeassistant/components/songpal/*
homeassistant/components/sonos/*
homeassistant/components/sony_projector/switch.py
homeassistant/components/spc/*
@@ -638,7 +649,8 @@ omit =
homeassistant/components/spider/*
homeassistant/components/spotcrime/sensor.py
homeassistant/components/spotify/media_player.py
homeassistant/components/squeezebox/media_player.py
homeassistant/components/squeezebox/*
homeassistant/components/starline/*
homeassistant/components/starlingbank/sensor.py
homeassistant/components/steam_online/sensor.py
homeassistant/components/stiebel_eltron/*
@@ -684,6 +696,7 @@ omit =
homeassistant/components/tile/device_tracker.py
homeassistant/components/time_date/sensor.py
homeassistant/components/todoist/calendar.py
homeassistant/components/todoist/const.py
homeassistant/components/tof/sensor.py
homeassistant/components/tomato/device_tracker.py
homeassistant/components/toon/*
@@ -719,6 +732,7 @@ omit =
homeassistant/components/uber/sensor.py
homeassistant/components/ubus/device_tracker.py
homeassistant/components/ue_smart_radio/media_player.py
homeassistant/components/unifiled/*
homeassistant/components/upcloud/*
homeassistant/components/upnp/*
homeassistant/components/upc_connect/*
@@ -737,6 +751,7 @@ omit =
homeassistant/components/venstar/climate.py
homeassistant/components/vera/*
homeassistant/components/verisure/*
homeassistant/components/versasense/*
homeassistant/components/vesync/__init__.py
homeassistant/components/vesync/common.py
homeassistant/components/vesync/const.py
@@ -758,7 +773,6 @@ omit =
homeassistant/components/waze_travel_time/sensor.py
homeassistant/components/webostv/*
homeassistant/components/wemo/*
homeassistant/components/wemo/fan.py
homeassistant/components/whois/sensor.py
homeassistant/components/wink/*
homeassistant/components/wirelesstag/*
@@ -778,7 +792,6 @@ omit =
homeassistant/components/xmpp/notify.py
homeassistant/components/xs1/*
homeassistant/components/yale_smart_alarm/alarm_control_panel.py
homeassistant/components/yamaha/media_player.py
homeassistant/components/yamaha_musiccast/media_player.py
homeassistant/components/yandex_transport/*
homeassistant/components/yeelight/*

View File

@@ -0,0 +1,51 @@
# This configuration includes the full set of hooks we use. In
# addition to the defaults (see .pre-commit-config.yaml), this
# includes hooks that require our development and test dependencies
# installed and the virtualenv containing them active by the time
# pre-commit runs to produce correct results.
#
# If this is not a problem for your workflow, using this config is
# recommended, install it with
# pre-commit install --config .pre-commit-config-all.yaml
# Otherwise, see the default .pre-commit-config.yaml for a lighter one.
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
- repo: https://github.com/PyCQA/flake8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==4.0.1
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
hooks:
- id: bandit
args:
- --quiet
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$
# Using a local "system" mypy instead of the mypy hook, because its
# results depend on what is installed. And the mypy hook runs in a
# virtualenv of its own, meaning we'd need to install and maintain
# another set of our dependencies there... no. Use the "system" one
# and reuse the environment that is set up anyway already instead.
- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
require_serial: true
files: ^homeassistant/.+\.py$

View File

@@ -1,6 +1,13 @@
# This configuration includes the default, minimal set of hooks to be
# run on all commits. It requires no specific setup and one can just
# start using pre-commit with it.
#
# See .pre-commit-config-all.yaml for a more complete one that comes
# with a better coverage at the cost of some specific setup needed.
repos:
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 19.10b0
hooks:
- id: black
args:
@@ -8,24 +15,19 @@ repos:
- --quiet
files: ^((homeassistant|script|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.8
rev: 3.7.9
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.3.1
- pydocstyle==4.0.0
- flake8-docstrings==1.5.0
- pydocstyle==4.0.1
files: ^(homeassistant|script|tests)/.+\.py$
# Using a local "system" mypy instead of the mypy hook, because its
# results depend on what is installed. And the mypy hook runs in a
# virtualenv of its own, meaning we'd need to install and maintain
# another set of our dependencies there... no. Use the "system" one
# and reuse the environment that is set up anyway already instead.
- repo: local
- repo: https://github.com/PyCQA/bandit
rev: 1.6.2
hooks:
- id: mypy
name: mypy
entry: mypy
language: system
types: [python]
require_serial: true
files: ^homeassistant/.+\.py$
- id: bandit
args:
- --quiet
- --format=custom
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$

View File

@@ -19,7 +19,7 @@ matrix:
- python: "3.6.1"
env: TOXENV=lint
- python: "3.6.1"
env: TOXENV=pylint PYLINT_ARGS=--jobs=0
env: TOXENV=pylint PYLINT_ARGS=--jobs=0 TRAVIS_WAIT=30
- python: "3.6.1"
env: TOXENV=typing
- python: "3.6.1"
@@ -33,4 +33,4 @@ cache:
- $HOME/.cache/pre-commit
install: pip install -U tox
language: python
script: travis_wait 50 tox --develop
script: ${TRAVIS_WAIT:+travis_wait $TRAVIS_WAIT} tox --develop

2
.vscode/tasks.json vendored
View File

@@ -33,7 +33,7 @@
{
"label": "Flake8",
"type": "shell",
"command": "flake8 homeassistant tests",
"command": "pre-commit run flake8 --all-files",
"group": {
"kind": "test",
"isDefault": true

View File

@@ -17,8 +17,8 @@ homeassistant/components/abode/* @shred86
homeassistant/components/adguard/* @frenck
homeassistant/components/airly/* @bieniu
homeassistant/components/airvisual/* @bachya
homeassistant/components/alarm_control_panel/* @colinodell
homeassistant/components/alexa/* @home-assistant/cloud @ochlocracy
homeassistant/components/almond/* @gcampax @balloob
homeassistant/components/alpha_vantage/* @fabaff
homeassistant/components/amazon_polly/* @robbiet480
homeassistant/components/ambiclimate/* @danielhiversen
@@ -32,6 +32,7 @@ homeassistant/components/arcam_fmj/* @elupus
homeassistant/components/arduino/* @fabaff
homeassistant/components/arest/* @fabaff
homeassistant/components/asuswrt/* @kennedyshead
homeassistant/components/aten_pe/* @mtdcr
homeassistant/components/atome/* @baqs
homeassistant/components/aurora_abb_powerone/* @davet2001
homeassistant/components/auth/* @home-assistant/core
@@ -42,13 +43,14 @@ homeassistant/components/awair/* @danielsjf
homeassistant/components/aws/* @awarecan @robbiet480
homeassistant/components/axis/* @kane610
homeassistant/components/azure_event_hub/* @eavanvalkenburg
homeassistant/components/azure_service_bus/* @hfurubotten
homeassistant/components/beewi_smartclim/* @alemuro
homeassistant/components/bitcoin/* @fabaff
homeassistant/components/bizkaibus/* @UgaitzEtxebarria
homeassistant/components/blink/* @fronzbot
homeassistant/components/bmw_connected_drive/* @gerard33
homeassistant/components/braviatv/* @robbiet480
homeassistant/components/broadlink/* @danielhiversen
homeassistant/components/broadlink/* @danielhiversen @felipediel
homeassistant/components/brunt/* @eavanvalkenburg
homeassistant/components/bt_smarthub/* @jxwolstenholme
homeassistant/components/buienradar/* @mjj4791 @ties
@@ -59,6 +61,7 @@ homeassistant/components/cisco_webex_teams/* @fbradyirl
homeassistant/components/ciscospark/* @fbradyirl
homeassistant/components/cloud/* @home-assistant/cloud
homeassistant/components/cloudflare/* @ludeeus
homeassistant/components/comfoconnect/* @michaelarnauts
homeassistant/components/config/* @home-assistant/core
homeassistant/components/configurator/* @home-assistant/core
homeassistant/components/conversation/* @home-assistant/core
@@ -76,6 +79,7 @@ homeassistant/components/device_automation/* @home-assistant/core
homeassistant/components/digital_ocean/* @fabaff
homeassistant/components/discogs/* @thibmaek
homeassistant/components/doorbird/* @oblogic7
homeassistant/components/dsmr_reader/* @depl0y
homeassistant/components/dweet/* @fabaff
homeassistant/components/ecobee/* @marthoc
homeassistant/components/ecovacs/* @OverloadUT
@@ -83,8 +87,10 @@ homeassistant/components/egardia/* @jeroenterheerdt
homeassistant/components/eight_sleep/* @mezz64
homeassistant/components/elv/* @majuss
homeassistant/components/emby/* @mezz64
homeassistant/components/emulated_hue/* @NobleKangaroo
homeassistant/components/enigma2/* @fbradyirl
homeassistant/components/enocean/* @bdurrer
homeassistant/components/entur_public_transport/* @hfurubotten
homeassistant/components/environment_canada/* @michaeldavie
homeassistant/components/ephember/* @ttroy50
homeassistant/components/epsonworkforce/* @ThaStealth
@@ -92,11 +98,13 @@ homeassistant/components/eq3btsmart/* @rytilahti
homeassistant/components/esphome/* @OttoWinter
homeassistant/components/essent/* @TheLastProject
homeassistant/components/evohome/* @zxdavb
homeassistant/components/fastdotcom/* @rohankapoorcom
homeassistant/components/file/* @fabaff
homeassistant/components/filter/* @dgomes
homeassistant/components/fitbit/* @robbiet480
homeassistant/components/fixer/* @fabaff
homeassistant/components/flock/* @fabaff
homeassistant/components/flume/* @ChrisMandich
homeassistant/components/flunearyou/* @bachya
homeassistant/components/fortigate/* @kifeo
homeassistant/components/fortios/* @kimfrellsen
@@ -109,6 +117,7 @@ homeassistant/components/gearbest/* @HerrHofrat
homeassistant/components/geniushub/* @zxdavb
homeassistant/components/geo_rss_events/* @exxamalte
homeassistant/components/geonetnz_quakes/* @exxamalte
homeassistant/components/geonetnz_volcano/* @exxamalte
homeassistant/components/gitter/* @fabaff
homeassistant/components/glances/* @fabaff @engrbm87
homeassistant/components/gntp/* @robbiet480
@@ -122,10 +131,12 @@ homeassistant/components/growatt_server/* @indykoning
homeassistant/components/gtfs/* @robbiet480
homeassistant/components/harmony/* @ehendrix23
homeassistant/components/hassio/* @home-assistant/hass-io
homeassistant/components/heatmiser/* @andylockran
homeassistant/components/heos/* @andrewsayre
homeassistant/components/here_travel_time/* @eifinger
homeassistant/components/hikvision/* @mezz64
homeassistant/components/hikvisioncam/* @fbradyirl
homeassistant/components/hisense_aehw4a1/* @bannhead
homeassistant/components/history/* @home-assistant/core
homeassistant/components/history_graph/* @andrey-git
homeassistant/components/hive/* @Rendili @KJonline
@@ -149,15 +160,19 @@ homeassistant/components/input_number/* @home-assistant/core
homeassistant/components/input_select/* @home-assistant/core
homeassistant/components/input_text/* @home-assistant/core
homeassistant/components/integration/* @dgomes
homeassistant/components/intent/* @home-assistant/core
homeassistant/components/ios/* @robbiet480
homeassistant/components/iperf3/* @rohankapoorcom
homeassistant/components/ipma/* @dgomes
homeassistant/components/iqvia/* @bachya
homeassistant/components/irish_rail_transport/* @ttroy50
homeassistant/components/izone/* @Swamp-Ig
homeassistant/components/jewish_calendar/* @tsvi
homeassistant/components/juicenet/* @jesserockz
homeassistant/components/kaiterra/* @Michsior14
homeassistant/components/keba/* @dannerph
homeassistant/components/keenetic_ndms2/* @foxel
homeassistant/components/keyboard_remote/* @bendavid
homeassistant/components/knx/* @Julius2342
homeassistant/components/kodi/* @armills
homeassistant/components/konnected/* @heythisisnate
@@ -173,6 +188,8 @@ homeassistant/components/logi_circle/* @evanjd
homeassistant/components/lovelace/* @home-assistant/frontend
homeassistant/components/luci/* @fbradyirl @mzdrale
homeassistant/components/luftdaten/* @fabaff
homeassistant/components/lupusec/* @majuss
homeassistant/components/lutron/* @JonGilmore
homeassistant/components/mastodon/* @fabaff
homeassistant/components/matrix/* @tinloaf
homeassistant/components/mcp23017/* @jardiamj
@@ -186,6 +203,7 @@ homeassistant/components/mill/* @danielhiversen
homeassistant/components/min_max/* @fabaff
homeassistant/components/minio/* @tkislan
homeassistant/components/mobile_app/* @robbiet480
homeassistant/components/modbus/* @adamchengtkc
homeassistant/components/monoprice/* @etsinko
homeassistant/components/moon/* @fabaff
homeassistant/components/mpd/* @fabaff
@@ -199,6 +217,7 @@ homeassistant/components/ness_alarm/* @nickw444
homeassistant/components/nest/* @awarecan
homeassistant/components/netdata/* @fabaff
homeassistant/components/nextbus/* @vividboarder
homeassistant/components/nilu/* @hfurubotten
homeassistant/components/nissan_leaf/* @filcole
homeassistant/components/nmbs/* @thibmaek
homeassistant/components/no_ip/* @fabaff
@@ -221,14 +240,16 @@ homeassistant/components/oru/* @bvlaicu
homeassistant/components/owlet/* @oblogic7
homeassistant/components/panel_custom/* @home-assistant/frontend
homeassistant/components/panel_iframe/* @home-assistant/frontend
homeassistant/components/pcal9535a/* @Shulyaka
homeassistant/components/persistent_notification/* @home-assistant/core
homeassistant/components/philips_js/* @elupus
homeassistant/components/pi_hole/* @fabaff @johnluetke
homeassistant/components/plaato/* @JohNan
homeassistant/components/plant/* @ChristianKuehnel
homeassistant/components/plex/* @jjlawren
homeassistant/components/plugwise/* @laetificat @CoMPaTech
homeassistant/components/plugwise/* @laetificat @CoMPaTech @bouwew
homeassistant/components/point/* @fredrike
homeassistant/components/proxmoxve/* @k4ds3
homeassistant/components/ps4/* @ktnrg45
homeassistant/components/ptvsd/* @swamp-ig
homeassistant/components/push/* @dgomes
@@ -247,6 +268,7 @@ homeassistant/components/rfxtrx/* @danielhiversen
homeassistant/components/rmvtransport/* @cgtobi
homeassistant/components/roomba/* @pschmitt
homeassistant/components/saj/* @fredericvl
homeassistant/components/samsungtv/* @escoand
homeassistant/components/scene/* @home-assistant/core
homeassistant/components/scrape/* @fabaff
homeassistant/components/script/* @home-assistant/core
@@ -272,11 +294,14 @@ homeassistant/components/soma/* @ratsept
homeassistant/components/somfy/* @tetienne
homeassistant/components/songpal/* @rytilahti
homeassistant/components/spaceapi/* @fabaff
homeassistant/components/speedtestdotnet/* @rohankapoorcom
homeassistant/components/spider/* @peternijssen
homeassistant/components/sql/* @dgomes
homeassistant/components/starline/* @anonym-tsk
homeassistant/components/statistics/* @fabaff
homeassistant/components/stiebel_eltron/* @fucm
homeassistant/components/stream/* @hunterjm
homeassistant/components/stt/* @pvizeli
homeassistant/components/suez_water/* @ooii
homeassistant/components/sun/* @Swamp-Ig
homeassistant/components/supla/* @mwegrzynek
@@ -288,6 +313,7 @@ homeassistant/components/switchmate/* @danielhiversen
homeassistant/components/syncthru/* @nielstron
homeassistant/components/synology_srm/* @aerialls
homeassistant/components/syslog/* @fabaff
homeassistant/components/tado/* @michaelarnauts
homeassistant/components/tahoma/* @philklei
homeassistant/components/tautulli/* @ludeeus
homeassistant/components/tellduslive/* @fredrike
@@ -305,12 +331,13 @@ homeassistant/components/tplink/* @rytilahti
homeassistant/components/traccar/* @ludeeus
homeassistant/components/tradfri/* @ggravlingen
homeassistant/components/trafikverket_train/* @endor-force
homeassistant/components/transmission/* @engrbm87
homeassistant/components/transmission/* @engrbm87 @JPHutchins
homeassistant/components/tts/* @robbiet480
homeassistant/components/twentemilieu/* @frenck
homeassistant/components/twilio_call/* @robbiet480
homeassistant/components/twilio_sms/* @robbiet480
homeassistant/components/unifi/* @kane610
homeassistant/components/unifiled/* @florisvdk
homeassistant/components/upc_connect/* @pvizeli
homeassistant/components/upcloud/* @scop
homeassistant/components/updater/* @home-assistant/core
@@ -320,6 +347,7 @@ homeassistant/components/usgs_earthquakes_feed/* @exxamalte
homeassistant/components/utility_meter/* @dgomes
homeassistant/components/velbus/* @cereal2nd
homeassistant/components/velux/* @Julius2342
homeassistant/components/versasense/* @flamm3blemuff1n
homeassistant/components/version/* @fabaff
homeassistant/components/vesync/* @markperdue @webdjoe
homeassistant/components/vicare/* @oischinger
@@ -333,6 +361,7 @@ homeassistant/components/weblink/* @home-assistant/core
homeassistant/components/websocket_api/* @home-assistant/core
homeassistant/components/wemo/* @sqldiablo
homeassistant/components/withings/* @vangorra
homeassistant/components/wled/* @frenck
homeassistant/components/worldclock/* @fabaff
homeassistant/components/wwlln/* @bachya
homeassistant/components/xbox_live/* @MartinHjelmare

View File

@@ -24,9 +24,9 @@ RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
WORKDIR /workspaces
# Install Python dependencies from requirements
COPY requirements_test.txt homeassistant/package_constraints.txt ./
COPY requirements_test.txt requirements_test_pre_commit.txt homeassistant/package_constraints.txt ./
RUN pip3 install -r requirements_test.txt -c package_constraints.txt \
&& rm -f requirements_test.txt package_constraints.txt
&& rm -f requirements_test.txt package_constraints.txt requirements_test_pre_commit.txt
# Set the default shell to bash instead of sh
ENV SHELL /bin/bash

View File

@@ -45,11 +45,15 @@ stages:
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
pre-commit install-hooks --config .pre-commit-config-all.yaml
- script: |
. venv/bin/activate
pre-commit run flake8 --all-files
displayName: 'Run flake8'
- script: |
. venv/bin/activate
pre-commit run bandit --all-files
displayName: 'Run bandit'
- job: 'Validate'
pool:
vmImage: 'ubuntu-latest'
@@ -84,7 +88,7 @@ stages:
. venv/bin/activate
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
pre-commit install-hooks --config .pre-commit-config-all.yaml
- script: |
. venv/bin/activate
pre-commit run black --all-files
@@ -127,7 +131,7 @@ stages:
set -e
. venv/bin/activate
pytest --timeout=9 --durations=10 -n 2 --dist loadfile -qq -o console_output_style=count -p no:sugar tests
pytest --timeout=9 --durations=10 -n auto --dist=loadfile -qq -o console_output_style=count -p no:sugar tests
script/check_dirty
displayName: 'Run pytest for python $(python.container)'
condition: and(succeeded(), ne(variables['python.container'], variables['PythonMain']))
@@ -135,7 +139,7 @@ stages:
set -e
. venv/bin/activate
pytest --timeout=9 --durations=10 -n 2 --dist loadfile --cov homeassistant --cov-report html -qq -o console_output_style=count -p no:sugar tests
pytest --timeout=9 --durations=10 -n auto --dist=loadfile --cov homeassistant --cov-report html -qq -o console_output_style=count -p no:sugar tests
codecov --token $(codecovToken)
script/check_dirty
displayName: 'Run pytest for python $(python.container) / coverage'
@@ -158,7 +162,7 @@ stages:
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools
pip install -U pip setuptools wheel
pip install -r requirements_all.txt -c homeassistant/package_constraints.txt
pip install -r requirements_test.txt -c homeassistant/package_constraints.txt
- script: |
@@ -182,8 +186,8 @@ stages:
. venv/bin/activate
pip install -e . -r requirements_test.txt -c homeassistant/package_constraints.txt
pre-commit install-hooks
pre-commit install-hooks --config .pre-commit-config-all.yaml
- script: |
. venv/bin/activate
pre-commit run mypy --all-files
pre-commit run --config .pre-commit-config-all.yaml mypy --all-files
displayName: 'Run mypy'

View File

@@ -15,12 +15,10 @@ if TYPE_CHECKING:
def set_loop() -> None:
"""Attempt to use uvloop."""
"""Attempt to use different loop."""
import asyncio
from asyncio.events import BaseDefaultEventLoopPolicy
policy = None
if sys.platform == "win32":
if hasattr(asyncio, "WindowsProactorEventLoopPolicy"):
# pylint: disable=no-member
@@ -33,15 +31,7 @@ def set_loop() -> None:
_loop_factory = asyncio.ProactorEventLoop
policy = ProactorPolicy()
else:
try:
import uvloop
except ImportError:
pass
else:
policy = uvloop.EventLoopPolicy()
if policy is not None:
asyncio.set_event_loop_policy(policy)
@@ -272,7 +262,6 @@ def cmdline() -> List[str]:
async def setup_and_run_hass(config_dir: str, args: argparse.Namespace) -> int:
"""Set up HASS and run."""
# pylint: disable=redefined-outer-name
from homeassistant import bootstrap, core
hass = core.HomeAssistant()

View File

@@ -261,7 +261,7 @@ class AuthManager:
"""Enable a multi-factor auth module for user."""
if user.system_generated:
raise ValueError(
"System generated users cannot enable " "multi-factor auth module."
"System generated users cannot enable multi-factor auth module."
)
module = self.get_auth_mfa_module(mfa_module_id)
@@ -276,7 +276,7 @@ class AuthManager:
"""Disable a multi-factor auth module for user."""
if user.system_generated:
raise ValueError(
"System generated users cannot disable " "multi-factor auth module."
"System generated users cannot disable multi-factor auth module."
)
module = self.get_auth_mfa_module(mfa_module_id)
@@ -320,7 +320,7 @@ class AuthManager:
if user.system_generated != (token_type == models.TOKEN_TYPE_SYSTEM):
raise ValueError(
"System generated users can only have system type " "refresh tokens"
"System generated users can only have system type refresh tokens"
)
if token_type == models.TOKEN_TYPE_NORMAL and client_id is None:
@@ -330,7 +330,7 @@ class AuthManager:
token_type == models.TOKEN_TYPE_LONG_LIVED_ACCESS_TOKEN
and client_name is None
):
raise ValueError("Client_name is required for long-lived access " "token")
raise ValueError("Client_name is required for long-lived access token")
if token_type == models.TOKEN_TYPE_LONG_LIVED_ACCESS_TOKEN:
for token in user.refresh_tokens.values():

View File

@@ -42,7 +42,7 @@ class MultiFactorAuthModule:
self.config = config
@property
def id(self) -> str: # pylint: disable=invalid-name
def id(self) -> str:
"""Return id of the auth module.
Default is same as type

View File

@@ -215,7 +215,11 @@ class TotpSetupFlow(SetupFlow):
else:
hass = self._auth_module.hass
self._ota_secret, self._url, self._image = await hass.async_add_executor_job(
(
self._ota_secret,
self._url,
self._image,
) = await hass.async_add_executor_job(
_generate_secret_and_qr_code, # type: ignore
str(self._user.name),
)

View File

@@ -1,18 +1,6 @@
"""Permissions for Home Assistant."""
import logging
from typing import ( # noqa: F401
cast,
Any,
Callable,
Dict,
List,
Mapping,
Optional,
Set,
Tuple,
Union,
TYPE_CHECKING,
)
from typing import Any, Callable, Optional
import voluptuous as vol
@@ -20,7 +8,7 @@ from .const import CAT_ENTITIES
from .models import PermissionLookup
from .types import PolicyType
from .entities import ENTITY_POLICY_SCHEMA, compile_entities
from .merge import merge_policies # noqa
from .merge import merge_policies # noqa: F401
from .util import test_all
@@ -70,15 +58,12 @@ class PolicyPermissions(AbstractPermissions):
def __eq__(self, other: Any) -> bool:
"""Equals check."""
# pylint: disable=protected-access
return isinstance(other, PolicyPermissions) and other._policy == self._policy
class _OwnerPermissions(AbstractPermissions):
"""Owner permissions."""
# pylint: disable=no-self-use
def access_all_entities(self, key: str) -> bool:
"""Check if we have a certain access to all entities."""
return True

View File

@@ -5,8 +5,8 @@ import attr
if TYPE_CHECKING:
# pylint: disable=unused-import
from homeassistant.helpers import entity_registry as ent_reg # noqa
from homeassistant.helpers import device_registry as dev_reg # noqa
from homeassistant.helpers import entity_registry as ent_reg # noqa: F401
from homeassistant.helpers import device_registry as dev_reg # noqa: F401
@attr.s(slots=True)

View File

@@ -21,8 +21,9 @@ def lookup_all(
def compile_policy(
policy: CategoryType, subcategories: SubCatLookupType, perm_lookup: PermissionLookup
) -> Callable[[str, str], bool]: # noqa
) -> Callable[[str, str], bool]:
"""Compile policy into a function that tests policy.
Subcategories are mapping key -> lookup function, ordered by highest
priority first.
"""
@@ -80,7 +81,7 @@ def compile_policy(
def _gen_dict_test_func(
perm_lookup: PermissionLookup, lookup_func: LookupFunc, lookup_dict: SubCategoryDict
) -> Callable[[str, str], Optional[bool]]: # noqa
) -> Callable[[str, str], Optional[bool]]:
"""Generate a lookup function."""
def test_value(object_id: str, key: str) -> Optional[bool]:

View File

@@ -48,7 +48,7 @@ class AuthProvider:
self.config = config
@property
def id(self) -> Optional[str]: # pylint: disable=invalid-name
def id(self) -> Optional[str]:
"""Return id of the auth provider.
Optional, can be None.

View File

@@ -33,6 +33,8 @@ STAGE_1_INTEGRATIONS = {
"recorder",
# To make sure we forward data to other instances
"mqtt_eventstream",
# To provide account link implementations
"cloud",
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430 Abode."
},
"error": {
"connection_error": "\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435 \u0441 Abode.",
"identifier_exists": "\u041f\u0440\u043e\u0444\u0438\u043b\u044a\u0442 \u0435 \u0432\u0435\u0447\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0430\u043d.",
"invalid_credentials": "\u041d\u0435\u0432\u0430\u043b\u0438\u0434\u043d\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u0438 \u0434\u0430\u043d\u043d\u0438."
},
"step": {
"user": {
"data": {
"password": "\u041f\u0430\u0440\u043e\u043b\u0430",
"username": "E-mail \u0430\u0434\u0440\u0435\u0441"
},
"title": "\u041f\u043e\u043f\u044a\u043b\u043d\u0435\u0442\u0435 \u0412\u0430\u0448\u0430\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0437\u0430 \u0432\u0445\u043e\u0434 \u0432 Abode"
}
},
"title": "Abode"
}
}

View File

@@ -0,0 +1,22 @@
{
"config": {
"abort": {
"single_instance_allowed": "Je povolena pouze jedna konfigurace Abode."
},
"error": {
"connection_error": "Nelze se p\u0159ipojit k Abode.",
"identifier_exists": "\u00da\u010det je ji\u017e zaregistrov\u00e1n.",
"invalid_credentials": "Neplatn\u00e9 p\u0159ihla\u0161ovac\u00ed \u00fadaje."
},
"step": {
"user": {
"data": {
"password": "Heslo",
"username": "E-mailov\u00e1 adresa"
},
"title": "Vypl\u0148te p\u0159ihla\u0161ovac\u00ed \u00fadaje Abode"
}
},
"title": "Abode"
}
}

View File

@@ -1,8 +1,17 @@
{
"config": {
"abort": {
"single_instance_allowed": "Somente uma \u00fanica configura\u00e7\u00e3o de Abode \u00e9 permitida."
},
"error": {
"connection_error": "N\u00e3o foi poss\u00edvel conectar ao Abode.",
"identifier_exists": "Conta j\u00e1 cadastrada.",
"invalid_credentials": "Credenciais inv\u00e1lidas."
},
"step": {
"user": {
"data": {
"password": "Senha",
"username": "Endere\u00e7o de e-mail"
}
}

View File

@@ -6,6 +6,7 @@
"step": {
"user": {
"data": {
"password": "Palavra-passe",
"username": "Endere\u00e7o de e-mail"
}
}

View File

@@ -5,8 +5,8 @@
},
"error": {
"connection_error": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a Abode.",
"identifier_exists": "\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430.",
"invalid_credentials": "\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435."
"identifier_exists": "\u0423\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430.",
"invalid_credentials": "\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0435 \u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435."
},
"step": {
"user": {

View File

@@ -20,17 +20,22 @@ from homeassistant.const import (
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.entity import Entity
from .const import ATTRIBUTION, DOMAIN
from .const import (
ATTRIBUTION,
DOMAIN,
DEFAULT_CACHEDB,
SIGNAL_CAPTURE_IMAGE,
SIGNAL_TRIGGER_QUICK_ACTION,
)
_LOGGER = logging.getLogger(__name__)
CONF_POLLING = "polling"
DEFAULT_CACHEDB = "./abodepy_cache.pickle"
SERVICE_SETTINGS = "change_setting"
SERVICE_CAPTURE_IMAGE = "capture_image"
SERVICE_TRIGGER = "trigger_quick_action"
@@ -91,7 +96,7 @@ class AbodeSystem:
self.abode = abode
self.polling = polling
self.devices = []
self.entity_ids = set()
self.logout_listener = None
@@ -181,27 +186,29 @@ def setup_hass_services(hass):
"""Capture a new image."""
entity_ids = call.data.get(ATTR_ENTITY_ID)
target_devices = [
device
for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids
target_entities = [
entity_id
for entity_id in hass.data[DOMAIN].entity_ids
if entity_id in entity_ids
]
for device in target_devices:
device.capture()
for entity_id in target_entities:
signal = SIGNAL_CAPTURE_IMAGE.format(entity_id)
dispatcher_send(hass, signal)
def trigger_quick_action(call):
"""Trigger a quick action."""
entity_ids = call.data.get(ATTR_ENTITY_ID, None)
target_devices = [
device
for device in hass.data[DOMAIN].devices
if device.entity_id in entity_ids
target_entities = [
entity_id
for entity_id in hass.data[DOMAIN].entity_ids
if entity_id in entity_ids
]
for device in target_devices:
device.trigger()
for entity_id in target_entities:
signal = SIGNAL_TRIGGER_QUICK_ACTION.format(entity_id)
dispatcher_send(hass, signal)
hass.services.register(
DOMAIN, SERVICE_SETTINGS, change_setting, schema=CHANGE_SETTING_SCHEMA
@@ -292,6 +299,7 @@ class AbodeDevice(Entity):
self._device.device_id,
self._update_callback,
)
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
async def async_will_remove_from_hass(self):
"""Unsubscribe from device events."""
@@ -354,13 +362,14 @@ class AbodeAutomation(Entity):
self._event = event
async def async_added_to_hass(self):
"""Subscribe Abode events."""
"""Subscribe to a group of Abode timeline events."""
if self._event:
self.hass.async_add_job(
self._data.abode.events.add_event_callback,
self._event,
self._update_callback,
)
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
@property
def should_poll(self):

View File

@@ -2,6 +2,10 @@
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.const import (
ATTR_ATTRIBUTION,
STATE_ALARM_ARMED_AWAY,
@@ -23,9 +27,8 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up an alarm control panel for an Abode device."""
"""Set up Abode alarm control panel device."""
data = hass.data[DOMAIN]
async_add_entities(
[AbodeAlarm(data, await hass.async_add_executor_job(data.abode.get_alarm))]
)
@@ -52,6 +55,11 @@ class AbodeAlarm(AbodeDevice, alarm.AlarmControlPanel):
state = None
return state
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY
def alarm_disarm(self, code=None):
"""Send disarm command."""
self._device.set_standby()

View File

@@ -5,9 +5,10 @@ import abodepy.helpers.constants as CONST
import abodepy.helpers.timeline as TIMELINE
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import AbodeAutomation, AbodeDevice
from .const import DOMAIN
from .const import DOMAIN, SIGNAL_TRIGGER_QUICK_ACTION
_LOGGER = logging.getLogger(__name__)
@@ -18,7 +19,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a sensor for an Abode device."""
"""Set up Abode binary sensor devices."""
data = hass.data[DOMAIN]
device_types = [
@@ -29,19 +30,19 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
CONST.TYPE_OPENING,
]
devices = []
entities = []
for device in data.abode.get_devices(generic_type=device_types):
devices.append(AbodeBinarySensor(data, device))
entities.append(AbodeBinarySensor(data, device))
for automation in data.abode.get_automations(generic_type=CONST.TYPE_QUICK_ACTION):
devices.append(
entities.append(
AbodeQuickActionBinarySensor(
data, automation, TIMELINE.AUTOMATION_EDIT_GROUP
)
)
async_add_entities(devices)
async_add_entities(entities)
class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
@@ -61,6 +62,12 @@ class AbodeBinarySensor(AbodeDevice, BinarySensorDevice):
class AbodeQuickActionBinarySensor(AbodeAutomation, BinarySensorDevice):
"""A binary sensor implementation for Abode quick action automations."""
async def async_added_to_hass(self):
"""Subscribe Abode events."""
await super().async_added_to_hass()
signal = SIGNAL_TRIGGER_QUICK_ACTION.format(self.entity_id)
async_dispatcher_connect(self.hass, signal, self.trigger)
def trigger(self):
"""Trigger a quick automation."""
self._automation.trigger()

View File

@@ -7,10 +7,11 @@ import abodepy.helpers.timeline as TIMELINE
import requests
from homeassistant.components.camera import Camera
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.util import Throttle
from . import AbodeDevice
from .const import DOMAIN
from .const import DOMAIN, SIGNAL_CAPTURE_IMAGE
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)
@@ -23,15 +24,15 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a camera for an Abode device."""
"""Set up Abode camera devices."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_CAMERA):
devices.append(AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE))
entities = []
async_add_entities(devices)
for device in data.abode.get_devices(generic_type=CONST.TYPE_CAMERA):
entities.append(AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE))
async_add_entities(entities)
class AbodeCamera(AbodeDevice, Camera):
@@ -54,6 +55,9 @@ class AbodeCamera(AbodeDevice, Camera):
self._capture_callback,
)
signal = SIGNAL_CAPTURE_IMAGE.format(self.entity_id)
async_dispatcher_connect(self.hass, signal, self.capture)
def capture(self):
"""Request a new image capture."""
return self._device.capture()

View File

@@ -10,7 +10,7 @@ from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import callback
from .const import DOMAIN # pylint: disable=W0611
from .const import DOMAIN, DEFAULT_CACHEDB # pylint: disable=unused-import
CONF_POLLING = "polling"
@@ -42,9 +42,12 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
username = user_input[CONF_USERNAME]
password = user_input[CONF_PASSWORD]
polling = user_input.get(CONF_POLLING, False)
cache = self.hass.config.path(DEFAULT_CACHEDB)
try:
await self.hass.async_add_executor_job(Abode, username, password, True)
await self.hass.async_add_executor_job(
Abode, username, password, True, True, True, cache
)
except (AbodeException, ConnectTimeout, HTTPError) as ex:
_LOGGER.error("Unable to connect to Abode: %s", str(ex))

View File

@@ -1,3 +1,8 @@
"""Constants for the Abode Security System component."""
DOMAIN = "abode"
ATTRIBUTION = "Data provided by goabode.com"
DEFAULT_CACHEDB = "abodepy_cache.pickle"
SIGNAL_CAPTURE_IMAGE = "abode_camera_capture_{}"
SIGNAL_TRIGGER_QUICK_ACTION = "abode_trigger_quick_action_{}"

View File

@@ -18,14 +18,14 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode cover devices."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_COVER):
devices.append(AbodeCover(data, device))
entities = []
async_add_entities(devices)
for device in data.abode.get_devices(generic_type=CONST.TYPE_COVER):
entities.append(AbodeCover(data, device))
async_add_entities(entities)
class AbodeCover(AbodeDevice, CoverDevice):

View File

@@ -33,12 +33,12 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode light devices."""
data = hass.data[DOMAIN]
devices = []
entities = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_LIGHT):
devices.append(AbodeLight(data, device))
entities.append(AbodeLight(data, device))
async_add_entities(devices)
async_add_entities(entities)
class AbodeLight(AbodeDevice, Light):

View File

@@ -18,14 +18,14 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode lock devices."""
data = hass.data[DOMAIN]
devices = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_LOCK):
devices.append(AbodeLock(data, device))
entities = []
async_add_entities(devices)
for device in data.abode.get_devices(generic_type=CONST.TYPE_LOCK):
entities.append(AbodeLock(data, device))
async_add_entities(entities)
class AbodeLock(AbodeDevice, LockDevice):

View File

@@ -4,7 +4,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/abode",
"requirements": [
"abodepy==0.16.6"
"abodepy==0.16.7"
],
"dependencies": [],
"codeowners": [

View File

@@ -16,9 +16,9 @@ _LOGGER = logging.getLogger(__name__)
# Sensor types: Name, icon
SENSOR_TYPES = {
"temp": ["Temperature", DEVICE_CLASS_TEMPERATURE],
"humidity": ["Humidity", DEVICE_CLASS_HUMIDITY],
"lux": ["Lux", DEVICE_CLASS_ILLUMINANCE],
CONST.TEMP_STATUS_KEY: ["Temperature", DEVICE_CLASS_TEMPERATURE],
CONST.HUMI_STATUS_KEY: ["Humidity", DEVICE_CLASS_HUMIDITY],
CONST.LUX_STATUS_KEY: ["Lux", DEVICE_CLASS_ILLUMINANCE],
}
@@ -28,16 +28,18 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up a sensor for an Abode device."""
"""Set up Abode sensor devices."""
data = hass.data[DOMAIN]
devices = []
entities = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_SENSOR):
for sensor_type in SENSOR_TYPES:
devices.append(AbodeSensor(data, device, sensor_type))
if sensor_type not in device.get_value(CONST.STATUSES_KEY):
continue
entities.append(AbodeSensor(data, device, sensor_type))
async_add_entities(devices)
async_add_entities(entities)
class AbodeSensor(AbodeDevice):
@@ -62,22 +64,27 @@ class AbodeSensor(AbodeDevice):
"""Return the device class."""
return self._device_class
@property
def unique_id(self):
"""Return a unique ID to use for this device."""
return f"{self._device.device_uuid}-{self._sensor_type}"
@property
def state(self):
"""Return the state of the sensor."""
if self._sensor_type == "temp":
if self._sensor_type == CONST.TEMP_STATUS_KEY:
return self._device.temp
if self._sensor_type == "humidity":
if self._sensor_type == CONST.HUMI_STATUS_KEY:
return self._device.humidity
if self._sensor_type == "lux":
if self._sensor_type == CONST.LUX_STATUS_KEY:
return self._device.lux
@property
def unit_of_measurement(self):
"""Return the units of measurement."""
if self._sensor_type == "temp":
if self._sensor_type == CONST.TEMP_STATUS_KEY:
return self._device.temp_unit
if self._sensor_type == "humidity":
if self._sensor_type == CONST.HUMI_STATUS_KEY:
return self._device.humidity_unit
if self._sensor_type == "lux":
if self._sensor_type == CONST.LUX_STATUS_KEY:
return self._device.lux_unit

View File

@@ -21,17 +21,17 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up Abode switch devices."""
data = hass.data[DOMAIN]
devices = []
entities = []
for device in data.abode.get_devices(generic_type=CONST.TYPE_SWITCH):
devices.append(AbodeSwitch(data, device))
entities.append(AbodeSwitch(data, device))
for automation in data.abode.get_automations(generic_type=CONST.TYPE_AUTOMATION):
devices.append(
entities.append(
AbodeAutomationSwitch(data, automation, TIMELINE.AUTOMATION_EDIT_GROUP)
)
async_add_entities(devices)
async_add_entities(entities)
class AbodeSwitch(AbodeDevice, SwitchDevice):

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "\u0422\u0430\u0437\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u0438\u0441\u043a\u0432\u0430 AdGuard Home {minimal_version} \u0438\u043b\u0438 \u043f\u043e-\u043d\u043e\u0432\u0430 {minimal_version}, \u0438\u043c\u0430\u0442\u0435 {current_version}. \u041c\u043e\u043b\u044f, \u0430\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0430\u0439\u0442\u0435 \u0432\u0430\u0448\u0430\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u043a\u0430 \u0437\u0430 Hass.io AdGuard Home.",
"adguard_home_outdated": "\u0422\u0430\u0437\u0438 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0438\u0437\u0438\u0441\u043a\u0432\u0430 AdGuard Home {minimal_version} \u0438\u043b\u0438 \u043f\u043e-\u043d\u043e\u0432\u0430 {minimal_version}, \u0438\u043c\u0430\u0442\u0435 {current_version}.",
"existing_instance_updated": "\u0410\u043a\u0442\u0443\u0430\u043b\u0438\u0437\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u0441\u044a\u0449\u0435\u0441\u0442\u0432\u0443\u0432\u0430\u0449\u0430\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f.",
"single_instance_allowed": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430 AdGuard Home."
},

View File

@@ -1,6 +1,8 @@
{
"config": {
"abort": {
"adguard_home_addon_outdated": "Questa integrazione richiede AdGuard Home {minimal_version} o versione successiva, si dispone di {current_version}. Aggiorna il componente aggiuntivo Hass.io AdGuard Home.",
"adguard_home_outdated": "Questa integrazione richiede AdGuard Home {minimal_version} o versione successiva, si dispone di {current_version}.",
"existing_instance_updated": "Configurazione esistente aggiornata.",
"single_instance_allowed": "\u00c8 consentita solo una singola configurazione di AdGuard Home."
},

View File

@@ -4,7 +4,9 @@
"user": {
"data": {
"host": "Servidor",
"port": "Porta"
"password": "Palavra-passe",
"port": "Porta",
"username": "Nome de Utilizador"
}
}
}

View File

@@ -2,6 +2,7 @@
from datetime import timedelta
import logging
from pyaftership.tracker import Tracking
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
@@ -11,6 +12,7 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
@@ -56,8 +58,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the AfterShip sensor platform."""
from pyaftership.tracker import Tracking
apikey = config[CONF_API_KEY]
name = config[CONF_NAME]

View File

@@ -3,7 +3,7 @@ from datetime import timedelta
import logging
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.config_validation import ( # noqa
from homeassistant.helpers.config_validation import ( # noqa: F401
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
)

View File

@@ -0,0 +1,22 @@
{
"config": {
"error": {
"auth": "API \u043a\u043b\u044e\u0447\u044a\u0442 \u043d\u0435 \u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0435\u043d.",
"name_exists": "\u0418\u043c\u0435\u0442\u043e \u0432\u0435\u0447\u0435 \u0441\u044a\u0449\u0435\u0441\u0442\u0432\u0443\u0432\u0430.",
"wrong_location": "\u0412 \u0442\u0430\u0437\u0438 \u043e\u0431\u043b\u0430\u0441\u0442 \u043d\u044f\u043c\u0430 \u0438\u0437\u043c\u0435\u0440\u0432\u0430\u0442\u0435\u043b\u043d\u0438 \u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u043d\u0430 Airly."
},
"step": {
"user": {
"data": {
"api_key": "API \u043a\u043b\u044e\u0447 \u0437\u0430 Airly",
"latitude": "\u0428\u0438\u0440\u0438\u043d\u0430",
"longitude": "\u0414\u044a\u043b\u0436\u0438\u043d\u0430",
"name": "\u0418\u043c\u0435 \u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f\u0442\u0430"
},
"description": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u0442\u043e \u043d\u0430 \u0432\u044a\u0437\u0434\u0443\u0445\u0430 Airly \u0417\u0430 \u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0430\u0442\u0435 \u043a\u043b\u044e\u0447 \u0437\u0430 API, \u043e\u0442\u0438\u0434\u0435\u0442\u0435 \u043d\u0430 https://developer.airly.eu/register",
"title": "Airly"
}
},
"title": "Airly"
}
}

View File

@@ -1,15 +1,16 @@
"""The Airly component."""
import asyncio
import logging
from datetime import timedelta
import logging
import async_timeout
from aiohttp.client_exceptions import ClientConnectorError
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.util import Throttle
@@ -30,6 +31,8 @@ DEFAULT_SCAN_INTERVAL = timedelta(minutes=10)
async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Airly."""
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
return True
@@ -45,8 +48,9 @@ async def async_setup_entry(hass, config_entry):
await airly.async_update()
hass.data[DOMAIN] = {}
hass.data[DOMAIN][DATA_CLIENT] = {}
if not airly.data:
raise ConfigEntryNotReady()
hass.data[DOMAIN][DATA_CLIENT][config_entry.entry_id] = airly
hass.async_create_task(
@@ -81,7 +85,7 @@ class AirlyData:
"""Update Airly data."""
try:
with async_timeout.timeout(10):
with async_timeout.timeout(20):
measurements = self.airly.create_measurements_session_point(
self.latitude, self.longitude
)
@@ -104,11 +108,8 @@ class AirlyData:
self.data[ATTR_API_CAQI_DESCRIPTION] = index["description"]
self.data[ATTR_API_ADVICE] = index["advice"]
_LOGGER.debug("Data retrieved from Airly")
except (
ValueError,
AirlyError,
asyncio.TimeoutError,
ClientConnectorError,
) as error:
except asyncio.TimeoutError:
_LOGGER.error("Asyncio Timeout Error")
except (ValueError, AirlyError, ClientConnectorError) as error:
_LOGGER.error(error)
self.data = {}

View File

@@ -0,0 +1,18 @@
{
"device_automation": {
"action_type": {
"arm_away": "\u0421\u043b\u043e\u0436\u0438 {entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c \u043e\u0442\u0441\u044a\u0441\u0442\u0432\u0438\u0435",
"arm_home": "\u0421\u043b\u043e\u0436\u0438 {entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c \u0432\u043a\u044a\u0449\u0438",
"arm_night": "\u0421\u043b\u043e\u0436\u0438 {entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430 \u0432 \u043d\u043e\u0449\u0435\u043d \u0440\u0435\u0436\u0438\u043c",
"disarm": "\u0414\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0430\u0439 {entity_name}",
"trigger": "\u0417\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0430\u043d\u0435 {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430",
"armed_home": "{entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430 - \u0432\u043a\u044a\u0449\u0438",
"armed_night": "{entity_name} \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430 - \u043d\u043e\u0449",
"disarmed": "{entity_name} \u0434\u0435\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0430\u043d\u0430",
"triggered": "{entity_name} \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0430\u043d\u0430"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Activa {entity_name} nocturn",
"disarm": "Desactiva {entity_name}",
"trigger": "Dispara {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} activada en mode a fora",
"armed_home": "{entity_name} activada en mode a casa",
"armed_night": "{entity_name} activada en mode nocturn",
"disarmed": "{entity_name} desactivada",
"triggered": "{entity_name} disparat/ada"
}
}
}

View File

@@ -0,0 +1,11 @@
{
"device_automation": {
"action_type": {
"arm_away": "Aktivovat {entity_name} v re\u017eimu mimo domov",
"arm_home": "Aktivovat {entity_name} v re\u017eimu doma",
"arm_night": "Aktivovat {entity_name} v re\u017eimu noc",
"disarm": "Deaktivovat {entity_name}",
"trigger": "Spustit {entity_name}"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Arm {entity_name} night",
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} armed away",
"armed_home": "{entity_name} armed home",
"armed_night": "{entity_name} armed night",
"disarmed": "{entity_name} disarmed",
"triggered": "{entity_name} triggered"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Armare {entity_name} notte",
"disarm": "Disarmare {entity_name}",
"trigger": "Attivazione {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} armata modalit\u00e0 fuori casa",
"armed_home": "{entity_name} armata modalit\u00e0 a casa",
"armed_night": "{entity_name} armata modalit\u00e0 notte",
"disarmed": "{entity_name} disarmato",
"triggered": "{entity_name} attivato"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "{entity_name} fir Nuecht uschalten",
"disarm": "{entity_name} entsch\u00e4rfen",
"trigger": "{entity_name} ausl\u00e9isen"
},
"trigger_type": {
"armed_away": "{entity_name} ugeschalt fir Ennerwee",
"armed_home": "{entity_name} ugeschalt fir Doheem",
"armed_night": "{entity_name} ugeschalt fir Nuecht",
"disarmed": "{entity_name} entsch\u00e4rft",
"triggered": "{entity_name} ausgel\u00e9ist"
}
}
}

View File

@@ -1,6 +1,9 @@
{
"device_automation": {
"action_type": {
"arm_away": "Inschakelen {entity_name} afwezig",
"arm_home": "Inschakelen {entity_name} thuis",
"arm_night": "Inschakelen {entity_name} nacht",
"disarm": "Uitschakelen {entity_name}",
"trigger": "Trigger {entity_name}"
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Aktiver {entity_name} natt",
"disarm": "Deaktiver {entity_name}",
"trigger": "Utl\u00f8ser {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} borte sikkring ",
"armed_home": "{entity_name} hjemme sikkring",
"armed_night": "{entity_name} natt sikkring",
"disarmed": "{entity_name} deaktivert",
"triggered": "{entity_name} utl\u00f8st"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "uzbr\u00f3j (noc) {entity_name}",
"disarm": "rozbr\u00f3j {entity_name}",
"trigger": "wyzw\u00f3l {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} zostanie uzbrojony (poza domem)",
"armed_home": "{entity_name} zostanie uzbrojony (w domu)",
"armed_night": "{entity_name} zostanie uzbrojony (noc)",
"disarmed": "{entity_name} zostanie rozbrojony",
"triggered": "{entity_name} zostanie wyzwolony"
}
}
}

View File

@@ -1,6 +1,10 @@
{
"device_automation": {
"action_type": {
"arm_away": "Armar {entity_name} longe",
"arm_home": "Armar {entity_name} casa",
"arm_night": "Armar {entity_name} noite",
"disarm": "Desarmar {entity_name}",
"trigger": "Disparar {entidade_nome}"
}
}

View File

@@ -1,7 +1,18 @@
{
"device_automation": {
"action_type": {
"arm_away": "\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u0435 \u0434\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"arm_home": "\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u0414\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"arm_night": "\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u043e\u0447\u044c\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"disarm": "\u041e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0445\u0440\u0430\u043d\u0443 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"trigger": "{entity_name} \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442"
},
"trigger_type": {
"armed_away": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u0435 \u0434\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"armed_home": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u0414\u043e\u043c\u0430\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"armed_night": "\u0412\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u043e\u0445\u0440\u0430\u043d\u044b \"\u041d\u043e\u0447\u044c\" \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"disarmed": "\u041e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043e\u0445\u0440\u0430\u043d\u0430 \u043d\u0430 \u043f\u0430\u043d\u0435\u043b\u0438 {entity_name}",
"triggered": "{entity_name} \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "Vklju\u010di {entity_name} no\u010d",
"disarm": "Razoro\u017ei {entity_name}",
"trigger": "Spro\u017ei {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} oboro\u017een - zdoma",
"armed_home": "{entity_name} oboro\u017een - dom",
"armed_night": "{entity_name} oboro\u017een - no\u010d",
"disarmed": "{entity_name} razoro\u017een",
"triggered": "{entity_name} spro\u017een"
}
}
}

View File

@@ -6,6 +6,13 @@
"arm_night": "\u8a2d\u5b9a {entity_name} \u591c\u9593\u6a21\u5f0f",
"disarm": "\u89e3\u9664 {entity_name}",
"trigger": "\u89f8\u767c {entity_name}"
},
"trigger_type": {
"armed_away": "{entity_name} \u8a2d\u5b9a\u5916\u51fa",
"armed_home": "{entity_name} \u8a2d\u5b9a\u5728\u5bb6",
"armed_night": "{entity_name} \u8a2d\u5b9a\u591c\u9593",
"disarmed": "{entity_name} \u5df2\u89e3\u9664",
"triggered": "{entity_name} \u5df2\u89f8\u767c"
}
}
}

View File

@@ -1,4 +1,5 @@
"""Component to interface with an alarm control panel."""
from abc import abstractmethod
from datetime import timedelta
import logging
@@ -7,22 +8,30 @@ import voluptuous as vol
from homeassistant.const import (
ATTR_CODE,
ATTR_CODE_FORMAT,
SERVICE_ALARM_TRIGGER,
SERVICE_ALARM_DISARM,
SERVICE_ALARM_ARM_HOME,
SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_NIGHT,
SERVICE_ALARM_ARM_CUSTOM_BYPASS,
SERVICE_ALARM_ARM_HOME,
SERVICE_ALARM_ARM_NIGHT,
SERVICE_ALARM_DISARM,
SERVICE_ALARM_TRIGGER,
)
from homeassistant.helpers.config_validation import ( # noqa
ENTITY_SERVICE_SCHEMA,
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import ( # noqa: F401
make_entity_service_schema,
PLATFORM_SCHEMA,
PLATFORM_SCHEMA_BASE,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
from .const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
SUPPORT_ALARM_TRIGGER,
)
DOMAIN = "alarm_control_panel"
SCAN_INTERVAL = timedelta(seconds=30)
ATTR_CHANGED_BY = "changed_by"
@@ -32,9 +41,7 @@ ATTR_CODE_ARM_REQUIRED = "code_arm_required"
ENTITY_ID_FORMAT = DOMAIN + ".{}"
ALARM_SERVICE_SCHEMA = ENTITY_SERVICE_SCHEMA.extend(
{vol.Optional(ATTR_CODE): cv.string}
)
ALARM_SERVICE_SCHEMA = make_entity_service_schema({vol.Optional(ATTR_CODE): cv.string})
async def async_setup(hass, config):
@@ -49,21 +56,34 @@ async def async_setup(hass, config):
SERVICE_ALARM_DISARM, ALARM_SERVICE_SCHEMA, "async_alarm_disarm"
)
component.async_register_entity_service(
SERVICE_ALARM_ARM_HOME, ALARM_SERVICE_SCHEMA, "async_alarm_arm_home"
SERVICE_ALARM_ARM_HOME,
ALARM_SERVICE_SCHEMA,
"async_alarm_arm_home",
[SUPPORT_ALARM_ARM_HOME],
)
component.async_register_entity_service(
SERVICE_ALARM_ARM_AWAY, ALARM_SERVICE_SCHEMA, "async_alarm_arm_away"
SERVICE_ALARM_ARM_AWAY,
ALARM_SERVICE_SCHEMA,
"async_alarm_arm_away",
[SUPPORT_ALARM_ARM_AWAY],
)
component.async_register_entity_service(
SERVICE_ALARM_ARM_NIGHT, ALARM_SERVICE_SCHEMA, "async_alarm_arm_night"
SERVICE_ALARM_ARM_NIGHT,
ALARM_SERVICE_SCHEMA,
"async_alarm_arm_night",
[SUPPORT_ALARM_ARM_NIGHT],
)
component.async_register_entity_service(
SERVICE_ALARM_ARM_CUSTOM_BYPASS,
ALARM_SERVICE_SCHEMA,
"async_alarm_arm_custom_bypass",
[SUPPORT_ALARM_ARM_CUSTOM_BYPASS],
)
component.async_register_entity_service(
SERVICE_ALARM_TRIGGER, ALARM_SERVICE_SCHEMA, "async_alarm_trigger"
SERVICE_ALARM_TRIGGER,
ALARM_SERVICE_SCHEMA,
"async_alarm_trigger",
[SUPPORT_ALARM_TRIGGER],
)
return True
@@ -79,7 +99,6 @@ async def async_unload_entry(hass, entry):
return await hass.data[DOMAIN].async_unload_entry(entry)
# pylint: disable=no-self-use
class AlarmControlPanel(Entity):
"""An abstract class for alarm control devices."""
@@ -164,6 +183,11 @@ class AlarmControlPanel(Entity):
"""
return self.hass.async_add_executor_job(self.alarm_arm_custom_bypass, code)
@property
@abstractmethod
def supported_features(self) -> int:
"""Return the list of supported features."""
@property
def state_attributes(self):
"""Return the state attributes."""

View File

@@ -0,0 +1,7 @@
"""Provides the constants needed for component."""
SUPPORT_ALARM_ARM_HOME = 1
SUPPORT_ALARM_ARM_AWAY = 2
SUPPORT_ALARM_ARM_NIGHT = 4
SUPPORT_ALARM_TRIGGER = 8
SUPPORT_ALARM_ARM_CUSTOM_BYPASS = 16

View File

@@ -1,5 +1,6 @@
"""Provides device automations for Alarm control panel."""
from typing import Optional, List
from typing import List, Optional
import voluptuous as vol
from homeassistant.const import (
@@ -16,10 +17,17 @@ from homeassistant.const import (
SERVICE_ALARM_DISARM,
SERVICE_ALARM_TRIGGER,
)
from homeassistant.core import HomeAssistant, Context
from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers import entity_registry
import homeassistant.helpers.config_validation as cv
from . import ATTR_CODE_ARM_REQUIRED, DOMAIN
from .const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
SUPPORT_ALARM_TRIGGER,
)
ACTION_TYPES = {"arm_away", "arm_home", "arm_night", "disarm", "trigger"}
@@ -42,31 +50,42 @@ async def async_get_actions(hass: HomeAssistant, device_id: str) -> List[dict]:
if entry.domain != DOMAIN:
continue
state = hass.states.get(entry.entity_id)
# We need a state or else we can't populate the HVAC and preset modes.
if state is None:
continue
supported_features = state.attributes["supported_features"]
# Add actions for each entity that belongs to this integration
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_away",
}
)
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_home",
}
)
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_night",
}
)
if supported_features & SUPPORT_ALARM_ARM_AWAY:
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_away",
}
)
if supported_features & SUPPORT_ALARM_ARM_HOME:
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_home",
}
)
if supported_features & SUPPORT_ALARM_ARM_NIGHT:
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "arm_night",
}
)
actions.append(
{
CONF_DEVICE_ID: device_id,
@@ -75,14 +94,15 @@ async def async_get_actions(hass: HomeAssistant, device_id: str) -> List[dict]:
CONF_TYPE: "disarm",
}
)
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "trigger",
}
)
if supported_features & SUPPORT_ALARM_TRIGGER:
actions.append(
{
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "trigger",
}
)
return actions

View File

@@ -0,0 +1,151 @@
"""Provides device automations for Alarm control panel."""
from typing import List
import voluptuous as vol
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.components.automation import AutomationActionType, state
from homeassistant.components.device_automation import TRIGGER_BASE_SCHEMA
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_PLATFORM,
CONF_TYPE,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED,
STATE_ALARM_PENDING,
STATE_ALARM_TRIGGERED,
)
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_registry
from homeassistant.helpers.typing import ConfigType
from . import DOMAIN
TRIGGER_TYPES = {
"triggered",
"disarmed",
"armed_home",
"armed_away",
"armed_night",
}
TRIGGER_SCHEMA = TRIGGER_BASE_SCHEMA.extend(
{
vol.Required(CONF_ENTITY_ID): cv.entity_id,
vol.Required(CONF_TYPE): vol.In(TRIGGER_TYPES),
}
)
async def async_get_triggers(hass: HomeAssistant, device_id: str) -> List[dict]:
"""List device triggers for Alarm control panel devices."""
registry = await entity_registry.async_get_registry(hass)
triggers = []
# Get all the integrations entities for this device
for entry in entity_registry.async_entries_for_device(registry, device_id):
if entry.domain != DOMAIN:
continue
entity_state = hass.states.get(entry.entity_id)
# We need a state or else we can't populate the HVAC and preset modes.
if entity_state is None:
continue
supported_features = entity_state.attributes["supported_features"]
# Add triggers for each entity that belongs to this integration
triggers += [
{
CONF_PLATFORM: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "disarmed",
},
{
CONF_PLATFORM: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "triggered",
},
]
if supported_features & SUPPORT_ALARM_ARM_HOME:
triggers.append(
{
CONF_PLATFORM: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "armed_home",
}
)
if supported_features & SUPPORT_ALARM_ARM_AWAY:
triggers.append(
{
CONF_PLATFORM: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "armed_away",
}
)
if supported_features & SUPPORT_ALARM_ARM_NIGHT:
triggers.append(
{
CONF_PLATFORM: "device",
CONF_DEVICE_ID: device_id,
CONF_DOMAIN: DOMAIN,
CONF_ENTITY_ID: entry.entity_id,
CONF_TYPE: "armed_night",
}
)
return triggers
async def async_attach_trigger(
hass: HomeAssistant,
config: ConfigType,
action: AutomationActionType,
automation_info: dict,
) -> CALLBACK_TYPE:
"""Attach a trigger."""
config = TRIGGER_SCHEMA(config)
if config[CONF_TYPE] == "triggered":
from_state = STATE_ALARM_PENDING
to_state = STATE_ALARM_TRIGGERED
elif config[CONF_TYPE] == "disarmed":
from_state = STATE_ALARM_TRIGGERED
to_state = STATE_ALARM_DISARMED
elif config[CONF_TYPE] == "armed_home":
from_state = STATE_ALARM_PENDING
to_state = STATE_ALARM_ARMED_HOME
elif config[CONF_TYPE] == "armed_away":
from_state = STATE_ALARM_PENDING
to_state = STATE_ALARM_ARMED_AWAY
elif config[CONF_TYPE] == "armed_night":
from_state = STATE_ALARM_PENDING
to_state = STATE_ALARM_ARMED_NIGHT
state_config = {
state.CONF_PLATFORM: "state",
CONF_ENTITY_ID: config[CONF_ENTITY_ID],
state.CONF_FROM: from_state,
state.CONF_TO: to_state,
}
state_config = state.TRIGGER_SCHEMA(state_config)
return await state.async_attach_trigger(
hass, state_config, action, automation_info, platform_type="device"
)

View File

@@ -4,7 +4,5 @@
"documentation": "https://www.home-assistant.io/integrations/alarm_control_panel",
"requirements": [],
"dependencies": [],
"codeowners": [
"@colinodell"
]
"codeowners": []
}

View File

@@ -0,0 +1,84 @@
"""Reproduce an Alarm control panel state."""
import asyncio
import logging
from typing import Iterable, Optional
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_CUSTOM_BYPASS,
SERVICE_ALARM_ARM_HOME,
SERVICE_ALARM_ARM_NIGHT,
SERVICE_ALARM_DISARM,
SERVICE_ALARM_TRIGGER,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED,
)
from homeassistant.core import Context, State
from homeassistant.helpers.typing import HomeAssistantType
from . import DOMAIN
_LOGGER = logging.getLogger(__name__)
VALID_STATES = {
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED,
STATE_ALARM_TRIGGERED,
}
async def _async_reproduce_state(
hass: HomeAssistantType, state: State, context: Optional[Context] = None
) -> None:
"""Reproduce a single state."""
cur_state = hass.states.get(state.entity_id)
if cur_state is None:
_LOGGER.warning("Unable to find entity %s", state.entity_id)
return
if state.state not in VALID_STATES:
_LOGGER.warning(
"Invalid state specified for %s: %s", state.entity_id, state.state
)
return
# Return if we are already at the right state.
if cur_state.state == state.state:
return
service_data = {ATTR_ENTITY_ID: state.entity_id}
if state.state == STATE_ALARM_ARMED_AWAY:
service = SERVICE_ALARM_ARM_AWAY
elif state.state == STATE_ALARM_ARMED_CUSTOM_BYPASS:
service = SERVICE_ALARM_ARM_CUSTOM_BYPASS
elif state.state == STATE_ALARM_ARMED_HOME:
service = SERVICE_ALARM_ARM_HOME
elif state.state == STATE_ALARM_ARMED_NIGHT:
service = SERVICE_ALARM_ARM_NIGHT
elif state.state == STATE_ALARM_DISARMED:
service = SERVICE_ALARM_DISARM
elif state.state == STATE_ALARM_TRIGGERED:
service = SERVICE_ALARM_TRIGGER
await hass.services.async_call(
DOMAIN, service, service_data, context=context, blocking=True
)
async def async_reproduce_states(
hass: HomeAssistantType, states: Iterable[State], context: Optional[Context] = None
) -> None:
"""Reproduce Alarm control panel states."""
await asyncio.gather(
*(_async_reproduce_state(hass, state, context) for state in states)
)

View File

@@ -10,6 +10,16 @@ alarm_disarm:
description: An optional code to disarm the alarm control panel with.
example: 1234
alarm_arm_custom_bypass:
description: Send arm custom bypass command.
fields:
entity_id:
description: Name of alarm control panel to arm custom bypass.
example: 'alarm_control_panel.downstairs'
code:
description: An optional code to arm custom bypass the alarm control panel with.
example: 1234
alarm_arm_home:
description: Send the alarm the command for arm home.
fields:
@@ -49,85 +59,3 @@ alarm_trigger:
code:
description: An optional code to trigger the alarm control panel with.
example: 1234
envisalink_alarm_keypress:
description: Send custom keypresses to the alarm.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
keypress:
description: 'String to send to the alarm panel (1-6 characters).'
example: '*71'
alarmdecoder_alarm_toggle_chime:
description: Send the alarm the toggle chime command.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
code:
description: A required code to toggle the alarm control panel chime with.
example: 1234
ifttt_push_alarm_state:
description: Update the alarm state to the specified value.
fields:
entity_id:
description: Name of the alarm control panel which state has to be updated.
example: 'alarm_control_panel.downstairs'
state:
description: The state to which the alarm control panel has to be set.
example: 'armed_night'
elkm1_alarm_arm_vacation:
description: Arm the ElkM1 in vacation mode.
fields:
entity_id:
description: Name of alarm control panel to arm.
example: 'alarm_control_panel.main'
code:
description: An code to arm the alarm control panel.
example: 1234
elkm1_alarm_arm_home_instant:
description: Arm the ElkM1 in home instant mode.
fields:
entity_id:
description: Name of alarm control panel to arm.
example: 'alarm_control_panel.main'
code:
description: An code to arm the alarm control panel.
example: 1234
elkm1_alarm_arm_night_instant:
description: Arm the ElkM1 in night instant mode.
fields:
entity_id:
description: Name of alarm control panel to arm.
example: 'alarm_control_panel.main'
code:
description: An code to arm the alarm control panel.
example: 1234
elkm1_alarm_display_message:
description: Display a message on all of the ElkM1 keypads for an area.
fields:
entity_id:
description: Name of alarm control panel to display messages on.
example: 'alarm_control_panel.main'
clear:
description: 0=clear message, 1=clear message with * key, 2=Display until timeout; default 2
example: 1
beep:
description: 0=no beep, 1=beep; default 0
example: 1
timeout:
description: Time to display message, 0=forever, max 65535, default 0
example: 4242
line1:
description: Up to 16 characters of text (truncated if too long). Default blank.
example: The answer to life,
line2:
description: Up to 16 characters of text (truncated if too long). Default blank.
example: the universe, and everything.

View File

@@ -6,6 +6,13 @@
"arm_night": "Arm {entity_name} night",
"disarm": "Disarm {entity_name}",
"trigger": "Trigger {entity_name}"
},
"trigger_type": {
"triggered": "{entity_name} triggered",
"disarmed": "{entity_name} disarmed",
"armed_home": "{entity_name} armed home",
"armed_away": "{entity_name} armed away",
"armed_night": "{entity_name} armed night"
}
}
}

View File

@@ -1,14 +1,17 @@
"""Support for AlarmDecoder devices."""
from datetime import timedelta
import logging
from datetime import timedelta
from alarmdecoder import AlarmDecoder
from alarmdecoder.devices import SerialDevice, SocketDevice, USBDevice
from alarmdecoder.util import NoDeviceError
import voluptuous as vol
from homeassistant.components.binary_sensor import DEVICE_CLASSES_SCHEMA
from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP
import homeassistant.helpers.config_validation as cv
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
_LOGGER = logging.getLogger(__name__)
@@ -109,9 +112,6 @@ CONFIG_SCHEMA = vol.Schema(
def setup(hass, config):
"""Set up for the AlarmDecoder devices."""
from alarmdecoder import AlarmDecoder
from alarmdecoder.devices import SocketDevice, SerialDevice, USBDevice
conf = config.get(DOMAIN)
restart = False
@@ -134,8 +134,6 @@ def setup(hass, config):
def open_connection(now=None):
"""Open a connection to AlarmDecoder."""
from alarmdecoder.util import NoDeviceError
nonlocal restart
try:
controller.open(baud)

View File

@@ -3,7 +3,15 @@ import logging
import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import (
AlarmControlPanel,
FORMAT_NUMBER,
)
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.const import (
ATTR_CODE,
STATE_ALARM_ARMED_AWAY,
@@ -13,11 +21,11 @@ from homeassistant.const import (
)
import homeassistant.helpers.config_validation as cv
from . import DATA_AD, DOMAIN as DOMAIN_ALARMDECODER, SIGNAL_PANEL_MESSAGE
from . import DATA_AD, DOMAIN, SIGNAL_PANEL_MESSAGE
_LOGGER = logging.getLogger(__name__)
SERVICE_ALARM_TOGGLE_CHIME = "alarmdecoder_alarm_toggle_chime"
SERVICE_ALARM_TOGGLE_CHIME = "alarm_toggle_chime"
ALARM_TOGGLE_CHIME_SCHEMA = vol.Schema({vol.Required(ATTR_CODE): cv.string})
SERVICE_ALARM_KEYPRESS = "alarm_keypress"
@@ -36,7 +44,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
device.alarm_toggle_chime(code)
hass.services.register(
alarm.DOMAIN,
DOMAIN,
SERVICE_ALARM_TOGGLE_CHIME,
alarm_toggle_chime_handler,
schema=ALARM_TOGGLE_CHIME_SCHEMA,
@@ -48,14 +56,14 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
device.alarm_keypress(keypress)
hass.services.register(
DOMAIN_ALARMDECODER,
DOMAIN,
SERVICE_ALARM_KEYPRESS,
alarm_keypress_handler,
schema=ALARM_KEYPRESS_SCHEMA,
)
class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
class AlarmDecoderAlarmPanel(AlarmControlPanel):
"""Representation of an AlarmDecoder-based alarm panel."""
def __init__(self):
@@ -115,13 +123,18 @@ class AlarmDecoderAlarmPanel(alarm.AlarmControlPanel):
@property
def code_format(self):
"""Return one or more digits/characters."""
return alarm.FORMAT_NUMBER
return FORMAT_NUMBER
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY | SUPPORT_ALARM_ARM_NIGHT
@property
def device_state_attributes(self):
"""Return the state attributes."""

View File

@@ -7,3 +7,13 @@ alarm_keypress:
keypress:
description: 'String to send to the alarm panel.'
example: '*71'
alarm_toggle_chime:
description: Send the alarm the toggle chime command.
fields:
entity_id:
description: Name of the alarm control panel to trigger.
example: 'alarm_control_panel.downstairs'
code:
description: A required code to toggle the alarm control panel chime with.
example: 1234

View File

@@ -7,6 +7,10 @@ import voluptuous as vol
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import PLATFORM_SCHEMA
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_HOME,
)
from homeassistant.const import (
CONF_CODE,
CONF_NAME,
@@ -95,6 +99,11 @@ class AlarmDotCom(alarm.AlarmControlPanel):
return STATE_ALARM_ARMED_AWAY
return None
@property
def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_ALARM_ARM_HOME | SUPPORT_ALARM_ARM_AWAY
@property
def device_state_attributes(self):
"""Return the state attributes."""

View File

@@ -9,14 +9,19 @@ from homeassistant.const import (
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_CLOSED,
STATE_LOCKED,
STATE_OFF,
STATE_ON,
STATE_OPEN,
STATE_PAUSED,
STATE_PLAYING,
STATE_UNAVAILABLE,
STATE_UNLOCKED,
STATE_UNKNOWN,
STATE_UNLOCKED,
)
import homeassistant.components.climate.const as climate
import homeassistant.components.media_player.const as media_player
from homeassistant.components.alarm_control_panel import ATTR_CODE_FORMAT, FORMAT_NUMBER
from homeassistant.components import light, fan, cover
import homeassistant.util.color as color_util
@@ -30,6 +35,7 @@ from .const import (
DATE_FORMAT,
PERCENTAGE_FAN_MAP,
RANGE_FAN_MAP,
Inputs,
)
from .errors import UnsupportedProperty
@@ -110,6 +116,16 @@ class AlexaCapability:
"""Return the Configuration object."""
return []
@staticmethod
def inputs():
"""Applicable only to media players."""
return []
@staticmethod
def supported_operations():
"""Return the supportedOperations object."""
return []
def serialize_discovery(self):
"""Serialize according to the Discovery API."""
result = {"type": "AlexaInterface", "interface": self.name(), "version": "3"}
@@ -150,6 +166,14 @@ class AlexaCapability:
if instance is not None:
result["instance"] = instance
supported_operations = self.supported_operations()
if supported_operations:
result["supportedOperations"] = supported_operations
inputs = self.inputs()
if inputs:
result["inputs"] = inputs
return result
def serialize_properties(self):
@@ -203,6 +227,20 @@ class AlexaCapability:
return friendly_names
class Alexa(AlexaCapability):
"""Implements Alexa Interface.
Although endpoints implement this interface implicitly,
The API suggests you should explicitly include this interface.
https://developer.amazon.com/docs/device-apis/alexa-interface.html
"""
def name(self):
"""Return the Alexa API name of this interface."""
return "Alexa"
class AlexaEndpointHealth(AlexaCapability):
"""Implements Alexa.EndpointHealth.
@@ -484,6 +522,28 @@ class AlexaPlaybackController(AlexaCapability):
"""Return the Alexa API name of this interface."""
return "Alexa.PlaybackController"
def supported_operations(self):
"""Return the supportedOperations object.
Supported Operations: FastForward, Next, Pause, Play, Previous, Rewind, StartOver, Stop
"""
supported_features = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
operations = {
media_player.SUPPORT_NEXT_TRACK: "Next",
media_player.SUPPORT_PAUSE: "Pause",
media_player.SUPPORT_PLAY: "Play",
media_player.SUPPORT_PREVIOUS_TRACK: "Previous",
media_player.SUPPORT_STOP: "Stop",
}
supported_operations = []
for operation in operations:
if operation & supported_features:
supported_operations.append(operations[operation])
return supported_operations
class AlexaInputController(AlexaCapability):
"""Implements Alexa.InputController.
@@ -495,6 +555,23 @@ class AlexaInputController(AlexaCapability):
"""Return the Alexa API name of this interface."""
return "Alexa.InputController"
def inputs(self):
"""Return the list of valid supported inputs."""
source_list = self.entity.attributes.get(
media_player.ATTR_INPUT_SOURCE_LIST, []
)
input_list = []
for source in source_list:
formatted_source = (
source.lower().replace("-", "").replace("_", "").replace(" ", "")
)
if formatted_source in Inputs.VALID_SOURCE_NAME_MAP.keys():
input_list.append(
{"name": Inputs.VALID_SOURCE_NAME_MAP[formatted_source]}
)
return input_list
class AlexaTemperatureSensor(AlexaCapability):
"""Implements Alexa.TemperatureSensor.
@@ -704,6 +781,34 @@ class AlexaThermostatController(AlexaCapability):
return {"value": temp, "scale": API_TEMP_UNITS[unit]}
def configuration(self):
"""Return configuration object.
Translates climate HVAC_MODES and PRESETS to supported Alexa ThermostatMode Values.
ThermostatMode Value must be AUTO, COOL, HEAT, ECO, OFF, or CUSTOM.
"""
supported_modes = []
hvac_modes = self.entity.attributes.get(climate.ATTR_HVAC_MODES)
for mode in hvac_modes:
thermostat_mode = API_THERMOSTAT_MODES.get(mode)
if thermostat_mode:
supported_modes.append(thermostat_mode)
preset_modes = self.entity.attributes.get(climate.ATTR_PRESET_MODES)
if preset_modes:
for mode in preset_modes:
thermostat_mode = API_THERMOSTAT_PRESETS.get(mode)
if thermostat_mode:
supported_modes.append(thermostat_mode)
# Return False for supportsScheduling until supported with event listener in handler.
configuration = {"supportsScheduling": False}
if supported_modes:
configuration["supportedModes"] = supported_modes
return configuration
class AlexaPowerLevelController(AlexaCapability):
"""Implements Alexa.PowerLevelController.
@@ -826,6 +931,9 @@ class AlexaModeController(AlexaCapability):
if self.instance == f"{fan.DOMAIN}.{fan.ATTR_DIRECTION}":
return self.entity.attributes.get(fan.ATTR_DIRECTION)
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
return self.entity.attributes.get(cover.ATTR_POSITION)
return None
def configuration(self):
@@ -841,6 +949,12 @@ class AlexaModeController(AlexaCapability):
{"type": Catalog.LABEL_ASSET, "value": Catalog.SETTING_DIRECTION}
]
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
capability_resources = [
{"type": Catalog.LABEL_ASSET, "value": Catalog.SETTING_MODE},
{"type": Catalog.LABEL_ASSET, "value": Catalog.SETTING_PRESET},
]
return capability_resources
def mode_resources(self):
@@ -865,6 +979,32 @@ class AlexaModeController(AlexaCapability):
],
}
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
mode_resources = {
"ordered": False,
"resources": [
{
"value": f"{cover.ATTR_POSITION}.{STATE_OPEN}",
"friendly_names": [
{"type": Catalog.LABEL_TEXT, "value": "open"},
{"type": Catalog.LABEL_TEXT, "value": "opened"},
{"type": Catalog.LABEL_TEXT, "value": "raise"},
{"type": Catalog.LABEL_TEXT, "value": "raised"},
],
},
{
"value": f"{cover.ATTR_POSITION}.{STATE_CLOSED}",
"friendly_names": [
{"type": Catalog.LABEL_TEXT, "value": "close"},
{"type": Catalog.LABEL_TEXT, "value": "closed"},
{"type": Catalog.LABEL_TEXT, "value": "shut"},
{"type": Catalog.LABEL_TEXT, "value": "lower"},
{"type": Catalog.LABEL_TEXT, "value": "lowered"},
],
},
],
}
return mode_resources
def serialize_mode_resources(self):
@@ -1078,3 +1218,50 @@ class AlexaDoorbellEventSource(AlexaCapability):
def capability_proactively_reported(self):
"""Return True for proactively reported capability."""
return True
class AlexaPlaybackStateReporter(AlexaCapability):
"""Implements Alexa.PlaybackStateReporter.
https://developer.amazon.com/docs/device-apis/alexa-playbackstatereporter.html
"""
def name(self):
"""Return the Alexa API name of this interface."""
return "Alexa.PlaybackStateReporter"
def properties_supported(self):
"""Return what properties this entity supports."""
return [{"name": "playbackState"}]
def properties_proactively_reported(self):
"""Return True if properties asynchronously reported."""
return True
def properties_retrievable(self):
"""Return True if properties can be retrieved."""
return True
def get_property(self, name):
"""Read and return a property."""
if name != "playbackState":
raise UnsupportedProperty(name)
playback_state = self.entity.state
if playback_state == STATE_PLAYING:
return {"state": "PLAYING"}
if playback_state == STATE_PAUSED:
return {"state": "PAUSED"}
return {"state": "STOPPED"}
class AlexaSeekController(AlexaCapability):
"""Implements Alexa.SeekController.
https://developer.amazon.com/docs/device-apis/alexa-seekcontroller.html
"""
def name(self):
"""Return the Alexa API name of this interface."""
return "Alexa.SeekController"

View File

@@ -56,9 +56,10 @@ API_THERMOSTAT_MODES = OrderedDict(
(climate.HVAC_MODE_AUTO, "AUTO"),
(climate.HVAC_MODE_OFF, "OFF"),
(climate.HVAC_MODE_FAN_ONLY, "OFF"),
(climate.HVAC_MODE_DRY, "OFF"),
(climate.HVAC_MODE_DRY, "CUSTOM"),
]
)
API_THERMOSTAT_MODES_CUSTOM = {climate.HVAC_MODE_DRY: "DEHUMIDIFY"}
API_THERMOSTAT_PRESETS = {climate.PRESET_ECO: "ECO"}
PERCENTAGE_FAN_MAP = {
@@ -271,3 +272,84 @@ class Unit:
WEIGHT_OUNCES = "Alexa.Unit.Weight.Ounces"
WEIGHT_POUNDS = "Alexa.Unit.Weight.Pounds"
class Inputs:
"""Valid names for the InputController.
https://developer.amazon.com/docs/device-apis/alexa-property-schemas.html#input
"""
VALID_SOURCE_NAME_MAP = {
"aux": "AUX 1",
"aux1": "AUX 1",
"aux2": "AUX 2",
"aux3": "AUX 3",
"aux4": "AUX 4",
"aux5": "AUX 5",
"aux6": "AUX 6",
"aux7": "AUX 7",
"bluray": "BLURAY",
"cable": "CABLE",
"cd": "CD",
"coax": "COAX 1",
"coax1": "COAX 1",
"coax2": "COAX 2",
"composite": "COMPOSITE 1",
"composite1": "COMPOSITE 1",
"dvd": "DVD",
"game": "GAME",
"gameconsole": "GAME",
"hdradio": "HD RADIO",
"hdmi": "HDMI 1",
"hdmi1": "HDMI 1",
"hdmi2": "HDMI 2",
"hdmi3": "HDMI 3",
"hdmi4": "HDMI 4",
"hdmi5": "HDMI 5",
"hdmi6": "HDMI 6",
"hdmi7": "HDMI 7",
"hdmi8": "HDMI 8",
"hdmi9": "HDMI 9",
"hdmi10": "HDMI 10",
"hdmiarc": "HDMI ARC",
"input": "INPUT 1",
"input1": "INPUT 1",
"input2": "INPUT 2",
"input3": "INPUT 3",
"input4": "INPUT 4",
"input5": "INPUT 5",
"input6": "INPUT 6",
"input7": "INPUT 7",
"input8": "INPUT 8",
"input9": "INPUT 9",
"input10": "INPUT 10",
"ipod": "IPOD",
"line": "LINE 1",
"line1": "LINE 1",
"line2": "LINE 2",
"line3": "LINE 3",
"line4": "LINE 4",
"line5": "LINE 5",
"line6": "LINE 6",
"line7": "LINE 7",
"mediaplayer": "MEDIA PLAYER",
"optical": "OPTICAL 1",
"optical1": "OPTICAL 1",
"optical2": "OPTICAL 2",
"phono": "PHONO",
"playstation": "PLAYSTATION",
"playstation3": "PLAYSTATION 3",
"playstation4": "PLAYSTATION 4",
"satellite": "SATELLITE",
"satellitetv": "SATELLITE",
"smartcast": "SMARTCAST",
"tuner": "TUNER",
"tv": "TV",
"usbdac": "USB DAC",
"video": "VIDEO 1",
"video1": "VIDEO 1",
"video2": "VIDEO 2",
"video3": "VIDEO 3",
"xbox": "XBOX",
}

View File

@@ -33,6 +33,7 @@ from homeassistant.components import (
from .const import CONF_DESCRIPTION, CONF_DISPLAY_CATEGORIES
from .capabilities import (
Alexa,
AlexaBrightnessController,
AlexaChannelController,
AlexaColorController,
@@ -46,11 +47,13 @@ from .capabilities import (
AlexaMotionSensor,
AlexaPercentageController,
AlexaPlaybackController,
AlexaPlaybackStateReporter,
AlexaPowerController,
AlexaPowerLevelController,
AlexaRangeController,
AlexaSceneController,
AlexaSecurityPanelController,
AlexaSeekController,
AlexaSpeaker,
AlexaStepSpeaker,
AlexaTemperatureSensor,
@@ -259,6 +262,7 @@ class GenericCapabilities(AlexaEntity):
return [
AlexaPowerController(self.entity),
AlexaEndpointHealth(self.hass, self.entity),
Alexa(self.hass),
]
@@ -268,6 +272,10 @@ class SwitchCapabilities(AlexaEntity):
def default_display_categories(self):
"""Return the display categories for this entity."""
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
if device_class == switch.DEVICE_CLASS_OUTLET:
return [DisplayCategory.SMARTPLUG]
return [DisplayCategory.SWITCH]
def interfaces(self):
@@ -275,6 +283,7 @@ class SwitchCapabilities(AlexaEntity):
return [
AlexaPowerController(self.entity),
AlexaEndpointHealth(self.hass, self.entity),
Alexa(self.hass),
]
@@ -297,6 +306,7 @@ class ClimateCapabilities(AlexaEntity):
yield AlexaThermostatController(self.hass, self.entity)
yield AlexaTemperatureSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(cover.DOMAIN)
@@ -305,7 +315,10 @@ class CoverCapabilities(AlexaEntity):
def default_display_categories(self):
"""Return the display categories for this entity."""
return [DisplayCategory.DOOR]
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
if device_class in (cover.DEVICE_CLASS_GARAGE, cover.DEVICE_CLASS_DOOR):
return [DisplayCategory.DOOR]
return [DisplayCategory.OTHER]
def interfaces(self):
"""Yield the supported interfaces."""
@@ -313,7 +326,12 @@ class CoverCapabilities(AlexaEntity):
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if supported & cover.SUPPORT_SET_POSITION:
yield AlexaPercentageController(self.entity)
if supported & (cover.SUPPORT_CLOSE | cover.SUPPORT_OPEN):
yield AlexaModeController(
self.entity, instance=f"{cover.DOMAIN}.{cover.ATTR_POSITION}"
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(light.DOMAIN)
@@ -336,6 +354,7 @@ class LightCapabilities(AlexaEntity):
if supported & light.SUPPORT_COLOR_TEMP:
yield AlexaColorTemperatureController(self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(fan.DOMAIN)
@@ -367,6 +386,7 @@ class FanCapabilities(AlexaEntity):
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(lock.DOMAIN)
@@ -382,6 +402,7 @@ class LockCapabilities(AlexaEntity):
return [
AlexaLockController(self.entity),
AlexaEndpointHealth(self.hass, self.entity),
Alexa(self.hass),
]
@@ -391,11 +412,14 @@ class MediaPlayerCapabilities(AlexaEntity):
def default_display_categories(self):
"""Return the display categories for this entity."""
device_class = self.entity.attributes.get(ATTR_DEVICE_CLASS)
if device_class == media_player.DEVICE_CLASS_SPEAKER:
return [DisplayCategory.SPEAKER]
return [DisplayCategory.TV]
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaEndpointHealth(self.hass, self.entity)
yield AlexaPowerController(self.entity)
supported = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
@@ -418,6 +442,10 @@ class MediaPlayerCapabilities(AlexaEntity):
)
if supported & playback_features:
yield AlexaPlaybackController(self.entity)
yield AlexaPlaybackStateReporter(self.entity)
if supported & media_player.const.SUPPORT_SEEK:
yield AlexaSeekController(self.entity)
if supported & media_player.SUPPORT_SELECT_SOURCE:
yield AlexaInputController(self.entity)
@@ -425,6 +453,9 @@ class MediaPlayerCapabilities(AlexaEntity):
if supported & media_player.const.SUPPORT_PLAY_MEDIA:
yield AlexaChannelController(self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(scene.DOMAIN)
class SceneCapabilities(AlexaEntity):
@@ -443,7 +474,10 @@ class SceneCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
return [AlexaSceneController(self.entity, supports_deactivation=False)]
return [
AlexaSceneController(self.entity, supports_deactivation=False),
Alexa(self.hass),
]
@ENTITY_ADAPTERS.register(script.DOMAIN)
@@ -457,7 +491,10 @@ class ScriptCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
can_cancel = bool(self.entity.attributes.get("can_cancel"))
return [AlexaSceneController(self.entity, supports_deactivation=can_cancel)]
return [
AlexaSceneController(self.entity, supports_deactivation=can_cancel),
Alexa(self.hass),
]
@ENTITY_ADAPTERS.register(sensor.DOMAIN)
@@ -476,6 +513,7 @@ class SensorCapabilities(AlexaEntity):
if attrs.get(ATTR_UNIT_OF_MEASUREMENT) in (TEMP_FAHRENHEIT, TEMP_CELSIUS):
yield AlexaTemperatureSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
@ENTITY_ADAPTERS.register(binary_sensor.DOMAIN)
@@ -505,8 +543,13 @@ class BinarySensorCapabilities(AlexaEntity):
if CONF_DISPLAY_CATEGORIES in entity_conf:
if entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.DOORBELL:
yield AlexaDoorbellEventSource(self.entity)
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.CONTACT_SENSOR:
yield AlexaContactSensor(self.hass, self.entity)
elif entity_conf[CONF_DISPLAY_CATEGORIES] == DisplayCategory.MOTION_SENSOR:
yield AlexaMotionSensor(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)
def get_type(self):
"""Return the type of binary sensor."""
@@ -530,3 +573,4 @@ class AlarmControlPanelCapabilities(AlexaEntity):
if not self.entity.attributes.get("code_arm_required"):
yield AlexaSecurityPanelController(self.hass, self.entity)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)

View File

@@ -111,3 +111,10 @@ class AlexaInvalidDirectiveError(AlexaError):
namespace = "Alexa"
error_type = "INVALID_DIRECTIVE"
class AlexaVideoActionNotPermittedForContentError(AlexaError):
"""Class to represent action not permitted for content errors."""
namespace = "Alexa.Video"
error_type = "ACTION_NOT_PERMITTED_FOR_CONTENT"

View File

@@ -9,7 +9,6 @@ from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE,
STATE_ALARM_DISARMED,
SERVICE_ALARM_ARM_AWAY,
SERVICE_ALARM_ARM_HOME,
SERVICE_ALARM_ARM_NIGHT,
@@ -28,6 +27,9 @@ from homeassistant.const import (
SERVICE_VOLUME_MUTE,
SERVICE_VOLUME_SET,
SERVICE_VOLUME_UP,
STATE_ALARM_DISARMED,
STATE_CLOSED,
STATE_OPEN,
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
@@ -38,9 +40,11 @@ from homeassistant.util.temperature import convert as convert_temperature
from .const import (
API_TEMP_UNITS,
API_THERMOSTAT_MODES_CUSTOM,
API_THERMOSTAT_MODES,
API_THERMOSTAT_PRESETS,
Cause,
Inputs,
PERCENTAGE_FAN_MAP,
RANGE_FAN_MAP,
SPEED_FAN_MAP,
@@ -53,6 +57,7 @@ from .errors import (
AlexaSecurityPanelUnauthorizedError,
AlexaTempRangeError,
AlexaUnsupportedThermostatModeError,
AlexaVideoActionNotPermittedForContentError,
)
from .state_report import async_enable_proactive_mode
@@ -457,13 +462,20 @@ async def async_api_select_input(hass, config, directive, context):
media_input = directive.payload["input"]
entity = directive.entity
# attempt to map the ALL UPPERCASE payload name to a source
source_list = entity.attributes[media_player.const.ATTR_INPUT_SOURCE_LIST] or []
# Attempt to map the ALL UPPERCASE payload name to a source.
# Strips trailing 1 to match single input devices.
source_list = entity.attributes.get(media_player.const.ATTR_INPUT_SOURCE_LIST, [])
for source in source_list:
# response will always be space separated, so format the source in the
# most likely way to find a match
formatted_source = source.lower().replace("-", " ").replace("_", " ")
if formatted_source in media_input.lower():
formatted_source = (
source.lower().replace("-", "").replace("_", "").replace(" ", "")
)
media_input = media_input.lower().replace(" ", "")
if (
formatted_source in Inputs.VALID_SOURCE_NAME_MAP.keys()
and formatted_source == media_input
) or (
media_input.endswith("1") and formatted_source == media_input.rstrip("1")
):
media_input = source
break
else:
@@ -767,11 +779,28 @@ async def async_api_set_thermostat_mode(hass, config, directive, context):
raise AlexaUnsupportedThermostatModeError(msg)
service = climate.SERVICE_SET_PRESET_MODE
data[climate.ATTR_PRESET_MODE] = climate.PRESET_ECO
data[climate.ATTR_PRESET_MODE] = ha_preset
elif mode == "CUSTOM":
operation_list = entity.attributes.get(climate.ATTR_HVAC_MODES)
custom_mode = directive.payload["thermostatMode"]["customName"]
custom_mode = next(
(k for k, v in API_THERMOSTAT_MODES_CUSTOM.items() if v == custom_mode),
None,
)
if custom_mode not in operation_list:
msg = (
f"The requested thermostat mode {mode}: {custom_mode} is not supported"
)
raise AlexaUnsupportedThermostatModeError(msg)
service = climate.SERVICE_SET_HVAC_MODE
data[climate.ATTR_HVAC_MODE] = custom_mode
else:
operation_list = entity.attributes.get(climate.ATTR_HVAC_MODES)
ha_mode = next((k for k, v in API_THERMOSTAT_MODES.items() if v == mode), None)
ha_modes = {k: v for k, v in API_THERMOSTAT_MODES.items() if v == mode}
ha_mode = next(iter(set(ha_modes).intersection(operation_list)), None)
if ha_mode not in operation_list:
msg = f"The requested thermostat mode {mode} is not supported"
raise AlexaUnsupportedThermostatModeError(msg)
@@ -937,23 +966,42 @@ async def async_api_set_mode(hass, config, directive, context):
domain = entity.domain
service = None
data = {ATTR_ENTITY_ID: entity.entity_id}
mode = directive.payload["mode"]
capability_mode = directive.payload["mode"]
if domain != fan.DOMAIN:
if domain not in (fan.DOMAIN, cover.DOMAIN):
msg = "Entity does not support directive"
raise AlexaInvalidDirectiveError(msg)
if instance == f"{fan.DOMAIN}.{fan.ATTR_DIRECTION}":
mode, direction = mode.split(".")
if direction in [fan.DIRECTION_REVERSE, fan.DIRECTION_FORWARD]:
_, direction = capability_mode.split(".")
if direction in (fan.DIRECTION_REVERSE, fan.DIRECTION_FORWARD):
service = fan.SERVICE_SET_DIRECTION
data[fan.ATTR_DIRECTION] = direction
if instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
_, position = capability_mode.split(".")
if position == STATE_CLOSED:
service = cover.SERVICE_CLOSE_COVER
if position == STATE_OPEN:
service = cover.SERVICE_OPEN_COVER
await hass.services.async_call(
domain, service, data, blocking=False, context=context
)
return directive.response()
response = directive.response()
response.add_context_property(
{
"namespace": "Alexa.ModeController",
"instance": instance,
"name": "mode",
"value": capability_mode,
}
)
return response
@HANDLERS.register(("Alexa.ModeController", "AdjustMode"))
@@ -1096,21 +1144,25 @@ async def async_api_changechannel(hass, config, directive, context):
"""Process a change channel request."""
channel = "0"
entity = directive.entity
payload = directive.payload["channel"]
channel_payload = directive.payload["channel"]
metadata_payload = directive.payload["channelMetadata"]
payload_name = "number"
if "number" in payload:
channel = payload["number"]
if "number" in channel_payload:
channel = channel_payload["number"]
payload_name = "number"
elif "callSign" in payload:
channel = payload["callSign"]
elif "callSign" in channel_payload:
channel = channel_payload["callSign"]
payload_name = "callSign"
elif "affiliateCallSign" in payload:
channel = payload["affiliateCallSign"]
elif "affiliateCallSign" in channel_payload:
channel = channel_payload["affiliateCallSign"]
payload_name = "affiliateCallSign"
elif "uri" in payload:
channel = payload["uri"]
elif "uri" in channel_payload:
channel = channel_payload["uri"]
payload_name = "uri"
elif "name" in metadata_payload:
channel = metadata_payload["name"]
payload_name = "callSign"
data = {
ATTR_ENTITY_ID: entity.entity_id,
@@ -1168,3 +1220,45 @@ async def async_api_skipchannel(hass, config, directive, context):
)
return response
@HANDLERS.register(("Alexa.SeekController", "AdjustSeekPosition"))
async def async_api_seek(hass, config, directive, context):
"""Process a seek request."""
entity = directive.entity
position_delta = int(directive.payload["deltaPositionMilliseconds"])
current_position = entity.attributes.get(media_player.ATTR_MEDIA_POSITION)
if not current_position:
msg = f"{entity} did not return the current media position."
raise AlexaVideoActionNotPermittedForContentError(msg)
seek_position = int(current_position) + int(position_delta / 1000)
if seek_position < 0:
seek_position = 0
media_duration = entity.attributes.get(media_player.ATTR_MEDIA_DURATION)
if media_duration and 0 < int(media_duration) < seek_position:
seek_position = media_duration
data = {
ATTR_ENTITY_ID: entity.entity_id,
media_player.ATTR_MEDIA_SEEK_POSITION: seek_position,
}
await hass.services.async_call(
media_player.DOMAIN,
media_player.SERVICE_MEDIA_SEEK,
data,
blocking=False,
context=context,
)
# convert seconds to milliseconds for StateReport.
seek_position = int(seek_position * 1000)
payload = {"properties": [{"name": "positionMilliseconds", "value": seek_position}]}
return directive.response(
name="StateReport", namespace="Alexa.SeekController", payload=payload
)

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "\u041c\u043e\u0436\u0435\u0442\u0435 \u0434\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u0442\u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u0438\u043d Almond \u0430\u043a\u0430\u0443\u043d\u0442.",
"cannot_connect": "\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435 \u0441 Almond \u0441\u044a\u0440\u0432\u044a\u0440\u0430.",
"missing_configuration": "\u041c\u043e\u043b\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 \u043a\u0430\u043a \u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u0435 Almond."
},
"step": {
"pick_implementation": {
"title": "\u0418\u0437\u0431\u043e\u0440 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u043a\u0430\u0446\u0438\u044f"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Nom\u00e9s pots configurar un \u00fanic compte amb Almond.",
"cannot_connect": "No es pot connectar amb el servidor d'Almond.",
"missing_configuration": "Consulta la documentaci\u00f3 sobre com configurar Almond."
},
"step": {
"pick_implementation": {
"title": "Selecci\u00f3 del m\u00e8tode d'autenticaci\u00f3"
}
},
"title": "Almond"
}
}

View File

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

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "You can only configure one Almond account.",
"cannot_connect": "Unable to connect to the Almond server.",
"missing_configuration": "Please check the documentation on how to set up Almond."
},
"step": {
"pick_implementation": {
"title": "Pick Authentication Method"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "S\u00f3lo puede configurar una cuenta de Almond.",
"cannot_connect": "No se puede conectar al servidor Almond.",
"missing_configuration": "Consulte la documentaci\u00f3n sobre c\u00f3mo configurar Almond."
},
"step": {
"pick_implementation": {
"title": "Seleccione el m\u00e9todo de autenticaci\u00f3n"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Vous ne pouvez configurer qu'un seul compte Almond",
"cannot_connect": "Impossible de se connecter au serveur Almond",
"missing_configuration": "Veuillez consulter la documentation pour savoir comment configurer Almond."
},
"step": {
"pick_implementation": {
"title": "S\u00e9lectionner une m\u00e9thode d'authentification"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "\u00c8 possibile configurare un solo account Almond.",
"cannot_connect": "Impossibile connettersi al server Almond.",
"missing_configuration": "Si prega di controllare la documentazione su come impostare Almond."
},
"step": {
"pick_implementation": {
"title": "Seleziona metodo di autenticazione"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,10 @@
{
"config": {
"abort": {
"already_setup": "\ud558\ub098\uc758 Almond \uacc4\uc815\ub9cc \uad6c\uc131 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.",
"cannot_connect": "Almond \uc11c\ubc84\uc5d0 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.",
"missing_configuration": "Almond \uc124\uc815 \ubc29\ubc95\uc5d0 \ub300\ud55c \uc124\uba85\uc11c\ub97c \ud655\uc778\ud574\uc8fc\uc138\uc694."
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Dir k\u00ebnnt n\u00ebmmen een eenzegen Almond Kont konfigur\u00e9ieren.",
"cannot_connect": "Kann sech net mam Almond Server verbannen.",
"missing_configuration": "Kuckt w.e.g. Dokumentatioun iwwert d'ariichten vun Almond."
},
"step": {
"pick_implementation": {
"title": "Wielt Authentifikatiouns Method aus"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "U kunt slechts \u00e9\u00e9n Almond-account configureren.",
"cannot_connect": "Kan geen verbinding maken met de Almond-server.",
"missing_configuration": "Raadpleeg de documentatie over het instellen van Almond."
},
"step": {
"pick_implementation": {
"title": "Kies de authenticatie methode"
}
},
"title": "Almond"
}
}

View File

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

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Du kan bare konfigurere en Almond konto.",
"cannot_connect": "Kan ikke koble til Almond-serveren.",
"missing_configuration": "Vennligst sjekk dokumentasjonen om hvordan du setter opp Almond."
},
"step": {
"pick_implementation": {
"title": "Velg autentiseringsmetode"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Mo\u017cesz skonfigurowa\u0107 tylko jedno konto Almond.",
"cannot_connect": "Nie mo\u017cna po\u0142\u0105czy\u0107 si\u0119 z serwerem Almond.",
"missing_configuration": "Prosz\u0119 zapozna\u0107 si\u0119 z dokumentacj\u0105 konfiguracji Almond."
},
"step": {
"pick_implementation": {
"title": "Wybierz metod\u0119 uwierzytelniania"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,10 @@
{
"config": {
"step": {
"pick_implementation": {
"title": "Escolha o m\u00e9todo de autentica\u00e7\u00e3o"
}
},
"title": ""
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0443\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430.",
"cannot_connect": "\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 Almond.",
"missing_configuration": "\u041e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Almond."
},
"step": {
"pick_implementation": {
"title": "\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043c\u0435\u0442\u043e\u0434 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "Konfigurirate lahko samo en ra\u010dun Almond.",
"cannot_connect": "Ni mogo\u010de vzpostaviti povezave s stre\u017enikom Almond.",
"missing_configuration": "Prosimo, preverite dokumentacijo o tem, kako nastaviti Almond."
},
"step": {
"pick_implementation": {
"title": "Izberite na\u010din preverjanja pristnosti"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"abort": {
"already_setup": "\u50c5\u80fd\u8a2d\u5b9a\u4e00\u7d44 Almond \u5e33\u865f\u3002",
"cannot_connect": "\u7121\u6cd5\u9023\u7dda\u81f3 Almond \u4f3a\u670d\u5668\u3002",
"missing_configuration": "\u8acb\u53c3\u8003\u76f8\u95dc\u6587\u4ef6\u4ee5\u4e86\u89e3\u5982\u4f55\u8a2d\u5b9a Almond\u3002"
},
"step": {
"pick_implementation": {
"title": "\u9078\u64c7\u9a57\u8b49\u6a21\u5f0f"
}
},
"title": "Almond"
}
}

View File

@@ -0,0 +1,308 @@
"""Support for Almond."""
import asyncio
from datetime import timedelta
import logging
import time
from typing import Optional
import async_timeout
from aiohttp import ClientSession, ClientError
from pyalmond import AlmondLocalAuth, AbstractAlmondWebAuth, WebAlmondAPI
import voluptuous as vol
from homeassistant.core import HomeAssistant, CoreState, Context
from homeassistant.const import CONF_TYPE, CONF_HOST, EVENT_HOMEASSISTANT_START
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.helpers import (
config_validation as cv,
config_entry_oauth2_flow,
event,
intent,
aiohttp_client,
storage,
network,
)
from homeassistant import config_entries
from homeassistant.components import conversation
from . import config_flow
from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
CONF_CLIENT_ID = "client_id"
CONF_CLIENT_SECRET = "client_secret"
STORAGE_VERSION = 1
STORAGE_KEY = DOMAIN
ALMOND_SETUP_DELAY = 30
DEFAULT_OAUTH2_HOST = "https://almond.stanford.edu"
DEFAULT_LOCAL_HOST = "http://localhost:3000"
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Any(
vol.Schema(
{
vol.Required(CONF_TYPE): TYPE_OAUTH2,
vol.Required(CONF_CLIENT_ID): cv.string,
vol.Required(CONF_CLIENT_SECRET): cv.string,
vol.Optional(CONF_HOST, default=DEFAULT_OAUTH2_HOST): cv.url,
}
),
vol.Schema(
{vol.Required(CONF_TYPE): TYPE_LOCAL, vol.Required(CONF_HOST): cv.url}
),
)
},
extra=vol.ALLOW_EXTRA,
)
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass, config):
"""Set up the Almond component."""
hass.data[DOMAIN] = {}
if DOMAIN not in config:
return True
conf = config[DOMAIN]
host = conf[CONF_HOST]
if conf[CONF_TYPE] == TYPE_OAUTH2:
config_flow.AlmondFlowHandler.async_register_implementation(
hass,
config_entry_oauth2_flow.LocalOAuth2Implementation(
hass,
DOMAIN,
conf[CONF_CLIENT_ID],
conf[CONF_CLIENT_SECRET],
f"{host}/me/api/oauth2/authorize",
f"{host}/me/api/oauth2/token",
),
)
return True
if not hass.config_entries.async_entries(DOMAIN):
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_IMPORT},
data={"type": TYPE_LOCAL, "host": conf[CONF_HOST]},
)
)
return True
async def async_setup_entry(hass: HomeAssistant, entry: config_entries.ConfigEntry):
"""Set up Almond config entry."""
websession = aiohttp_client.async_get_clientsession(hass)
if entry.data["type"] == TYPE_LOCAL:
auth = AlmondLocalAuth(entry.data["host"], websession)
else:
# OAuth2
implementation = await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
oauth_session = config_entry_oauth2_flow.OAuth2Session(
hass, entry, implementation
)
auth = AlmondOAuth(entry.data["host"], websession, oauth_session)
api = WebAlmondAPI(auth)
agent = AlmondAgent(hass, api, entry)
# Hass.io does its own configuration.
if not entry.data.get("is_hassio"):
# If we're not starting or local, set up Almond right away
if hass.state != CoreState.not_running or entry.data["type"] == TYPE_LOCAL:
await _configure_almond_for_ha(hass, entry, api)
else:
# OAuth2 implementations can potentially rely on the HA Cloud url.
# This url is not be available until 30 seconds after boot.
async def configure_almond(_now):
try:
await _configure_almond_for_ha(hass, entry, api)
except ConfigEntryNotReady:
_LOGGER.warning(
"Unable to configure Almond to connect to Home Assistant"
)
async def almond_hass_start(_event):
event.async_call_later(hass, ALMOND_SETUP_DELAY, configure_almond)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, almond_hass_start)
conversation.async_set_agent(hass, agent)
return True
async def _configure_almond_for_ha(
hass: HomeAssistant, entry: config_entries.ConfigEntry, api: WebAlmondAPI
):
"""Configure Almond to connect to HA."""
if entry.data["type"] == TYPE_OAUTH2:
# If we're connecting over OAuth2, we will only set up connection
# with Home Assistant if we're remotely accessible.
hass_url = network.async_get_external_url(hass)
else:
hass_url = hass.config.api.base_url
# If hass_url is None, we're not going to configure Almond to connect to HA.
if hass_url is None:
return
_LOGGER.debug("Configuring Almond to connect to Home Assistant at %s", hass_url)
store = storage.Store(hass, STORAGE_VERSION, STORAGE_KEY)
data = await store.async_load()
if data is None:
data = {}
user = None
if "almond_user" in data:
user = await hass.auth.async_get_user(data["almond_user"])
if user is None:
user = await hass.auth.async_create_system_user("Almond", [GROUP_ID_ADMIN])
data["almond_user"] = user.id
await store.async_save(data)
refresh_token = await hass.auth.async_create_refresh_token(
user,
# Almond will be fine as long as we restart once every 5 years
access_token_expiration=timedelta(days=365 * 5),
)
# Create long lived access token
access_token = hass.auth.async_create_access_token(refresh_token)
# Store token in Almond
try:
with async_timeout.timeout(30):
await api.async_create_device(
{
"kind": "io.home-assistant",
"hassUrl": hass_url,
"accessToken": access_token,
"refreshToken": "",
# 5 years from now in ms.
"accessTokenExpires": (time.time() + 60 * 60 * 24 * 365 * 5) * 1000,
}
)
except (asyncio.TimeoutError, ClientError) as err:
if isinstance(err, asyncio.TimeoutError):
msg = "Request timeout"
else:
msg = err
_LOGGER.warning("Unable to configure Almond: %s", msg)
await hass.auth.async_remove_refresh_token(refresh_token)
raise ConfigEntryNotReady
# Clear all other refresh tokens
for token in list(user.refresh_tokens.values()):
if token.id != refresh_token.id:
await hass.auth.async_remove_refresh_token(token)
async def async_unload_entry(hass, entry):
"""Unload Almond."""
conversation.async_set_agent(hass, None)
return True
class AlmondOAuth(AbstractAlmondWebAuth):
"""Almond Authentication using OAuth2."""
def __init__(
self,
host: str,
websession: ClientSession,
oauth_session: config_entry_oauth2_flow.OAuth2Session,
):
"""Initialize Almond auth."""
super().__init__(host, websession)
self._oauth_session = oauth_session
async def async_get_access_token(self):
"""Return a valid access token."""
if not self._oauth_session.valid_token:
await self._oauth_session.async_ensure_token_valid()
return self._oauth_session.token["access_token"]
class AlmondAgent(conversation.AbstractConversationAgent):
"""Almond conversation agent."""
def __init__(
self, hass: HomeAssistant, api: WebAlmondAPI, entry: config_entries.ConfigEntry
):
"""Initialize the agent."""
self.hass = hass
self.api = api
self.entry = entry
@property
def attribution(self):
"""Return the attribution."""
return {"name": "Powered by Almond", "url": "https://almond.stanford.edu/"}
async def async_get_onboarding(self):
"""Get onboard url if not onboarded."""
if self.entry.data.get("onboarded"):
return None
host = self.entry.data["host"]
if self.entry.data.get("is_hassio"):
host = "/core_almond"
return {
"text": "Would you like to opt-in to share your anonymized commands with Stanford to improve Almond's responses?",
"url": f"{host}/conversation",
}
async def async_set_onboarding(self, shown):
"""Set onboarding status."""
self.hass.config_entries.async_update_entry(
self.entry, data={**self.entry.data, "onboarded": shown}
)
return True
async def async_process(
self, text: str, context: Context, conversation_id: Optional[str] = None
) -> intent.IntentResponse:
"""Process a sentence."""
response = await self.api.async_converse_text(text, conversation_id)
first_choice = True
buffer = ""
for message in response["messages"]:
if message["type"] == "text":
buffer += "\n" + message["text"]
elif message["type"] == "picture":
buffer += "\n Picture: " + message["url"]
elif message["type"] == "rdl":
buffer += (
"\n Link: "
+ message["rdl"]["displayTitle"]
+ " "
+ message["rdl"]["webCallback"]
)
elif message["type"] == "choice":
if first_choice:
first_choice = False
else:
buffer += ","
buffer += f" {message['title']}"
intent_result = intent.IntentResponse()
intent_result.async_set_speech(buffer.strip())
return intent_result

View File

@@ -0,0 +1,125 @@
"""Config flow to connect with Home Assistant."""
import asyncio
import logging
import async_timeout
from aiohttp import ClientError
from yarl import URL
import voluptuous as vol
from pyalmond import AlmondLocalAuth, WebAlmondAPI
from homeassistant import data_entry_flow, config_entries, core
from homeassistant.helpers import config_entry_oauth2_flow, aiohttp_client
from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
async def async_verify_local_connection(hass: core.HomeAssistant, host: str):
"""Verify that a local connection works."""
websession = aiohttp_client.async_get_clientsession(hass)
api = WebAlmondAPI(AlmondLocalAuth(host, websession))
try:
with async_timeout.timeout(10):
await api.async_list_apps()
return True
except (asyncio.TimeoutError, ClientError):
return False
@config_entries.HANDLERS.register(DOMAIN)
class AlmondFlowHandler(config_entry_oauth2_flow.AbstractOAuth2FlowHandler):
"""Implementation of the Almond OAuth2 config flow."""
DOMAIN = DOMAIN
host = None
hassio_discovery = None
@property
def logger(self) -> logging.Logger:
"""Return logger."""
return logging.getLogger(__name__)
@property
def extra_authorize_data(self) -> dict:
"""Extra data that needs to be appended to the authorize url."""
return {"scope": "profile user-read user-read-results user-exec-command"}
async def async_step_user(self, user_input=None):
"""Handle a flow start."""
# Only allow 1 instance.
if self._async_current_entries():
return self.async_abort(reason="already_setup")
return await super().async_step_user(user_input)
async def async_step_auth(self, user_input=None):
"""Handle authorize step."""
result = await super().async_step_auth(user_input)
if result["type"] == data_entry_flow.RESULT_TYPE_EXTERNAL_STEP:
self.host = str(URL(result["url"]).with_path("me"))
return result
async def async_oauth_create_entry(self, data: dict) -> dict:
"""Create an entry for the flow.
Ok to override if you want to fetch extra info or even add another step.
"""
# pylint: disable=invalid-name
self.CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
data["type"] = TYPE_OAUTH2
data["host"] = self.host
return self.async_create_entry(title=self.flow_impl.name, data=data)
async def async_step_import(self, user_input: dict = None) -> dict:
"""Import data."""
# Only allow 1 instance.
if self._async_current_entries():
return self.async_abort(reason="already_setup")
if not await async_verify_local_connection(self.hass, user_input["host"]):
self.logger.warning(
"Aborting import of Almond because we're unable to connect"
)
return self.async_abort(reason="cannot_connect")
# pylint: disable=invalid-name
self.CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL
return self.async_create_entry(
title="Configuration.yaml",
data={"type": TYPE_LOCAL, "host": user_input["host"]},
)
async def async_step_hassio(self, user_input=None):
"""Receive a Hass.io discovery."""
if self._async_current_entries():
return self.async_abort(reason="already_setup")
self.hassio_discovery = user_input
return await self.async_step_hassio_confirm()
async def async_step_hassio_confirm(self, user_input=None):
"""Confirm a Hass.io discovery."""
data = self.hassio_discovery
if user_input is not None:
return self.async_create_entry(
title=data["addon"],
data={
"is_hassio": True,
"type": TYPE_LOCAL,
"host": f"http://{data['host']}:{data['port']}",
},
)
return self.async_show_form(
step_id="hassio_confirm",
description_placeholders={"addon": data["addon"]},
data_schema=vol.Schema({}),
)

View File

@@ -0,0 +1,4 @@
"""Constants for the Almond integration."""
DOMAIN = "almond"
TYPE_OAUTH2 = "oauth2"
TYPE_LOCAL = "local"

View File

@@ -0,0 +1,9 @@
{
"domain": "almond",
"name": "Almond",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/almond",
"dependencies": ["http", "conversation"],
"codeowners": ["@gcampax", "@balloob"],
"requirements": ["pyalmond==0.0.2"]
}

View File

@@ -0,0 +1,15 @@
{
"config": {
"step": {
"pick_implementation": {
"title": "Pick Authentication Method"
}
},
"abort": {
"already_setup": "You can only configure one Almond account.",
"cannot_connect": "Unable to connect to the Almond server.",
"missing_configuration": "Please check the documentation on how to set up Almond."
},
"title": "Almond"
}
}

View File

@@ -1 +1 @@
"""The alpha_vantage component."""
"""The Alpha Vantage component."""

View File

@@ -1,9 +1,9 @@
{
"domain": "alpha_vantage",
"name": "Alpha vantage",
"name": "Alpha Vantage",
"documentation": "https://www.home-assistant.io/integrations/alpha_vantage",
"requirements": [
"alpha_vantage==2.1.1"
"alpha_vantage==2.1.2"
],
"dependencies": [],
"codeowners": [

View File

@@ -3,10 +3,10 @@
"name": "Amazon polly",
"documentation": "https://www.home-assistant.io/integrations/amazon_polly",
"requirements": [
"boto3==1.9.233"
"boto3==1.9.252"
],
"dependencies": [],
"codeowners": [
"@robbiet480"
]
}
}

View File

@@ -145,7 +145,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
)
def get_engine(hass, config):
def get_engine(hass, config, discovery_info=None):
"""Set up Amazon Polly speech component."""
output_format = config.get(CONF_OUTPUT_FORMAT)
sample_rate = config.get(CONF_SAMPLE_RATE, DEFAULT_SAMPLE_RATES[output_format])

View File

@@ -3,7 +3,7 @@
"abort": {
"access_token": "Nieznany b\u0142\u0105d podczas generowania tokena dost\u0119pu.",
"already_setup": "Konto Ambiclimate jest skonfigurowane.",
"no_config": "Musisz skonfigurowa\u0107 Ambiclimate, zanim b\u0119dziesz m\u00f3g\u0142 si\u0119 w nim uwierzytelni\u0107. [Przeczytaj instrukcj\u0119] (https://www.home-assistant.io/components/ambiclimate/)."
"no_config": "Musisz skonfigurowa\u0107 Ambiclimate, aby m\u00f3c si\u0119 z nim uwierzytelni\u0107. Zapoznaj si\u0119 z [instrukcj\u0105](https://www.home-assistant.io/components/ambiclimate/)."
},
"create_entry": {
"default": "Pomy\u015blnie uwierzytelniono z Ambiclimate"

View File

@@ -2,7 +2,7 @@
"config": {
"abort": {
"access_token": "\u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0442\u043e\u043a\u0435\u043d\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0430 \u043e\u0448\u0438\u0431\u043a\u0430.",
"already_setup": "\u0423\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430.",
"already_setup": "\u0423\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0443\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430.",
"no_config": "\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 Ambiclimate \u043f\u0435\u0440\u0435\u0434 \u043f\u0440\u043e\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 [\u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438](https://www.home-assistant.io/components/ambiclimate/)."
},
"create_entry": {
@@ -14,7 +14,7 @@
},
"step": {
"auth": {
"description": "\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e [\u0441\u0441\u044b\u043b\u043a\u0435]({authorization_url}) \u0438 <b>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435</b> \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0412\u0430\u0448\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 Ambi Climate, \u0437\u0430\u0442\u0435\u043c \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0441\u044e\u0434\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>\u041f\u041e\u0414\u0422\u0412\u0415\u0420\u0414\u0418\u0422\u042c</b>. \n(\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 {cb_url})",
"description": "\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043f\u043e [\u0441\u0441\u044b\u043b\u043a\u0435]({authorization_url}) \u0438 <b>\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u0435</b> \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0412\u0430\u0448\u0435\u0439 \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 Ambi Climate, \u0437\u0430\u0442\u0435\u043c \u0432\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u0441\u044e\u0434\u0430 \u0438 \u043d\u0430\u0436\u043c\u0438\u0442\u0435 <b>\u041f\u041e\u0414\u0422\u0412\u0415\u0420\u0414\u0418\u0422\u042c</b>. \n(\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 URL \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 {cb_url})",
"title": "Ambi Climate"
}
},

View File

@@ -3,7 +3,7 @@
"error": {
"identifier_exists": "\u041a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438/\u0438\u043b\u0438 \u043a\u043b\u044e\u0447 API \u0443\u0436\u0435 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d.",
"invalid_key": "\u041d\u0435\u0432\u0435\u0440\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 API \u0438/\u0438\u043b\u0438 \u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.",
"no_devices": "\u0412 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b."
"no_devices": "\u0412 \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b."
},
"step": {
"user": {

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