Commit Graph

10306 Commits

Author SHA1 Message Date
Erik Montnemery
bceeaec2f8 Remove duplicated statistics rows (#61146)
* Remove duplicated statistics

* Fix misleading docstring

* Pylint knows best

* Correct test

* Oops

* Prevent insertion of duplicated statistics

* Tweak

* pylint

* Add models_schema_23.py

* Tweak
2021-12-13 14:15:36 +01:00
Allen Porter
cd001d0243 Only publish nest camera event messages once per thread and bump nest version (#61587) 2021-12-12 14:12:05 -08:00
Marcel van der Veldt
4ad90b33c9 Fix Hue transition calculation (#61581) 2021-12-12 14:11:41 -08:00
J. Nick Koston
8200101785 Fix HomeKit covers with device class window and no tilt (#61566) 2021-12-12 14:10:40 -08:00
Allen Porter
c3e72bec0a Update logic for nest media source can_play for events (#61537) 2021-12-12 14:10:20 -08:00
Marc Mueller
cbe58913ea Fix freedompro tests (#61012) 2021-12-12 14:09:45 -08:00
David F. Mulcahey
94324cebea Update HVAC action handling in ZHA climate devices (#61460)
* Update HVAC action handling in ZHA climate devices

* fix class name

* align with class name changes

* get the correct sensor entity for state assertions
2021-12-12 12:11:37 -05:00
Alexei Chetroi
997809c6c4 Refactor ZHA entity matching process (#60063)
* Group multi-matches by channels

* Group multi-matched by explicit groups

* Registryless AnalogInput and PowerConfiguration

* Refactor single cluster sensor registry

* Refactor single cluster cover and lock registry

* Refactor single cluster binary_sensor registry

* Pylint
2021-12-12 07:52:49 -05:00
J. Nick Koston
388fcac689 Reduce cpu requirements for apple_tv mdns and discovery (#61346)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2021-12-11 19:57:11 -10:00
Austin Mroczek
3198211a7f Add instant arming for totalconnect (#60156)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-12-11 15:58:12 -10:00
David F. Mulcahey
abbde8f128 Clean up state class and device class usage in ZHA (#61049)
* Clean up sensor and device class usage in ZHA

* additional cleanup

* Use EntityCategory
2021-12-11 11:51:24 -05:00
Marcel van der Veldt
0abfc90870 Fix typo in Hue device triggers - use enum value (#61498) 2021-12-11 17:12:33 +01:00
David F. Mulcahey
a17031630f Use Platform enum in ZHA (#61016) 2021-12-11 11:06:39 -05:00
J. Nick Koston
3eabd69666 Fix exception in color_rgb_to_rgbww (#61466) 2021-12-10 22:19:54 -08:00
Andre Lengwenus
74d5cbd3a9 Add events and device triggers to LCN (#58745) 2021-12-10 19:02:17 -10:00
Marcel van der Veldt
0d36b07d10 Small fix for device triggers and events on Hue integration (#61462) 2021-12-10 15:11:34 -08:00
jjlawren
6d54261322 Remove external library discovery call in Sonos (#61461)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-12-10 11:28:47 -10:00
Erik Montnemery
dc5888ab4a Correct recorder.statistics.get_last_statistics (#61421) 2021-12-10 10:09:29 -08:00
Erik Montnemery
aa36dde148 Correct rest sensor configured to generate timestamps (#61429) 2021-12-10 09:59:27 -08:00
Erik Montnemery
281b5e1c22 Speed up demo lock tests (#61425) 2021-12-10 11:13:44 +01:00
J. Nick Koston
8d483e2206 Fix flux_led discovery with older models (#61413) 2021-12-10 08:29:27 +01:00
Erik Montnemery
27d1063dec Revert "Skip duplicated data when calculating fossil energy consumption (#60599)" (#61323)
This reverts commit 159506262a.
2021-12-10 08:19:53 +01:00
Matthias Alphart
4f9d4872a7 Fix unique_id of S0 meters connected to Fronius inverters (#61408) 2021-12-09 15:35:20 -08:00
Aaron Bach
b556bd1d58 Consolidate SimpliSafe config flow forms into one (#61402) 2021-12-09 14:11:41 -08:00
Franck Nijhof
1ed490ce62 Fix date/datetime support for templates (#61088)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-09 11:43:48 +01:00
Daniel Hjelseth Høyer
4c542336d5 Add sensors to Mill local heaters (#61247)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-09 09:04:19 +01:00
Stefan Agner
a13ae85982 Introduce only_supervisor for @websocket_api.ws_require_user() (#61298) 2021-12-08 16:49:35 -08:00
epenet
c05eca1c82 Remove log flooding prevention logic from discovery info (#61243)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
alim4r
7d256f56c5 Refactor Prometheus tests (#60451)
* Removed prometheus from .coveragerc

* Update prometheus tests with handler categories

* Updated prometheus metrics to use the current registry
- don't use the registry created on import (needed for tests)

* Reset the prometheus CollectorRegistry before every test

* Update prometheus metrics generation
- Use latest registry when generating a response

* Add default collectors when resetting the registry

* Move entities to the specific prometheus test case

* Refactor body generation for prometheus tests

* Add test case for sensors without unit after rebase

* Fix prometheus tests
- Wait for events in prometheus tests
- Add workaround for demo platform dependecy conversation (aiohttp frozen router)

* Added prometheus tests for attribute metrics

* Added prometheus tests for binary_sensor

* Add prometheus test for input_boolean

* Add prometheus test for lights

* Add prometheus test for lock

* Add prometheus test for sensor fahrenheit conversion

* Fix prometheus test for input_number
2021-12-08 20:18:21 +01:00
Erik Montnemery
159506262a Skip duplicated data when calculating fossil energy consumption (#60599) 2021-12-08 10:59:26 -08:00
jjlawren
9f3a4c3617 Improve Sonos tests, begin adding coverage (#61198)
* Update entity registry handling

* Add and use fixtures to test setup via config entry

* Remove legacy redundant tests

* Remove unnecessary mock_coro

* Remove unnecessary namespace change

* Move zeroconf payload to fixture

* Begin adding Sonos to codecov

* Mock proper return value

* Revert return value for platform
2021-12-08 19:28:27 +01:00
Erik Montnemery
f30eb05870 Refactor recorder queue handling (#61161)
* Refactor recorder queue handling

* Address pylint's concerns

* Implement workaround for mypy bug

* Address review comments
2021-12-08 16:54:26 +01:00
Thomas Dietrich
bbe6d3c9ae Statistics refactor testcases in async pytest style (#60935)
* Implement optional manually defined uniqueid

* Fix test case via mocked environment

* Refactor testcases

* Fix missing awaits

* Revert order changes, reduce use of block command

* Tidy up mocked time testcases
2021-12-08 16:53:18 +01:00
Erik Montnemery
5169ee69c7 Attempt to fix flaky prometheus test (#61242) 2021-12-08 16:08:02 +01:00
epenet
9f15e7dcf4 Fix flaky tests around frame helper (#61179)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:50:56 +01:00
Paulus Schoutsen
b7539fc0de Fix islamic prayer times timestamp sensor (#61207) 2021-12-07 23:39:27 -08:00
Daniel Hjelseth Høyer
8cee47072d Add local access for Adax (#60019) 2021-12-07 16:48:16 -10:00
J. Nick Koston
6b70bd7495 Fix uncaught exception in bond config flow (#61184) 2021-12-07 17:20:38 -08:00
Alberto Geniola
b0affe7bfb Elmax integration (#59321)
* Add elmax integration.

* Run hassfest and generate requirements_all

* Remove secondary platforms from elmax integration as per first component integration.

* Move ElmaxCoordinator and ElmaxEntity into external file
Linting review

* Remove useless variables

* Fix wrong indentation.

* Remove unecessary platforms.

* Remove unnecessary attributes from manifest.

* Rely on property getters/setters rathern than private attribute from parent.
Update internal entity state just after transitory state update.

* Update homeassistant/components/elmax/const.py

Reference Platform constant

Co-authored-by: Marvin Wichmann <marvin@fam-wichmann.de>

* Update username/password values

Rely on already-present templating constants

Co-authored-by: Marvin Wichmann <marvin@fam-wichmann.de>

* Add missing constant import.

* Remove unnecessary test_unhandled_error() callback implementation.

* Add common.py to coverage ignore list.

* Improve coverage of config_flow.

* Rename the integration.

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Fix reauth bug and improve testing.

* Refactor lambdas into generators.

Co-authored-by: Marvin Wichmann <marvin@fam-wichmann.de>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2021-12-07 22:42:55 +01:00
Marcel van der Veldt
7c7df5bb51 Change check for existence of options flow (#61147)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-12-07 12:50:34 -08:00
einarhauks
dced4d4542 Display energy in wh instead of kWh (#61169) 2021-12-07 11:33:24 -08:00
Allen Porter
200a5c7e05 Fix flaky tests with unsynchronized stream available assertions (#61167)
Remove assertions that are not guaratuneed to be safe depending
on the state of the background worker. This leaves in the state
check for the keepalive case which does have some synchronization
already.
2021-12-07 07:40:36 -08:00
Tim Rightnour
489d85d862 Add Onewire diagnostic and config switches and binary_sensors (#59309)
* Onewire: Add diagnostic and config switches and binary_sensors
This commit adds diagnostic and config switches and binary_sensors to
the HobbyBoards devices.  With these, the user will be able to configure
those devices, without having to run owwrite/owread commands outside
of HA.

* Address review from @epenet

* Add HB_HUB to DEVICE_SUPPORT_OWSERVER

* Device class and entity category enums

* Fixup merge breakage

* Remove duplicate lines
2021-12-07 13:59:43 +01:00
Tobias Sauerwein
45c463b61c Fix Netatmo climate issue (#61154)
Signed-off-by: cgtobi <cgtobi@gmail.com>
2021-12-07 13:56:31 +01:00
Stefan Agner
f0006b92be Allow to lock SQLite database during backup (#60874)
* Allow to set CONF_DB_URL

This is useful for test which need a custom DB path.

* Introduce write_lock_db helper to lock SQLite database

* Introduce Websocket API which allows to lock database during backup

* Fix isort

* Avoid mutable default arguments

* Address pylint issues

* Avoid holding executor thread

* Set unlock event in case timeout occures

This makes sure the database is left unlocked even in case of a race
condition.

* Add more unit tests

* Address new pylint errors

* Lower timeout to speedup tests

* Introduce queue overflow test

* Unlock database if necessary

This makes sure that the test runs through in case locking actually
succeeds (and the test fails).

* Make DB_LOCK_TIMEOUT a global

There is no good reason for this to be an argument. The recorder needs
to pick a sensible value.

* Add Websocket Timeout test

* Test lock_database() return

* Update homeassistant/components/recorder/__init__.py

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

* Fix format

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2021-12-07 13:16:24 +01:00
Erik Montnemery
af2e95d891 Guard against missing states in Alexa state updates (#61152) 2021-12-07 12:44:50 +01:00
Erik Montnemery
5161126b58 Bump hatasmota to 0.3.1 (#61120) 2021-12-07 08:07:31 +01:00
epenet
b8b4855b8e Prevent log flooding in frame helper (#61085)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-06 15:26:31 -08:00
Marcel van der Veldt
9e6e9774d1 Remove colon from default entity name in Hue integration (#61118) 2021-12-06 15:17:17 -08:00
epenet
97d292133f Revert "Add Open-Meteo integration (#60379)" (#61130)
This reverts commit d802f3a82f.
2021-12-06 23:35:14 +01:00