Commit Graph

331 Commits

Author SHA1 Message Date
Aarni Koskela
706add4a57 Switch formatting from black to ruff-format (#102893)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-11-27 14:38:59 +01:00
J. Nick Koston
fc5ae50e06 Bump aioesphomeapi to 19.0.0 (#104512) 2023-11-25 14:00:04 -06:00
J. Nick Koston
1c4d7e9588 Improve test coverage for ESPHome deep sleep entities (#104476) 2023-11-25 09:20:56 +01:00
J. Nick Koston
a9384d6d4f Fix ESPHome BLE client raising confusing error when not connected (#104146) 2023-11-20 10:08:44 +01:00
Jan-Philipp Benecke
81450f0117 Update d-e* tests to use entity & device registry fixtures (#103804) 2023-11-12 10:38:32 +01:00
J. Nick Koston
2a80164508 Bump aioesphomeapi to 18.2.4 (#103552) 2023-11-07 11:22:41 +01:00
Michael Hansen
ae516ffbb5 Automatically convert TTS audio to MP3 on demand (#102814)
* Add ATTR_PREFERRED_FORMAT to TTS for auto-converting audio

* Move conversion into SpeechManager

* Handle None case for expected_extension

* Only use ATTR_AUDIO_OUTPUT

* Prefer MP3 in pipelines

* Automatically convert to mp3 on demand

* Add preferred audio format

* Break out preferred format

* Add ATTR_BLOCKING to allow async fetching

* Make a copy of supported options

* Fix MaryTTS tests

* Update ESPHome to use "wav" instead of "raw"

* Clean up tests, remove blocking

* Clean up rest of TTS tests

* Fix ESPHome tests

* More test coverage
2023-11-06 15:26:00 -05:00
Jesse Hills
ad692f3341 ESPHome Text entities (#102742) 2023-10-24 23:14:58 -05:00
J. Nick Koston
88296c1998 Migrate ESPHome unique ids to new format (#99451) 2023-10-15 17:05:20 -10:00
J. Nick Koston
5b8da03596 Bump aioesphomeapi to 18.0.1 (#102028)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-10-14 23:42:22 -10:00
Robert Resch
f7292d5b00 Add check that sensors don't have EntityCategory.CONFIG set (#101471) 2023-10-09 13:37:52 +02:00
Jesse Hills
d41144ee88 ESPHome: dont send error when wake word is aborted (#101032)
* ESPHome dont send error when wake word is aborted

* Add test
2023-09-27 23:39:57 -04:00
Jesse Hills
4c21aa18db Add audio_settings for pipeline from ESPHome device (#100894)
* Add audio_settings for pipeline from ESPHome device

* ruff fixes

* Bump aioesphomeapi 17.0.0

* Mypy

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-09-26 16:27:26 -05:00
J. Nick Koston
0eca433004 Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
Joost Lekkerkerker
f1fb28aad5 Use snapshot assertion for ESPHome diagnostics test (#98913) 2023-08-24 01:01:58 +02:00
J. Nick Koston
49d73441bf Abort ESPHome connection when both name and mac address do not match (#98787) 2023-08-22 23:02:23 +02:00
Jesse Hills
a42d975c49 ESPHome Wake Word support (#98544)
* ESPHome Wake Word support

* Remove all vad code from esphome integration

* Catch exception when no wake word provider found

* Remove import

* Remove esphome vad tests

* Add tests

* More tests
2023-08-21 12:13:02 -04:00
J. Nick Koston
5bf80a0f6d Make ESPHome deep sleep tests more robust (#98535) 2023-08-16 11:05:22 -05:00
Marc Mueller
e2d2ec8817 Use asyncio.timeout [b-e] (#98448) 2023-08-15 08:30:20 -05:00
Franck Nijhof
868a5f377f Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
J. Nick Koston
708b00d7ab Use legacy rules for ESPHome entity_id construction if friendly_name is unset (#97578) 2023-08-01 21:08:12 +02:00
J. Nick Koston
35aae949d0 Add initial test coverage for ESPHome manager (#97147) 2023-07-24 18:48:09 +02:00
Franck Nijhof
30058297cf Migrate backported StrEnum to built-in StrEnum (#97101) 2023-07-23 23:19:24 +02:00
J. Nick Koston
095146b163 Fix has_entity_name not always being set in ESPHome (#97055) 2023-07-23 10:45:48 +02:00
Marc Mueller
23810752ed Fix mock assert_called_with (#96929)
* Fix mock assert_called_with

* Fix sonos test

* Revert zeroconf test changes
2023-07-20 08:31:37 +02:00
J. Nick Koston
b77de2abaf Handle empty strings for ESPHome UOMs (#96556) 2023-07-14 12:14:32 -10:00
J. Nick Koston
ffe81a9716 Improve ESPHome update platform error reporting (#96455) 2023-07-12 16:46:29 -10:00
J. Nick Koston
7009683226 Ensure ESPHome dashboard connection recovers if its down when core starts (#96449) 2023-07-12 14:37:28 -10:00
J. Nick Koston
5d5c58338f Fix ESPHome deep sleep devices staying unavailable after unexpected disconnect (#96353) 2023-07-11 11:12:24 -10:00
J. Nick Koston
b106ca7983 Fix race fetching ESPHome dashboard when there are no devices set up (#96196)
* Fix fetching ESPHome dashboard when there are no devices setup

fixes #96194

* coverage

* fix
2023-07-11 14:11:51 -04:00
J. Nick Koston
7dc03ef301 Use the ESPHome object_id to suggest the entity id (#95852) 2023-07-10 13:02:34 +02:00
J. Nick Koston
995fb993e6 Avoid probing ESPHome devices when we do not have the encryption key (#95820) 2023-07-09 12:57:04 -10:00
J. Nick Koston
e39f023e3f Refactor ESPHome camera to avoid creating tasks (#95818) 2023-07-08 12:36:40 +02:00
J. Nick Koston
e38f55fdb6 Move ESPHomeManager into its own file (#95870)
* Move ESPHomeManager into its own file

This is not a functional change. This is only a reorganization
ahead of some more test coverage being added so moving tests
around can be avoided later.

* relos

* fixes

* merge a portion of new cover since its small and allows us to remove the __init__ from .coveragerc
2023-07-08 09:19:44 +02:00
J. Nick Koston
505f8fa363 Fix ESPHome camera not accepting the same exact image bytes (#95822) 2023-07-05 07:17:28 -05:00
J. Nick Koston
659281aab6 Fix ESPHome alarm_control_panel when state is missing (#95871) 2023-07-05 08:35:40 +02:00
J. Nick Koston
7bdd64a3f7 Handle invalid utf-8 from the ESPHome dashboard (#95743)
If the yaml file has invalid utf-8, the config flow would raise an
unhandled exception. Allow the encryption key to be entered manually
in this case instead of a hard failure

fixes #92772
2023-07-02 22:47:25 -04:00
J. Nick Koston
f0cb03e631 Handle missing or incorrect device name and unique id for ESPHome during manual add (#95678)
* Handle incorrect or missing device name for ESPHome noise encryption

If we did not have the device name during setup we could never
get the key from the dashboard. The device will send us
its name if we try encryption which allows us to find the
right key from the dashboard.

This should help get users unstuck when they change the key
and cannot get the device back online after deleting and
trying to set it up again manually

* bump lib to get name

* tweak

* reduce number of connections

* less connections when we know we will fail

* coverage shows it works but it does not

* add more coverage

* fix test

* bump again
2023-07-02 10:29:45 -04:00
J. Nick Koston
72806bfaf2 Add more test coverage for ESPHome lights (#95415) 2023-06-28 08:40:21 +02:00
J. Nick Koston
a8b2c1edfa Add more coverage for ESPHome lights (#95384) 2023-06-27 18:27:09 +02:00
J. Nick Koston
6d47feb595 Add tests for ESPHome cover platform (#95321) 2023-06-27 08:26:35 +02:00
J. Nick Koston
0af71851a4 Fix ESPHome button not getting device updates (#95311) 2023-06-26 22:34:37 -05:00
J. Nick Koston
9fe24c54e9 Add test coverage for ESPHome switch platform (#95306) 2023-06-26 17:49:00 -05:00
Michael Hansen
0f08e6699c Add VAD sensitivity to ESPHome (#95283)
* Change to "finished speaking detection"

* Add select entity to ESPHome for finished speaking detection

* Fix entity name

* Use vad select in stt stream

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-06-26 16:47:32 -04:00
J. Nick Koston
fde82ee323 Keep esphome update entity available when disconnected is expected (#95278) 2023-06-26 22:20:56 +02:00
J. Nick Koston
ad17a89531 Add additional coverage for ESPHome sensor and number (#95226) 2023-06-26 12:29:38 +02:00
J. Nick Koston
3b7095c63b Fix esphome not removing entities when static info changes (#95202)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-06-25 21:31:31 -05:00
J. Nick Koston
85d6e03dd3 Require newly configured esphome device to allow Home Assistant service calls (#95143)
* Require esphome service calls to be enabled

For existing devices, calling Home Assistant services continues
to be allowed.

For newly configured devices, it must now be enabled in the options
flow

* fix

* adjust

* coverage

* adjust

* fix test

* Update homeassistant/components/esphome/strings.json

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

* Update homeassistant/components/esphome/strings.json

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

* Update homeassistant/components/esphome/strings.json

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

* Update homeassistant/components/esphome/__init__.py

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

* Update homeassistant/components/esphome/__init__.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Update homeassistant/components/esphome/__init__.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-06-25 21:18:21 -04:00
J. Nick Koston
79f9a8a257 Add test coverage for esphome lock platform (#95023) 2023-06-24 23:10:47 -04:00
J. Nick Koston
9eedc8a602 Fix esphome binary sensors when state is missing (#95140)
* Fix esphome binary sensors when state is missing

* Fix esphome binary sensors when state is missing

* Fix esphome binary sensors when state is missing
2023-06-24 23:09:26 -04:00