Commit Graph
354 Commits
Author SHA1 Message Date
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 HansenandJ. Nick Koston 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 KostonandPaulus Schoutsen 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
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
Daniel KentandJ. Nick Koston 983ff10541 Fix ESPHome color temperature precision for light entities (#91424)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-06-23 08:08:28 -05:00
J. Nick Koston 3d8bf33d03 Add test coverage for esphome alarm control panels (#95090) 2023-06-23 12:59:05 +01:00
J. Nick Koston fe71ed8c50 Add esphome media player tests (#95069) 2023-06-22 21:28:58 +02:00
J. Nick Koston 3d12c7409d Add basic light tests to esphome (#95029) 2023-06-22 21:22:29 +02:00
J. Nick Koston 66b2214c55 Add esphome sensor tests (#95077) 2023-06-22 21:02:47 +02:00
J. Nick Koston c7f2dab13c Add climate tests to esphome (#95045) 2023-06-22 20:31:55 +02:00
J. Nick Koston 1cf4a008c3 Add coverage for binary_sensor platform to esphome (#95067) 2023-06-22 19:55:28 +02:00
J. Nick Koston ed55632a66 Add esphome fan platform tests and remove unreachable code (#95025) 2023-06-22 11:29:59 +02:00
J. Nick Koston 65a5244d5a Fix race and add test coverage for esphome select platform (#95019) 2023-06-22 01:19:47 +02:00
J. Nick Koston d369d679c7 Fix ESPHome entries reloading after startup when dashboard is in use (#94362) 2023-06-14 21:16:39 -10:00
Erik Montnemery 86f2aa84e5 Fix flaky ESPHome test fixture (#94465) 2023-06-12 16:59:11 +02:00
J. Nick KostonandJesse Hills 88bfd94800 Add support for ESPHome raw bluetooth advertisements (#94138)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-06-07 18:36:22 -05:00
Paulus Schoutsen cd330a2740 Pass device ID to conversation input (#93867) 2023-05-31 16:56:12 -04:00
Jesse Hills d7d9143a44 Add speech detection and conversation_id to esphome voice assistant (#93578)
* Add speech detection to esphome voice assistant

* Timeout after silence
Ensure events are sent before finish is called

* use va_version 3 instead of ESPHome version

* Convert repeated fixtures to factory

* Add some v3 tests

* Add conversation_id

* Bump aioesphomeapi to 13.8.0

* Fix missed buffering of detected chunk

* Alter log message

* Updates

* Spelling

* Fix return type
2023-05-30 19:49:22 -04:00
Erik Montnemery a71c097aeb Revert "Allow setting an entity's name by its device class" (#93539) 2023-05-25 17:20:54 +02:00
Erik MontnemeryandFranck Nijhof 67c1051305 Allow setting an entity's name by its device class (#90767)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-05-09 18:55:55 +02:00
Erik Montnemery f8f7de5d5a Remove homeassistant from conversation dependencies (#92170)
* Remove homeassistant from conversation dependencies

* Fix tests
2023-04-28 18:17:48 +02:00
Jesse Hills 32ed45084a ESPHome voice assistant: Version 2 - Stream raw tts audio back to device for playback (#92052)
* Send raw audio back

* Update tests

* More tests

* Fix docstrings and remove unused patches

* More tests

* MORE

* Only set raw for v2
2023-04-26 22:24:29 -04:00
Paulus SchoutsenandJesse Hills ddc2807361 Fix capitalization names Assist entities (#92098)
* Fix capitalization names Assist entities

* Adjust names to be 'in progress'

* Update tests/components/esphome/test_binary_sensor.py

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

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-04-26 22:13:21 -04:00
Jesse Hills 29ca43acf6 Set pipeline_id from pipeline select (#92085) 2023-04-27 10:29:08 +12:00
J. Nick Koston ec5f50913a Retry creating esphome update entities later if dashboard is unavailable (#92042) 2023-04-26 18:41:00 +02:00
Erik Montnemery 63f3767a29 Include UUID in hassio discovery data (#91970) 2023-04-25 09:48:47 +02:00
Jesse Hills aeb19831d2 ESPHome select for assist pipeline selection (#91526)
* ESPHome: Add assist pipeline select entity

* Add translation strings

* Tests
2023-04-17 22:22:11 -04:00
Jesse HillsandPaulus Schoutsen 8d201b205f ESPHome binary sensor representing assist pipeline running (#91406)
* ESPHome binary sensor representing assist pipeline running

* Apply suggestions from code review

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

* Rename to call active
Simplify with attrs a little

* Load binary sensor if voice assistant on device

* Add some tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-17 19:52:37 -04:00
Jesse HillsandPaulus Schoutsen 0ddccb26fa ESPHome voice assistant (#90691)
* Add ESPHome push-to-talk

* Send pipeline events to device

* Bump aioesphomeapi to 13.7.0

* Log error instead of print

* Rename variable

* lint

* Rename

* Fix type and cast

* Move event data manipulation into voice_assistant callback
Process full url

* Add a test?

* Remove import

* More tests

* Update import

* Update manifest

* fix tests

* Ugh

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-13 19:18:56 -04:00
Jesse Hills eb469d6a2f Move enum mapper to own file to prevent circular dependency (#90890)
* Move enum_mapper to own file to prevent circular dependency

* Add enum mapper test
2023-04-05 22:55:51 -04:00
epenet b94dffb7d3 Add missing mock in esphome tests (#88923) 2023-03-01 16:11:21 +01:00