Commit Graph

32501 Commits (eebd0d333e158f54a500cbb2fefbc28a0e793242)

Author SHA1 Message Date
Allen Porter eebd0d333e
Clear cached nest event images after expiration (#44956)
* Clear cached nest event images after expiration

* Don't share removal cleanup with alarm cleanup

Don't share code across these functions since it would require a dummy timestamp values that is unnecessary.

* Increase test coverage on sdm camera remove

* Update homeassistant/components/nest/camera_sdm.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-12 22:08:59 -08:00
Paulus Schoutsen 82746616fa
Cloud: Add web socket API to pick default TTS language (#45064)
* Allow picking default TTS language

* Fix test

* Fix coroutine function

* Improve test coverage

* Remove stale import

* Clean up hass

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-13 00:05:30 +01:00
Paulus Schoutsen 4e71be852a
Bump Z-Wave JS to 0.7.1 (#45080) 2021-01-12 16:18:06 +01:00
Charles Garwood be2aba6c52
Fix docstring in zwave_js switch test (#45076) 2021-01-12 14:29:12 +01:00
Joakim Sørensen 8ce32d67f9
Fallback to tag for any AfterShip tracking that have no checkpoints (#45053) 2021-01-12 10:33:14 +01:00
Paulus Schoutsen e83ced6737
Add name to ignored entries (#45051)
* Add name to ignored entries

* Fix test
2021-01-12 09:26:20 +01:00
Charles Garwood f312b87a3f
Add switch platform to zwave_js (#45046) 2021-01-11 18:40:39 -05:00
Philip Allgaier cad2fa89ed
Default `input_datetime` to current date (#45052) 2021-01-11 23:45:58 +01:00
Philip Allgaier bade98624d
Fix tests for input_datetime (#45055) 2021-01-11 23:13:16 +01:00
J. Nick Koston 13cdf0ba63
Cleanups for somfy_mylink (#45026)
* Cleanups for somfy_mylink

* Use the target/unique_id to configure reverse

* Simplify options flow

* Various code review cleanups

* Deprecate YAML

* revert get change

* revert get change

* add note about empty response

* move CONF_DEFAULT_REVERSE out of loop

* Update homeassistant/components/somfy_mylink/config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Ensure we deepcopy options

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-11 10:10:02 -10:00
Paulus Schoutsen f19b72ea02
Drop awarecan from codeowners (#45049) 2021-01-11 17:58:59 +01:00
Simone Chemelli bc2c7b2d48
Add Shelly RGB devices management (#43993)
* Add support for RGB devices

* White value handling

* Fixed logic for some devices (ColorTemp, White, Kelvin limits)

* Code cleanup

* Moved func from utils to light

* Fix for DUO

* Added "Optional" to properties that need it

* Code more understandable

* Applied code review suggestions

* Applied code review suggestions

* Updated logic to always show all available options
2021-01-11 16:47:49 +01:00
Shay Levy e3f38942cc
Add 100% tests coverage for Shelly cover and switch platforms (#45001) 2021-01-11 16:45:06 +01:00
Martin Hjelmare d270f9515b
Add zwave_js init module tests (#45048)
* Add entry setup and unload test

* Test home assistant stop

* Test on connect and on disconnect

* Test client connect timeout

* Test ready node added

* Test non ready node added

* Test existing node not ready

* Test device registry state

* Add common test tools module

* Add existing ready node test

* Include init module in coverage calculation

* Clean docstrings
2021-01-11 16:05:11 +01:00
Erik Montnemery d60fc0de38
Add availability_mode "all" and "any" to MQTT entities (#44987)
* Add availability_mode "all" to MQTT entities

* Add availability mode any
2021-01-11 16:04:22 +01:00
J. Nick Koston 74e7f7c879
Update roomba config flow to walk users through pairing (#45037)
* Update roomba config flow to walk users though pairing

* Remove YAML support

* adjust tests

* increase cover

* pylint

* pylint
2021-01-11 14:46:54 +01:00
J. Nick Koston eb5f3b282b
Mark YAML support for August deprecated (#45039) 2021-01-11 14:40:32 +01:00
J. Nick Koston 38a5f25b59
Fix vacuums that do not support start with homekit (#45030)
* Fix vacuums that do not support start with homekit

* fix tests
2021-01-11 14:38:42 +01:00
Allen Porter 65e3661f88
Repair flaky and broken stream tests in test_hls.py, and turn back on (#45025)
* Unmark tests as flaky (though still flaky)

This put tests into the broken state where they are flaky and do not yet pass

* Fix bug in test_hls_stream with incorrect path

* Enable and de-flake HLS stream tests

Background: Tests encode a fake video them start a stream to be decoded. Test
assert on the decoded segments, however there is a race with the stream worker
which can finish decoding first, and end the stream which ereases all buffers.

Breadown of fixes:
- Fix the race conditions by adding synchronization points right before the
  stream is finalized.
- Refactor StreamOutput.put so that a patch() can block the worker
  thread.  Previously, the put call would happen in the event loop which was
  not safe to block. This is a bit of a hack, but it is the simplist possible
  code change to add this synchronization and arguably provides slightly better
  separation of responsibilities from the worker anyway.
- Fix bugs in the tests that make them not pass, likely due to changes
  introduced while the tests were disabled
- Fix case where the HLS stream view recv() call returns None, indicating
  the worker finished while the request was waiting.

The tests were previously failing anywhere from 2-5% of the time on a lightly
loaded machine doing 1k iterations.  Now, have 0% flake rate.  Tested with:
$ py.test --count=1000 tests/components/strema/test_hls.py
2021-01-11 14:34:45 +01:00
Charles Garwood ed4e8cdbc5
Bump zwave-js-server-python to 0.7.0 (#45045) 2021-01-11 14:34:08 +01:00
J. Nick Koston af21893652
Remove safe mode from HomeKit (#45028)
Safe mode was added to work around a race condition where
the mdns announcment was sent too early and would cause
pairing to fail. Since this has been corrected in
HAP-python, there is no longer a need to have
safe mode.
2021-01-11 14:26:09 +01:00
Paulus Schoutsen e584902b8b
Remove empty schema (#45044) 2021-01-11 14:25:09 +01:00
Stefan Agner 54064b4010
Increase timeout to avoid killing the core during shutdown (#45029)
Stopping the core goes through several stages, which can take up to
120s, 60s and 30s respectively. However, if shutdown is taking longer
than 60s overall, s6 isn't patient and kills the core:
Jan 10 23:56:58 homeassistant eb034fca9c7d[407]: s6-svwait: fatal: timed out
Jan 10 23:56:58 homeassistant eb034fca9c7d[407]: [s6-finish] sending all processes the TERM signal.
Jan 10 23:57:01 homeassistant eb034fca9c7d[407]: [s6-finish] sending all processes the KILL signal and exiting.

This is most of the time not a problem since shutdown is quicker than
that.

However, increasing the timeout is especialy useful to debug cases when
an event is hanging, since the core will point it out after its timeout
elapsed.

Set the timeout to 220s, which is all core timeouts plus 10s grace time.
2021-01-11 11:24:02 +01:00
Stefan Agner ab25c5a2bd
Shutdown asyncio http server within 10 seconds (#45033)
If there are open requests, the http server waits up to 60 seconds.
However, some requests (such as the Reboot button) seems to keep a
connection open and needlessly slow down the reboot process:

```
Jan 11 00:52:54 homeassistant eb034fca9c7d[404]: 2021-01-11 00:52:54 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_stop[L]>
Jan 11 00:52:54 homeassistant eb034fca9c7d[404]: 2021-01-11 00:52:54 DEBUG (MainThread) [homeassistant.helpers.restore_state] Dumping states 111
Jan 11 00:52:54 homeassistant eb034fca9c7d[404]: 2021-01-11 00:52:54 DEBUG (MainThread) [homeassistant.helpers.restore_state] Dumping states
Jan 11 00:52:54 homeassistant eb034fca9c7d[404]: 2021-01-11 00:52:54 INFO (MainThread) [homeassistant.components.websocket_api.http.connection] [281473359593728] Connection closed by client
Jan 11 00:52:56 homeassistant eb034fca9c7d[404]: 2021-01-11 00:52:56 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection] [281473359593728] Disconnected
Jan 11 00:53:54 homeassistant eb034fca9c7d[404]: 2021-01-11 00:53:54 DEBUG (MainThread) [homeassistant.core] Waited 60 seconds for task: <Task pending name='Task-585' coro=<async_setup.<locals>.stop_server() running at /usr/src/homeassistant/homeassistant/components/http/__init__.py:228> wait_for=<_GatheringFuture pending cb=[<TaskWakeupMethWrapper object at 0xffff9f112f70>()]> cb=[_wait.<locals>._on_completion() at /usr/local/lib/python3.8/asyncio/tasks.py:518]>
...
```
2021-01-11 09:36:14 +01:00
Charles Garwood d68fdbc283
Add zwave_js integration (#45020)
* Run zwave_js scaffold (#44891)

* Add zwave_js basic connection to zwave server (#44904)

* add the basic connection to zwave server

* fix name

* Fix requirements

* Fix things

* Version bump dep to 0.1.2

* fix pylint

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Bump zwave-js-server-python to 0.2.0

* Use zwave js server version check instead of fetching full state (#44943)

* Use version check instead of fetching full state

* Fix tests

* Use 0.3.0

* Also catch aiohttp client errors

* Update docstring

* Lint

* Unignore zwave_js

* Add zwave_js entity discovery basics and sensor platform (#44927)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Complete zwave_js typing (#44960)

* Type discovery

* Type init

* Type entity

* Type config flow

* Type sensor

* Require typing of zwave_js

* Complete zwave_js config flow test coverage (#44955)

* Correct zwave_js sensor device class (#44968)

* Fix zwave_js KeyError on entry setup timeout (#44966)

* Bump zwave-js-server-python to 0.5.0 (#44975)

* Remove stale callback signal from zwave_js (#44994)

* Add light platform to zwave_js integration (#44974)

* add light platform

* styling fix

* fix type hint

* Fix typing

* Update homeassistant/components/zwave_js/const.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/entity.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/entity.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/entity.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/entity.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/entity.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* color temp should be integer

* guard Nonetype error

* Update homeassistant/components/zwave_js/light.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/zwave_js/light.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* some fixes after merging

* add additional guards for None values

* adjustments for rgb lights

* Fix typing

* Fix black

* Bump zwave-js-server-python to 0.6.0

* guard value updated log

* remove value_id lookup as its no longer needed

* fiz sending white value

* Update homeassistant/components/zwave_js/light.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add zwave_js test foundation (#44983)

* Exclude text files from codespell

* Add basic dump fixture

* Add test foundation

* Fix test after rebase

* Exclude jsonl files from codespell

* Rename fixture file type to jsonl

* Update fixture path

* Fix stale docstring

* Add controller state json fixture

* Add multisensor 6 state json fixture

* Update fixtures

* Remove basic dump fixture

* Fix fixtures after library bump

* Update codeowner

* Minor cleanup Z-Wave JS (#45021)

* Update zwave_js device_info (#45023)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-01-11 00:08:25 +01:00
Ryan Fleming 1402e7ae56
Use the camera UUID as the entity unique id (#44937) 2021-01-10 23:23:32 +01:00
Philip Allgaier 4de9f5194f
Include current version in updater log output (#45022) 2021-01-10 21:37:55 +01:00
J. Nick Koston f5b389faa8
Warn users when their HomeKit configuration may be unstable (#44999) 2021-01-10 09:38:41 -10:00
J. Nick Koston 4b54694c5c
Add config flow for somfy_mylink (#44977)
* Add config flow for somfy_mylink

* fix typo
2021-01-10 20:24:22 +01:00
J. Nick Koston b450d4c135
Improve unifi performance with many devices (#45006)
With 250 clients, there were about 18000 timers updated every
minute. To avoid this, we check which entities should be set
to not_home only once every second.
2021-01-10 20:12:21 +01:00
Olivier Cloirec 707a8e62f9
Add stop support to openzwave (mqtt) cover (#44622)
* feat: add stop to openzwave (mqtt) cover

* Fix isort and black linter

* Remove supported_features for cover.

As suggested by @MartinHjelmare, not needed anymore because base class
implementation is sufficient.

https://github.com/home-assistant/core/pull/44622#discussion_r549854542

* Make a simpler version depending on idempotency

qt-openzwave already implements idempotency, see:
77e414217f/qt-openzwave/source/qtozwvalueidmodel.cpp (L180)

We can use it and trigger button release anywhen.

* Clean up

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-01-10 18:05:52 +01:00
Allen Porter a73a82e381
Improve nest client error handling using newest library (#44998) 2021-01-09 17:52:30 -08:00
Josef Schlehofer f240106189
Upgrade requests to 2.25.1 (#44989) 2021-01-09 20:02:50 +01:00
Erik Montnemery 248802efd5
Add MQTT base entity (#44971) 2021-01-09 17:46:53 +01:00
ehendrix23 eabe757e20
Bump pymyq to 2.0.13 (#44961) 2021-01-09 15:29:48 +01:00
Martin Hjelmare 8b72324ae6
Add zwave to ozw migration (#39081)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2021-01-09 15:23:03 +01:00
bchastain 982c42e746
Add pressure forecast to HA weather entity model (#44965) 2021-01-09 14:52:49 +01:00
Erik Montnemery 6dd6d9b368
Deduplicate MQTT entity discovery code (#44970) 2021-01-09 14:37:33 +01:00
Erik Montnemery 2d9eb25142
Fix parameters when toggling light (#44950) 2021-01-09 01:10:47 +01:00
Erik Montnemery b85efd343f
Move MQTT entity helpers to separate file (#44838)
* Move MQTT entity helpers to separate file

* Fix imports

* Update MQTT number

* Review comments

* Fix formatting
2021-01-09 00:47:17 +01:00
Ville Skyttä 3a88a4120e
Helpers type hint improvements (#44964) 2021-01-09 00:08:34 +01:00
Ville Skyttä 3569d92385
Remove script/test (#44967)
It's still referencing tox py36, which has been obsolete for over a
year.
2021-01-08 23:58:39 +01:00
Diogo Gomes e3c1281616
Add MQTT Number (non optimistic) (#44883)
* non optimistic

* test restored state

* ups

* review

* Ensure the entity is not in optimistic mode

Co-authored-by: Erik Montnemery <erik@montnemery.com>

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-01-08 23:43:14 +01:00
Tobias Sauerwein 8fa62329a4
Fix Netatmo climate boost for valves (#44957) 2021-01-08 18:41:31 +01:00
Sergio Oller 905100a189
Disambiguate Supervisor HTTPUnauthorized on user/password validation (#44940)
* Disambiguate HTTPUnauthorized on user/password validation

The HA core API usually returns 401 when the request does not
have proper authentication tokens or they have expired.

However the user/password validation endpoint may also return
401 when the given user/password is invalid.

The supervisor is currently unable to distinguish both scenarios,
and it needs to.

See https://github.com/home-assistant/supervisor/issues/2408

* Return 404 if user& password are not found/valid

* Fix test for invalid user/password
2021-01-08 17:28:22 +01:00
J.P. Hutchins 793adb7f40
Add torrent id to Transmission events (#44187)
* Fire event after object update; clarify code across related methods

* Change var to torrent, clarity

* Add typehints,  _ prefix private attributes
2021-01-08 07:53:47 -08:00
Joakim Sørensen d99bc99d9b
Prefix versions in system health (#44921)
* Prefix versions in system health

* Adjust test

* Update homeassistant/components/hassio/strings.json
2021-01-08 16:03:06 +01:00
Ottavio Campana 58195c64b7
Fix media renderers without volume control (#44874)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-08 14:15:54 +01:00
J. Nick Koston 7c93a11aba
Fix wait_template incorrectly matching falsey values (#44938) 2021-01-08 13:07:50 +01:00
Fabian Affolter c457ea854c
Upgrade youtube_dl to 2021.01.03 (#44942) 2021-01-08 11:59:30 +01:00