Commit Graph

15767 Commits (fa308d8e10f2901ce1168e57a31b23da99fe0f72)

Author SHA1 Message Date
Thijs W e3cad8baac
Migrate ssdp to config_flow for frontier_silicon (#89496)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-28 16:06:21 -10:00
J. Nick Koston 9dc936f8b9
Add sqlalchemy LRUs to the profiler lru service (#90428) 2023-03-28 12:02:35 -10:00
J. Nick Koston f60e9c71a2
Make bootstrap cancelation safe (#90420) 2023-03-28 11:22:41 -10:00
Erik Montnemery e22618a555
Write protect entity options (#90185) 2023-03-28 22:56:51 +02:00
J. Nick Koston 0550b17d54
Rework recorder filters to avoid caching mistakes (#90419) 2023-03-28 22:51:46 +02:00
Jan Bouwhuis 93e1cd8dd8
Add header with parsed date to imap event data (#90422) 2023-03-28 22:50:25 +02:00
starkillerOG e9925f6062
Check webhook url is reachable in Reolink (#89585)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-28 22:46:59 +02:00
Jan Bouwhuis 24d0d15f38
Implement imap_content event for imap integration (#90242) 2023-03-28 21:02:43 +02:00
J. Nick Koston d21433b6af
Ensure filters are generated inside the lambda locks (#90418) 2023-03-28 20:50:10 +02:00
Aaron Godfrey 9ccd43e5f1
Add DataUpdateCoordinator to the Todoist integration (#89836)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-28 18:57:24 +02:00
TheJulianJES 89a3c304c2
Refactor ZHA binary sensors to read from zigpy cache (#89481)
* Construct binary sensor state from zigpy cache (WIP)

* Workaround zha-quirks issue where "MotionWithReset" quirks don't update attribute cache (WIP)

zha-quirks currently has an issue where the ZONE_STATE attribute is updated (when the zone_STATUS changes).
https://github.com/zigpy/zha-device-handlers/pull/2231 is a proper fix for this.

For now, we just update the attribute cache when we get the "zone status update notification" command.

This wasn't noticed before, as the "attribute report signal" was sent from the `cluster_command()` method and the used the provided attribute (in the signal) to update the `_state` value in the binary sensor class.
As we just tell HA to write state again when we get an attribute report now, the ZONE_STATUS attribute is read now (and needs to be correct).

* Use parse() method of main class for IasZone entity (with stripped bits)

* Change wording in comment, remove explicitly sending attr signal

(This comment should be removed/changed later anyway)

* Remove note

* Get zone_status attribute id with zigpy

* Remove `security.` prefix for `IasZone` import

`AceCluster` was already directly imported and `IasZone` is too now for getting the attribute id

* Store full zone status attribute in cache

* Check that non-alarm bits are ignored in IasZone sensor test

* Re-enable occupancy binary sensor test

This test seems to work fine and I don't see any reason why it was commented out for a while

* Fix cached read mix-up for `zone_status`/`zone_state`

This allows cached reads for `zone_state` (enrolled or not), but forces a new read for `zone_status` (alarm or not).
2023-03-28 12:39:10 -04:00
DerEnderKeks 9fecdddf01
Don't use force_update for Tasmota sensors (#85943)
* fix: don't use force_update for Tasmota sensors

* Update binary_sensor.py

* Update test_binary_sensor.py

* Update test_sensor.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-28 17:14:52 +02:00
Michał Huryn 0a51914740
Blebox cover tilt (#85515)
* feature: added tilt for shutterBox

* test: include tilt in tests
2023-03-28 17:11:48 +02:00
Joakim Sørensen d907bd2ca3
Add connected relayer region to system health (#90410) 2023-03-28 17:09:59 +02:00
Wesley Vos 478a1d5e9a
Add periodically resetting meter option to utility meter (#88446)
* Use last valid state if meter is not periodically resetting

* Fix unload of entry, used during options flow submit

* Adjustments based on code review

* Move DecimalException handling to validation method

* Add test for invalid new state in calculate_adjustment method
2023-03-28 17:09:20 +02:00
ehendrix23 e45eab600f
Add has_value function/test to Jinja2 template (#79550) 2023-03-28 17:04:29 +02:00
Dave T f081fa8feb
Add basic tests for temper USB temperature sensor integration (#80220)
* Add basic tests

* Updated requriements_test_all.txt

* Update temperusb version

* Add type hints

Co-authored-by: Christian Knittl-Frank <lcnittl@gmail.com>

* Add type hints

Co-authored-by: Christian Knittl-Frank <lcnittl@gmail.com>

* Correct typo in type hint

* Fix isort

* Fix requirements_test_all.txt

---------

Co-authored-by: Dave T <davet2001@users.noreply.github.com>
Co-authored-by: Christian Knittl-Frank <lcnittl@gmail.com>
2023-03-28 16:50:59 +02:00
Robert Hillis 866518c5a0
Add tests to Lidarr (#79610)
* Add tests to Lidarr

* fix js files

* take out the trash

* fix 3.9

* uno mas

* fix fixture

* ruff

* Update const.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-28 16:49:32 +02:00
Guido Schmitz a26d95ec02
Add switch tests for devolo_home_control (#80154) 2023-03-28 16:45:06 +02:00
epenet 02e2e4d039
Add rest encoding test (#90404)
* Add rest encoding test

* docstring
2023-03-28 16:29:24 +02:00
Erik Montnemery b4775ed2eb
Don't rely on the demo integration in voice_assistant tests (#90405) 2023-03-28 15:22:48 +02:00
Petro31 2123600039
Add minutely updates to relative_time and today_at template functions (#86815)
* add minutely update

* fix mypy
2023-03-28 15:10:28 +02:00
Nathan Spencer cdefc48fcd
Add panel brightness control for Litter-Robot 4 (#86269)
* Add panel brightness control for Litter-Robot 4

* Use translation_key

* Fix test
2023-03-28 15:07:09 +02:00
Renat Sibgatulin 091932c3ac
Improve airq test coverage (#90192)
* Add a missing test for aborting with "already_configured"

Test that config_flow aborts with "already_configured" when the
integration has already been configured

* Don't copy test data

Since #90232 is merged, it is no longer needed

* Split the initialisation into two steps, as it should be
2023-03-28 14:59:03 +02:00
Erik J. Olson d228df6d81
Fix Notify Group payload data mis-merge (#90253)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-03-28 14:56:10 +02:00
Martin Hjelmare 29645d5820
Remove mysensors ir switch (#90403) 2023-03-28 13:39:32 +02:00
Martin Hjelmare e6c94d7854
Remove mysensors notify (#90402) 2023-03-28 13:05:09 +02:00
Olivier Ouellet 1c465b5ad0
Add encoding configuration setting to REST and Scape (#90254)
* Create new config parameter for default character encoding if no character encoding is declared

* Changes suggested by gjohansson-ST

* Added config flow for scape

* Removed "character"

* Change to create_async_httpx_client

* Remove CONF_ENCODING from Scrape SENSOR_SCHEMA

* Debug scrape test
2023-03-28 12:42:31 +02:00
Erik Montnemery 3c3860c923
Make OTBR use same channel as ZHA (#88546) 2023-03-28 12:34:25 +02:00
Allen Porter ae41547b73
Update calendar to always request start/end dates in local time rather than UTC (#90386) 2023-03-28 12:25:44 +02:00
epenet 96dae587a9
Fix ridwell tests (#90401) 2023-03-28 11:54:16 +02:00
J. Nick Koston 2fd872b253
Speed up profiler lru test (#90395) 2023-03-28 11:02:08 +02:00
Raman Gupta c51ed4b328
Redact secret zwave values in diagnostics (#90389)
* redact secret zwave values from diagnostics

* shhrink

* rename
2023-03-28 09:59:01 +02:00
Jan Bouwhuis 14ffda9758
Remove dependency on async_setup from mqtt integration (#87987)
* Remove async_setup from mqtt integration

* Final update common tests

* Related tests init

* Related tests diagnostics

* Related tests config_flow

* Cleanup and correct test

* Keep websockets_api commands in async_setup
2023-03-28 09:37:07 +02:00
G Johansson 706e8d5612
Add product calculation to Group sensor (#87373)
* Group product

* config flow
2023-03-28 09:35:09 +02:00
Aaron Godfrey 8b7594ae08
Look up todoist collaborators only when adding new task (#87957)
* Look up collaborators only when adding new task.

Also fixed a few api call arguments that were incorrect. The `labels`
key should have been a list of strings and the `assignee` key should
have been `assignee_id`.

* Add missing type in test.

* Remove print
2023-03-28 09:33:32 +02:00
Aaron Bach ff135ecdc6
Add a calendar entity to Ridwell (#88108)
* Subclass a `DataUpdateCoordinator` for Ridwell

* Add a calendar entity to Ridwell

* Simpler unique ID

* Fix tests

* Docstring
2023-03-28 09:31:36 +02:00
Joakim Plate 0666a4750c
Add re-auth support to philips_js (#88774)
* Add re-auth support to philips_js

* Adjustments from review

* Don't allow duplicate entries for now
2023-03-28 09:30:42 +02:00
Erik Montnemery 586471b5a9
Improve threshold binary sensor (#88978)
Improve threshold sensor
2023-03-28 09:11:13 +02:00
Mark Adkins 38f3b9f165
Add SharkIQ EU region support (#89349)
* SharkIQ Dep & Codeowner Update

* Update code owners

* Add EU Region Support

* Update Config Flow Tests

* Standardize Region Comparison Strings

* Add Translation Support to Region Selector

* Fix Validation Tests
2023-03-28 08:48:32 +02:00
Cosmin Luță 8807878529
Add Mikrotik WifiWave2 (#89711)
* Add support for wifiwave2

* Add test for wifiwave2
2023-03-28 08:46:16 +02:00
mkmer b399e5c8b7
Handle uncaught exceptions during update in Aladdin_connect (#89889)
* Handle uncaught errors during update

* Remove unnecssary patch

* Update tests/components/aladdin_connect/test_cover.py

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

* Update tests/components/aladdin_connect/test_cover.py

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

* Remove unasserted statement

* Blocking is True - one more

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-28 08:45:10 +02:00
Maciej Bieniek 33fef5592f
Refactor GIOS sensor platform (#89389) 2023-03-28 08:36:42 +02:00
J. Nick Koston dc37d92197
Add lru stats to the profiler integration (#90388) 2023-03-28 08:34:56 +02:00
Matthias Alphart 3dd3cb195f
Set default value for some Fronius entities (#89475) 2023-03-28 08:23:53 +02:00
Renat Sibgatulin e27d3c9523
Improve airq handling of DeviceInfo (#90232)
* Reduce data sharing between ConfigFlow and DataUpdateCoordinator

Instead of fetching device information from the device once in
`ConfigFlow` and then piping it through in `ConfigEntry.data`,
only use as much as needed in `ConfigFlow.async_step_user`, then fetch
again in `AirQCoordinator._async_update_data` if a key is missing.

Additionally, factor `AirQCoordinator` out into a sumbodule.

Add a simple test for `AirQCoordinator.device_info` update.

Positive side effect: `AirQCoordinator.device_info` is
updated explicitly, instead of dumping the entire content of (a fully
compatible) `TypedDict`, retrieved from `aioairq`.

* Remove tests ill-suited to this PR

`test_config_flow.test_duplicate_error` slipped through by mistake,
while `test_coordinator.test_fetch_device_info_on_first_update` may need
a more thoroughly suite of accompanying tests

* Ignore airq/coordinator.py

...newly separated from airq/__init__.py, that's already in this list

* Reorder files alphabetically
2023-03-28 08:18:47 +02:00
G Johansson cb6d384dba
Workday cleanup (#90267)
* clean binary sensor

* fix const

* clean sensor

* Fix tests

* Clean up

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-03-27 23:11:49 +02:00
Jonas Bergler 9f04c23414
Support toggling debug logging for custom components (#90340)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-03-27 09:40:58 -10:00
G Johansson 96698813ef
Cleanup command_line (#90268)
* Cleanup command_line

* Fix ipv6 resolver

* Fix fix

* Fix tests

* Align states
2023-03-27 21:19:09 +02:00
Erik Montnemery 506a916a13
Add reauth flow to dormakaba dkey (#90225) 2023-03-27 08:37:31 -10:00
Erik Montnemery f84651b14e
Improve tts test coverage (#90370) 2023-03-27 20:00:54 +02:00
Franck Nijhof b033232b06
Filter out ASCII tab or newline from input URLs (#90348) 2023-03-27 13:49:40 -04:00
javicalle f4fda55405
Fix `quirk_class_validator` in ZHA unit tests (#90140)
* Fix `quirk_class_validator`

Fix the `quirk_class_validator` for quirks with more than 1 module level

* fix black

* Shorten `quirk_cls` in `clss`

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

* Update comment

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2023-03-27 11:57:40 -04:00
Erik Montnemery a91aef9d52
Rewrite tts tests (#90355) 2023-03-27 14:01:17 +02:00
epenet c193402ba7
Remove incorrect ignore in pylint plugin (#90024)
* Remove incorrect ignore_missing_annotations

* Allow tuple[int, int] in hs_color

* Adjust notify targets

* Always check for return type inheritance

* Adjust tests

* Revert "Always check for return type inheritance"

This reverts commit 3528742adf98edc6481f2c954c032ace881e1d6e.

* Revert "Allow tuple[int, int] in hs_color"

This reverts commit d51c1731eff3d59b9e94e7a7e914933ceaf8e34f.

* Revert "Adjust notify targets"

This reverts commit 4cba77a7309dc89980e29d6d5b9107d9e55f7070.
2023-03-27 13:53:14 +02:00
Raman Gupta c11a3881af
Bump zwave-js-server-python to 0.47.0 (#90212) 2023-03-27 12:25:04 +02:00
Jan Bouwhuis 5b3c57ff1e
Add option flow for imap integration (#89914)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-27 11:47:22 +02:00
epenet 8c519e1abb
Use SnapshotAssertion in gree climate tests (#90339) 2023-03-27 10:01:39 +02:00
G Johansson 624860da0e
Remove deprecated platform yaml in Scrape (#90272)
* Deprecate platform yaml

* typing

* DiscoveryInfoType
2023-03-27 08:05:30 +02:00
Paulus Schoutsen c3717f8182
Clean up voice assistant integration (#90239)
* Clean up voice assistant

* Reinstate auto-removed imports

* Resample STT audio from 44.1Khz to 16Khz

* Energy based VAD for prototyping

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2023-03-26 21:41:17 -05:00
J. Nick Koston 7098debe09
Fix sql doing I/O in the event loop at startup (#90335)
* Fix sql doing I/O in the event loop

* Fix sql doing I/O in the event loop

* no test query on main db

* fix mocking because it was targeting the recorder
2023-03-26 21:02:24 -04:00
epenet c06ec1f78f
Improve onewire test coverage (#90184) 2023-03-26 23:46:52 +02:00
Allen Porter fa35867765
Bump ical to 4.5.1 and set PRODID for home assistant in local calendar ics (#90291) 2023-03-26 23:00:45 +02:00
Aaron Godfrey 745df277a0
Fix Todoist end date for all day event (#89837) 2023-03-26 22:08:36 +02:00
Michael 45262c6114
Implement config flow for nextcloud (#89396)
* implement config flow

* add tests

* fix hassfest and requirements

* abort import on connection error

* add add_suggested_values_to_schema

* mock async_setup_entry

* revert code owner change

* fix try connect in config flow

* add device info

* allow multiple instances

* fix import in config flow

* remove custom scan interval from coordinator

* applay suggestions

* apply suggestions

* take over ownership from @meichthys

* cleanup import data before passing to user step

* apply suggestions to tests

* add untested files to .coveragerc
2023-03-26 21:14:17 +02:00
Alexey Baturin 89355e0879
Add WLED IP as a sensor (#90241)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-26 20:03:03 +02:00
epenet c075dac916
Fix pylint plugin for tuple[float, float] returns (#90047) 2023-03-26 19:54:21 +02:00
epenet a036e31495
Use SnapshotAssertion in gree switch tests (#90222) 2023-03-26 19:51:48 +02:00
Niels Perfors 1baadc1d09
Update Verisure package to 2.6.1 (#89318)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: RobinBolder <33325401+RobinBolder@users.noreply.github.com>
Co-authored-by: Tobias Lindaaker <tobias@thobe.org>
2023-03-26 19:32:25 +02:00
epenet 6e92dac61f
Adjust pylint plugin for return type inheritance (#90046) 2023-03-26 18:37:26 +02:00
rikroe bec7bbeb92
Use SnapshotAssertion in bmw_connected_drive tests (#90128) 2023-03-26 16:57:19 +02:00
epenet 69a46d4002
Adjust pylint plugin for components fixtures (#90217)
* Adjust pylint plugin for components fixtures

* Adjust components

* Use MagicMock

* Adjust

* Use None
2023-03-26 15:21:19 +02:00
epenet e0ec3488d3
Adjust IntFlag handling in syrupy (#90223) 2023-03-26 14:20:05 +02:00
G Johansson e8f3b9c09a
Remove Volvooncall integration yaml import (#90288)
Depr yaml import
2023-03-26 09:42:38 +02:00
G Johansson b3f3f234c6
Remove pushbullet platform yaml import (#90285)
Depr pushbullet yaml
2023-03-26 09:40:07 +02:00
G Johansson 92beb48a41
Add sensor platform to Sun (#81045)
* Sun sensor
* remove extra attr
* Add tests
* Add back attributes
* position sensors disabled default
* entity id
* unique id
* test init to attributes
* Fix test init
* Fix test sensor
* test unique id
* uom
* remove rising
* Remove not needed uom property
* Fix reload issue
* degree
2023-03-26 07:24:43 +08:00
G Johansson 7f6406127e
Remove platform yaml radiotherm (#90284) 2023-03-25 12:43:44 -10:00
G Johansson 89d00ac733
Fix default ipv6 resolver (#90269) 2023-03-25 12:31:01 -10:00
Franck Nijhof 5c839e2367
Add entity name translations to Elgato (#89629) 2023-03-25 23:06:03 +01:00
rikroe cc337c4ff6
Add Re-Auth to bmw_connected_drive (#90251)
* Add Re-Auth to bmw_connected_drive

* Always store refresh token to entry

* Fix tests

* Typo

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-03-25 10:09:33 -07:00
Luca Angemi 6d8eaa0bee
Add location field to calendar create_event service supported by Google Calendar and Local Calendar (#90098)
* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update calendar.py

* Update calendar.py

* Update services.yaml

* Update services.yaml

* Update calendar.py

* Update calendar.py

* Update __init__.py

* Update services.yaml

* Update services.yaml

* Update test_calendar.py

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update test_init.py

* Update __init__.py

* Update const.py

* Address changes to service.yaml

* Address changes to service.yaml

* Update test_calendar.py

* Update test_calendar.py

* Update test_calendar.py

* Update conftest.py

* Update conftest.py

* Update calendar.py

* Update __init__.py
2023-03-25 09:43:49 -07:00
J. Nick Koston 02ef7d445d
Allow passing an optional name to async_track_time_interval (#90244)
* Allow passing an optional name to async_track_time_interval

This is the same idea as passing a name to asyncio.create_task which
makes it easier to track down bugs

* more

* short

* still cannot find it

* add a few more

* test
2023-03-25 10:11:14 -04:00
epenet 5f3868b141
Add missing type hints to tests (#90218)
* Add type hints to tests

* Revert gree as handled in #90222
2023-03-24 19:34:01 -07:00
J. Nick Koston 4c45c3c63b
Add a faster query for get_last_state_changes when the number of states is 1 (#90211)
* Add a faster query for get_last_state_changes when the number of states is 1

related issue #90113

* Add a faster query for get_last_state_changes when the number of states is 1

related issue #90113

* coverage

* Apply suggestions from code review
2023-03-24 09:39:55 -04:00
Robert Svensson ee74e21541
Rework UniFi wireless client "wired bug" logic (#89757) 2023-03-24 10:06:09 +01:00
Jan Bouwhuis 7364e6ecb3
Remove incorrect parametrize decorator (#90219) 2023-03-24 09:38:43 +01:00
Jan Bouwhuis 1224b1aff6
Use helper on tests MQTT fan platform (#90196)
Use helper on tests fan
2023-03-24 08:42:23 +01:00
Jan Bouwhuis f2b4c95a04
Prepare MQTT platform tests part7 (#90130)
* Tests select

* Tests sensor

* Deduplicate test code
2023-03-24 08:42:00 +01:00
Jan Bouwhuis 0570405a3c
Prepare MQTT platform tests part6 (#90129)
* Tests lock

* Tests mixins

* Tests number

* Tests scene
2023-03-24 08:41:36 +01:00
Jan Bouwhuis a404d5f6d7
Prepare MQTT platform tests part5 (#90108)
* Tests light_json

* Tests light_template

* Tests light
2023-03-24 08:41:04 +01:00
J. Nick Koston d49fbc17df
Fix recorder attribute excludes not being effective until after startup (#90198)
* Fix attribute excludes not being effective until after startup

fixes #90016

* reduce
2023-03-23 20:52:37 -04:00
J. Nick Koston dd0f05b980
Avoid calling the http access logging when logging is disabled (#90152) 2023-03-23 09:55:02 -10:00
epenet 38a4f08e15
Fix missing mock in islamic_prayer_times (#90178)
* Fix missing mock in islamic_prayer_times

* Restore 100% coverage

* Update test_config_flow.py
2023-03-23 20:10:51 +01:00
Michael Hansen 3e3ece4e56
Add speech to text over binary websocket to pipeline (#90082)
* Allow passing binary to the WS connection

* Expand test coverage

* Test non-existing handler

* Add text to speech and stages to pipeline

* Default to "cloud" TTS when engine is None

* Refactor pipeline request to split text/audio

* Refactor with PipelineRun

* Generate pipeline from language

* Clean up

* Restore TTS code

* Add audio pipeline test

* Clean TTS cache in test

* Clean up tests and pipeline base class

* Stop pylint and pytest magics from fighting

* Include mock_get_cache_files

* Working on STT

* Preparing to test

* First successful test

* Send handler_id

* Allow signaling end of stream using empty payloads

* Store handlers in a list

* Handle binary handlers raising exceptions

* Add stt/tts dependencies to voice_assistant

* Include STT audio in pipeline test

* Working on tests

* Refactoring with stages

* Fix tests

* Add more tests

* Add method docs

* Change stt demo/cloud to AsyncIterable

* Add pipeline error events

* Move handler id to separate message before pipeline

* Add test for invalid stage order

* Change "finish" to "end"

* Use enum

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-03-23 14:44:19 -04:00
Jan Bouwhuis 185d6d74d7
Prepare MQTT platform tests part9 (#90133)
* Tests switch

* Tests text

* Tests update
2023-03-23 19:17:27 +01:00
Jan Bouwhuis db63c8584e
Prepare MQTT platform tests part8 (#90132)
* Tests state_vacuum

* Tests siren
2023-03-23 19:16:54 +01:00
Jan Bouwhuis 2c1b59be0e
Prepare MQTT platform tests part4 (#90107)
* Tests humidifier

* Tests legacy_vacuum
2023-03-23 19:14:44 +01:00
Jan Bouwhuis 44add1dc11
Prepare MQTT platform tests part3 (#90106)
* Tests cover

* Tests fan
2023-03-23 19:14:08 +01:00
Jan Bouwhuis 8fd88d6703
Prepare MQTT platform tests part2 (#90105)
* Tests button

* Tests camera

* Tests climate
2023-03-23 19:13:36 +01:00
Nalin Mahajan e290febb38
Bump pyControl4 to 1.1.0 (#90115)
* Bump pyControl4 to 1.1.0

* Remove mock token_expiration from control4
2023-03-23 17:34:38 +01:00
Vincent Knoop Pathuis cb578c71e0
Add Landis+Gyr missing device class (#90182)
Add missing device class for heat_previous_year_gj
2023-03-23 17:21:21 +01:00
PeteRager 73ed6e039a
Improve logging for unavailable sonos hosts (#90172)
* Repeated warning messages on unavailable manually specified hosts

Sonos logs warning messages every 1 minute 12 seconds for hosts that are not on-line.  This fixes the issue and the warning will be logged the first time, and subsequent logs messages will be at DEBUG level

* Update homeassistant/components/sonos/__init__.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Log info message when reconnect succeeds

* Use pop to simplify code

* Add additional test, fix key error with pop

* Use pop with default return value

* Update tests/components/sonos/test_init.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/sonos/test_init.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/sonos/test_init.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/sonos/test_init.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update tests/components/sonos/test_init.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Update comment, remove unneeded line of code

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-23 16:15:55 +01:00
Vincent Knoop Pathuis 568a731e2d
Use snapshot test for Landis+Gyr (#90126)
Initial commit for snapshot test
2023-03-23 10:30:31 +01:00
Erik Montnemery 50ea0c5cf2
Tweak multiprotocol tests (#90163) 2023-03-23 10:12:42 +01:00
rikroe 1a2fa51ac9
Bump bimmer_connected to 0.13.0 (#90127) 2023-03-23 10:01:01 +01:00
Erik Montnemery 6739542a5d
Simplify some multi pan code (#90135)
* Simplify some multi pan code

* Adjust ZHA config flow
2023-03-23 09:18:35 +01:00
solazs b151923619
Add health mode to gree integration (#89764)
Add health mode to gree integration.
2023-03-23 08:56:47 +01:00
Paulus Schoutsen 12352b2ce1
Always enforce URL param ordering for signed URLs (#90148)
Always enforce URL param ordering
2023-03-22 22:54:09 -04:00
J. Nick Koston ca576d45ac
Cache decode of JWT tokens (#90013) 2023-03-22 16:03:41 -10:00
J. Nick Koston 8a591fa16e
Add auto repairs for events schema (#90136)
* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* Add auto repairs for events schema

* fix bug - wrong table
2023-03-22 21:17:36 -04:00
J. Nick Koston 31c988c4f0
Fix index not being dropped on postgresql databases with a schema prefix (#90144)
* Fix index not being dropped on postgresql databases with a schema prefix

Added logging in case index drops fail so we can tell
why in the future

* coverage
2023-03-22 21:03:26 -04:00
J. Nick Koston 99b58f157e
Bump PyJWT to 2.6.0 (#90134)
* Bump PyJWT to 2.6.0

* fix time being frozen too late which makes the access token creation time in the future

* revert zha change

* fix repairs test

* fix ical test
2023-03-22 20:00:47 -04:00
J. Nick Koston 4ebce9746d
Add schema auto repairs for states tables (#90083) 2023-03-22 10:05:23 -10:00
Erik Montnemery 5948347b6b
Fix switch_as_x entity naming (#89992)
* Fix switch_as_x entity naming

* Simplify name logic
2023-03-22 20:24:05 +01:00
Erik Montnemery 1ea3312ed4
Deduplicate multiprotocol addon helper (#90102)
* Deduplicate multiprotocol addon helper

* Clarify
2023-03-22 20:20:42 +01:00
Erik Montnemery 3931e11fd9
Try to load integration before starting option flow (#90111)
* Try to load integration before starting option flow

* Adjust tests
2023-03-22 20:10:10 +01:00
Franck Nijhof 6db8867b81
Update wled to 0.16.0 (#90120) 2023-03-22 13:55:50 -04:00
puddly c581116c82
ZHA network settings API (#88564)
* Rename `zha.api` to `zha.websocket_api`

* Implement a ZHA network settings API

* Use the enum name as the radio type

* Don't filter out ignored config entries

* [WIP] Start unit tests

* Add unit tests

* Rename ZHA websocket API module in `.coveragerc`

* Rename `api` to `websocket_api`

* Increase test coverage to 100%
2023-03-22 11:15:46 -04:00
Erik Montnemery 130c8ea5f5
Update OTRB config entry if REST API port has changed (#90101)
* Update OTRB config entry if REST API port has changed

* Improve test coverage
2023-03-22 14:03:39 +01:00
Erik Montnemery 0ecd043cb2
Add test helper mock_config_flow (#90103) 2023-03-22 08:59:35 -04:00
Paulus Schoutsen 0ca6723378
Allow passing binary to the WS connection (#89882)
* Allow passing binary to the WS connection

* Expand test coverage

* Test non-existing handler

* Allow signaling end of stream using empty payloads

* Store handlers in a list

* Handle binary handlers raising exceptions
2023-03-22 08:36:36 -04:00
Erik Montnemery 19d56a7102
Change error handling in async_process_play_media_url (#90052) 2023-03-22 13:32:02 +01:00
Matrix 87e6dd3949
YoLink flexfob support (#90027) 2023-03-22 12:01:04 +01:00
Jan Bouwhuis 214286acb9
Prepare MQTT platorm tests part1 (#90051)
* Add help_custom_config

* Tests alarm_control_panel

* Tests binary_sensor

* Only use help_custom_config with iterable options
2023-03-22 10:23:08 +01:00
J. Nick Koston 96225bb287
Rename recorder run_history to table_managers.recorder_runs_manager (#90070) 2023-03-21 18:38:33 -10:00
J. Nick Koston 88ad97f112
Fix generating statistics for time periods smaller than we can measure (#90069)
If the time period for the mean/time weighted average was smaller
than we can measure (less than one microsecond), generating
statistics would fail with a divide by zero error. This is likely
only happens if the database schema precision is incorrect.
2023-03-21 21:12:45 -04:00
Michael Hansen 0e7ffff869
Add TTS to pipelines (#90004)
* Add text to speech and stages to pipeline

* Default to "cloud" TTS when engine is None

* Refactor pipeline request to split text/audio

* Refactor with PipelineRun

* Generate pipeline from language

* Clean up

* Restore TTS code

* Add audio pipeline test

* Clean TTS cache in test

* Clean up tests and pipeline base class

* Stop pylint and pytest magics from fighting

* Include mock_get_cache_files
2023-03-21 21:10:31 -04:00
J. Nick Koston ddcaa9d372
Break out statistics repairs into a `auto_repairs` modules (#90068)
* Break out statistics schema repairs into a repairs module

A future PR will add repairs for events, states, etc

* reorg

* reorg

* reorg

* reorg

* fixes

* fix patch targets

* name space rename
2023-03-21 21:08:06 -04:00
Franck Nijhof f98d685154
Refactor WLED select tests (#89219) 2023-03-21 22:32:41 +01:00
Michael d4cc4a343d
Use has_template property from lib in Fritz!SmartHome (#89152) 2023-03-21 21:33:33 +01:00
Jan Bouwhuis 6f88fe93ef
Only publish mqtt_statestream when MQTT is started (#89833)
* Only publish mqtt_statestream when ha is started

* also catch startup states and use event filter

* Add check for MQTT to be available first

* Make sure MQTT is available and started

* Fix test

* Improve test

* Reset mock before assertung not called
2023-03-21 10:21:45 -04:00
Erik Montnemery 41ea8fa9b4
Guess media type when cast is playing media without media type (#90048) 2023-03-21 10:01:35 -04:00
Jan Bouwhuis d865440012
Prepare MQTT common tests part3 (#90022) 2023-03-21 09:19:20 +01:00
Jan Bouwhuis fe49861e26
Prepare MQTT common tests part4 (#90023)
* Upd test_setting_attribute_via_mqtt_json_message

* Update test_setting_attribute_with_template

* Update test_update_with_json_attrs_not_dict

* Update test_update_with_json_attrs_bad_json
2023-03-21 09:07:46 +01:00
epenet dd1700954b
Deprecate YAML in SamsungTV (#89743)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-03-21 09:00:17 +01:00
Tom Harris 0c0c86bf7b
Add support for new Insteon i3 devcies (#89892) 2023-03-20 21:56:44 -10:00
Jan Bouwhuis 91dbda1ce7
Add mqtt common tests for availability (part2) (#89805)
* update test_availability_when_connection_lost

* Adjust test_availability_without_topic

* Update test_default_availability_payload + helper

* Update test_default_availability_list_payload

* Use helper for async_setup_component

* Update test_default_availability_list_*

* Update test_custom_availability_payload
2023-03-21 08:20:37 +01:00
Arturo 5e5ace9c4e
Add door lock device type to matter integration (#89277)
* Adds base code for matter lock

* Adds basic matter door lock support

* Adds matter lock fixture

* Adds tests for matter lock

* Addresses feedback

* Added logic to handle inter states of matter lock

* Addesses feedback
2023-03-21 01:29:33 +01:00
Raman Gupta cbe85126cb
Introduce a delay between update entity calls (#89737)
* Introduce a delay between update entity calls

* Update homeassistant/components/zwave_js/update.py

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

* move delay to constant and patch

* rename constant

* Switch to async_call_later

* Remove failing test

* Reimplement to solve task problem

* comment

* pass count directly so that value doesn't mutate before we store it

* lines

* Fix logic and tests

* Comments

* Readd missed coverage

* Add test for delays

* cleanup

* Fix async_added_to_hass logic

* flip conditional

* Store firmware info in extra data so we can restore it along with latest version

* Comment

* comment

* Add test for is_running check and fix bugs

* comment

* Add tests for various restore state scenarios

* move comment so it's less confusing

* improve typing

* consolidate into constant and remove unused one

* Update update.py

* update test to unknown state during partial restore

* fix elif check

* Fix type

* clean up test docstrings and function names

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-03-20 18:30:56 -04:00
epenet 18df3a22ca
Add FTTH information to SFR Box (#89781) 2023-03-20 20:06:44 +01:00
Jan Bouwhuis 51b12cbf96
Add user_input as suggested value in imap config flow (#89982)
Add user_input as suggested value to config_schema
2023-03-20 15:52:54 +01:00
Jan Bouwhuis e4275a053c
Remove yaml import from imap integration (#89981)
* Remove yaml import from imap integration

* Cleanup sensor code and strings.json
2023-03-20 15:52:07 +01:00
Malte Franken 0bf652ca96
Refactor constants in geo_json_events integration (#89912)
move constants to separate file
2023-03-20 13:26:38 +01:00
J. Nick Koston 146a31163c
Use bluetooth address instead of uuid on MacOS (#89926) 2023-03-20 12:07:41 +01:00
J. Nick Koston c3043fb0ee
Bump bluetooth deps for bleak 0.20 (#89925)
Co-authored-by: K <z@kwi.li>
2023-03-20 12:06:15 +01:00
epenet 9a784fddef
Fail CI on lingering timers (#89292) 2023-03-20 10:20:19 +01:00
J. Nick Koston d33a303a83
Fix statistics schema µs precision auto repair being ineffective (#89902)
If a user manually migrated their database to MySQL or PostgresSQL
and incorrectly created the timestamp columns as float we would
fail to correct them to double because when we migrated to use
timestamps for the columns I missed that we needed to change the
columns and types for µs precision
2023-03-20 00:06:37 -04:00
J. Nick Koston e798c30b8b
Fix statistics schema auto repair when there is bad data (#89903)
- If the user had previously duplicated data we could end up
  picking the next metadata_id and there could be stale rows
  in the database that have that metadata_id. This can only happen
  from bad manual migrations (which is what this is function
  is validating in the first place). To solve this we now insert
  data with a future date and look at the latest inserted row
  instead of the first.

Example
```
['stored_statistics',
  defaultdict(<class 'list'>,
              {'recorder.db_test_schema': [{'end': 948589200.0,
                                            'last_reset': None,
                                            'max': None,
                                            'mean': 2021.0,
                                            'min': None,
                                            'start': 948585600.0,
                                            'state': None,
                                            'sum': 394.5068},
                                          {'end': 1601946000.000001,
                                            'last_reset': 1601942400.000001,
                                            'max': 1.000000000000001,
                                            'mean': 1.000000000000001,
                                            'min': 1.000000000000001,
                                            'start': 1601942400.000001,
                                            'state': 1.000000000000001,
                                            'sum': 1.000000000000001}]})]
```
2023-03-20 00:06:23 -04:00
Allen Porter 9721ba59b6
Rewrite the calendar trigger to fix potential bugs (#89918)
Update the calander event trigger logic to have more exhaustive coverage. The
trigger will now use a timespan to create an explicit window for considering
upcoming events. The start/end of the time span is now more explicit, rather
than getting it from the alarm time.

The trigger is now broken into composable pieces:
- A timespan object for more explicitly managing the time window
- A function to get events during a time span
- A function to process upcoming events and determine the trigger times

The existing listener is now just responsible for scheduling alarms and glue.

This fixes bug with DST handling where the conversion back and forth between
UTC and timezone ends up dropping events during the jump forward. In practice,
an event was returned from the scanning, but it was never fired by the trigger
because (1) it was filtered out of the interval and (2) the event list was
previously cleared every iteration so it would get dropped.

Future improvements can bake more invariant checking into this structure.
2023-03-19 23:42:12 -04:00
Jan Bouwhuis 2039955ef7
Fix imap_email_content unknown status and replaying stale states (#89563) 2023-03-19 17:35:45 -10:00