Commit Graph

32525 Commits (402a0ea7dac4cb4f88afa1d862fee637ad1f9648)

Author SHA1 Message Date
Philip Allgaier 402a0ea7da
Fix OpenWeatherMap forecast timestamp (#45124) 2021-01-14 08:47:45 +01:00
ehendrix23 17cb071173
Bump MyQ to 2.0.14 (#45067) 2021-01-13 20:15:23 -10:00
Petro31 3ebc5d45a8
Add energy and power sensor tests & fix device_class (#45122) 2021-01-13 15:37:54 -05:00
Nikolay Vasilchuk eca6bc6a73
Starline OBD information (#37608)
* Starline OBD data

* Small fix

* Review (comments)

* Review (service description)

* Review (service method)

* starline updated to 0.1.5

* Small typo fix
2021-01-13 20:44:24 +01:00
TimothyLeeAdams 7872e6caf8
Change attribute key for Lutron cover to lutron_integration_id (#45114)
Currently, covers return "Lutron Integration ID" as a state attribute. This is inconsistent with the light, switch, and binary_sensor which return "lutron_integration_id".
2021-01-13 18:59:57 +01:00
Julien Roy 94417e3e14
Add start torrent and stop torrent service for transmission integration (#43920) 2021-01-13 17:44:57 +01:00
Tobias Sauerwein e05bb7e858
Expose selected Netatmo schedule (#45077) 2021-01-13 17:01:29 +01:00
Paulus Schoutsen 732cf47ff6
Filter some Alexa reports that are duplicate (#45093)
* Filter some Alexa reports that are duplicate

* When state changes during reporting, only report last state, not all state changes
2021-01-13 16:54:54 +01:00
Diogo Gomes 81c77942eb
Update the Utility Meter sensor status on HA start (#44765)
* fix status on HA start

* better coverage and fix

* fix test

* address review
2021-01-13 16:42:28 +01:00
Martin Hjelmare 79d37fdf12
Add zwave_js light platform tests (#45107)
* Add bulb 6 multi color device state fixture

* Add light test foundation

* Add no cover comment for todo code

* Update hs_color

* Test turn on light

* Test light turn off

* Fix brightness comparison

* Test setting same brightness

* Test setting same rgb color

* Test color temp update

* Test setting same color temp

* Add entity module to coverage calculation

* Fix typing
2021-01-13 16:28:51 +01:00
Alexei Chetroi de8f273bd0
Allow input_number entity_id as for numeric_state trigger thresholds (#45091)
* Allow input_number as limits for numeric_state trigger

* Rename threshold schema
2021-01-13 16:20:59 +01:00
Sergio Conde Gómez 83b210061d
Add config_flow and stream selection to foscam (#41429)
* Add config_flow and stream selection to foscam

* Simplify config_flow steps

* Make debug log entry more useful

* Deprecate config and platform schemas

* Simplify config loading

* Add config flow testing

* Remove unneeded CONFIG_SCHEMA deprecation

* Improve test coverage

* Unload service by tracking loaded entries

* Address comment

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-13 16:09:05 +01:00
Martin Hjelmare 3537a7c3d5
Correct zwave_js value changed callback signature (#45110) 2021-01-13 15:31:31 +01:00
rikroe 938d8be0c8
Bump bimmer_connected to 0.7.14 (#45086)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2021-01-13 15:25:28 +01:00
jjlawren 411cc6542c
Move Plex->Sonos playback to built-in service (#45066)
* Move Plex->Sonos playback service from integration to platform

* Test against 'native' Plex media_players

* Add Plex to Sonos after_dependencies

* Remove circular dependency

* Raise exceptions in failed service calls

* Add test to forward service call from Sonos

* Additional Sonos->Plex tests

* Fix docstring
2021-01-13 15:24:44 +01:00
Jacob Southard 3364e945aa
Fix HomeKit climate integration for devices with a single set point in Heat_Cool mode. (#45065)
* Check supported flags in auto mode, and add tests.

* Fix test description.
2021-01-13 15:21:32 +01:00
Jesse Hills f78b02b163
Do not try to connect to disabled ESPHome devices. (#45092) 2021-01-13 15:17:13 +01:00
J. Nick Koston ffd9c4e410
Add additional roku model to discovery (#45103) 2021-01-13 15:14:45 +01:00
badguy99 b9e4d5988f
Soma: fix battery drain issue caused by excess update requests (#45104)
* split up update and throttle update on sensor

* Update imports

* Add blank lines for isort
2021-01-13 15:14:15 +01:00
Robert Svensson 6325bc8bfe
Follow Axis library changes and improve tests (#44126) 2021-01-13 14:03:54 +01:00
ErnstEeldert ff3a1f2050
Add device class attribute to tado humidity sensor state (#45084)
* add device class attribute to humidity sensor state

* * explict return none
* use const for device class value

* removed unnecessary icon definitions
2021-01-13 13:45:11 +01:00
Alexei Chetroi ec038bc6ea
Allow any parameter of a light profile as an optional parameter (#44079)
* No code duplication for profile application

* Refactor color profile as a dataclass

* Typing

* Make color_x and color_y of a Light profile optional

* Update tests

* Make brightness field of a Light profile optional

* Transition can be of a float type

* Allow fractional transition times in light profiles

Make transition of a float type.
Allow transition to be optional with 5 column CSV files.

* Make pylint happy

* Fix dropped async_mock

* Simplify CSV row schema
2021-01-13 12:11:20 +01:00
Santobert 10bc05df00
Fix neato battery sensor not ready (#44946)
* Fix neato battery sensor not ready

* Edit available attribute

* Remove unnecessary condition
2021-01-13 10:23:16 +01:00
J. Nick Koston ac60b34d17
Roomba cleanups (#45097)
* Roomba cleanups

Remove async_step_init backwards compat

Move urls to description_placeholders.

Fix typos

* fix test

* fix fallback to manual when roomba is in the wrong state
2021-01-13 07:27:25 +01:00
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