Commit Graph

802 Commits (41646a65144768d565e350924effa5ed717c4dda)

Author SHA1 Message Date
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
Ville Skyttä 3094991236
Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
J. Nick Koston 3e14e5acba
Bump aioesphomeapi to 16.0.1 (#98536) 2023-08-17 17:46:21 +02:00
J. Nick Koston e95979e9af
Bump ESPHome recommended BLE version to 2023.8.0 (#98586) 2023-08-17 17:39:35 +02:00
Marc Mueller e2d2ec8817
Use asyncio.timeout [b-e] (#98448) 2023-08-15 08:30:20 -05:00
Erik Montnemery 8b99d4678f
Correct checks for non-finite numbers in ESPHome (#98102) 2023-08-12 08:10:25 +01:00
Erik Montnemery 045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
J. Nick Koston 108bcabf75
Add missing transmit power to ESPHome Bluetooth scanners (#98175)
We did not previously have a way to get the transmit power value when using
ESPHome scanners. bluetooth-data-tools 1.8.0 includes it in the
advertisment tuple to fully align with the bleak implementation.

txpower is not yet used in the HA codebase but may be expected by
upstream libaries that calculate estimated distance
2023-08-10 21:59:37 -04: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 c478a81deb
Bump bluetooth-data-tools to 1.7.0 (#97821) 2023-08-05 22:21:46 +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 afdbbefc31
Revert using has_entity_name in ESPHome when `friendly_name` is not set (#97488) 2023-07-30 18:28:45 +02:00
J. Nick Koston 1b10c44a16
Disable always_update in esphome dashboard coordinator (#97419) 2023-07-28 12:42:04 -05:00
J. Nick Koston cbc8ebb427
Bump aioesphomeapi to 15.1.15 (#97335)
changelog: https://github.com/esphome/aioesphomeapi/compare/v15.1.14...v15.1.15
2023-07-27 09:30:31 -05:00
J. Nick Koston 593960c704
Bump bluetooth deps (#97157) 2023-07-24 19:49:24 +02:00
Marc Mueller 0cc396b863
Use EventType for state changed [a-h] (#97116) 2023-07-24 08:04:13 +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 77f38e33e5
Import names from typing instead of typing_extensions [3.11] (#97065) 2023-07-22 17:03:44 -05:00
J. Nick Koston 24b9bde9e5
Fix duplicate and missing decorators in ESPHome Bluetooth client (#97027) 2023-07-22 13:10:41 +02:00
J. Nick Koston 2c4e4428e9
Decouple more of ESPHome Bluetooth support (#96502)
* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* Decouple more of ESPHome Bluetooth support

The goal is to be able to move more of this into an external library

* fix diag

* remove need for hass in the client

* refactor

* decouple more

* decouple more

* decouple more

* decouple more

* decouple more

* remove unreachable code

* remove unreachable code
2023-07-21 16:41:50 -04:00
J. Nick Koston 7814ce06f4
Fix ESPHome bluetooth client cancel behavior when device unexpectedly disconnects (#96918) 2023-07-21 13:44:13 -05:00
J. Nick Koston 0b0f072faf
Bump aioesphomeapi to 15.1.14 (#97019)
changelog: https://github.com/esphome/aioesphomeapi/compare/v15.1.13...v15.1.14
2023-07-21 13:05:46 -04:00
J. Nick Koston 6818cae072
Bump aioesphomeapi to 15.1.13 (#96964) 2023-07-20 16:05:17 -05:00
J. Nick Koston 955bed0128
Bump aioesphomeapi to 15.1.12 (#96924) 2023-07-19 18:39:50 -05:00
J. Nick Koston 9b839041fa
Bump aioesphomeapi to 15.1.11 (#96873) 2023-07-19 06:49:40 +02:00
J. Nick Koston 6bd4ace3c3
Fix ESPHome bluetooth client cancellation when the operation is cancelled externally (#96804) 2023-07-18 03:39:26 -10:00
J. Nick Koston eb60dc65ec
Bump aioesphomeapi to 15.1.9 (#96791) 2023-07-17 15:35:37 -10:00
mattmccormack 2f8b88e6ef
Add string "Quiet" to fan mode in climate component (#96584) 2023-07-17 09:25:01 +02:00
J. Nick Koston 30e05ab85e
Bump aioesphomeapi to 15.1.7 (#96615) 2023-07-15 12:31:35 -10:00
J. Nick Koston 9775832d53
Remove unreachable code in the ESPHome fan platform (#96458) 2023-07-14 13:37:16 -10:00
J. Nick Koston b77de2abaf
Handle empty strings for ESPHome UOMs (#96556) 2023-07-14 12:14:32 -10:00
J. Nick Koston c44c7bba84
Simplify ESPHome bluetooth disconnected during operation wrapper (#96459) 2023-07-13 16:45:45 -10:00
J. Nick Koston 09237e4eff
Remove unused code in ESPHome (#96503) 2023-07-13 13:38:15 -10:00
J. Nick Koston c86b60bdf7
Bump bluetooth-data-tools to 1.6.0 (#96461) 2023-07-13 11:42:11 -10:00
Paulus Schoutsen 7859be6481
Add deduplicate translations script (#96384)
* Add deduplicate script

* Fix forecast_solar incorrect key with space

* Fix utf-8

* Do not create references to other arbitrary other integrations

* Add commented code to only allow applying to referencing integrations

* Tweak

* Bug fix

* Add command line arg for limit reference

* never suggest to update common keys

* Output of script

* Apply suggestions from code review

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2023-07-13 11:52:50 -04: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 85ed347ff3
Bump aioesphomeapi to 15.1.6 (#96297)
* Bump aioesphomeapi to 15.1.5

changelog: https://github.com/esphome/aioesphomeapi/compare/v15.1.4...v15.1.5

- reduce traffic
- improve error reporting

* 6
2023-07-11 14:08:01 -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 fa6d659f2b
Bump aioesphomeapi to 15.1.4 (#96227) 2023-07-10 11:11:08 +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 6402e2c140
Bump aioesphomeapi to 15.1.3 (#95819) 2023-07-07 18:25:54 +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 73f90035bb
Bump aioesphomeapi to 15.1.2 (#95792)
changelog: https://github.com/esphome/aioesphomeapi/compare/v15.1.1...v15.1.2

intentionally not tagged for beta to give it more time in dev
since we are near the end of the beta cycle
2023-07-03 14:19:41 -04: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 376c61c34b
Bump aioesphomeapi to 15.0.1 (#95629)
fixes #87223 (the cases were the host gets too far behind,
not the cases were the esp8266 runs out of ram but thats
is not a core issue)
2023-06-30 11:37:04 -04:00
J. Nick Koston 734614bdda
Fix device_id not set in esphome (#95580) 2023-06-29 18:04:13 -05:00
J. Nick Koston 93b4e6404b
Bump bluetooth-data-tools to 1.3.0 (#95576) 2023-06-29 18:03:59 -05:00
J. Nick Koston dfe7c5ebed
Refactor ESPHome connection management logic into a class (#95457)
* Refactor ESPHome setup logic into a class

Avoids all the nonlocals and fixes the C901

* cleanup

* touch ups

* touch ups

* touch ups

* make easier to read

* stale
2023-06-28 21:39:31 -04:00
J. Nick Koston 25dc9f5942
Migrate esphome climate platform to use _on_static_info_update (#95471) 2023-06-28 20:37:35 +02:00
J. Nick Koston 72806bfaf2
Add more test coverage for ESPHome lights (#95415) 2023-06-28 08:40:21 +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 7737271a30
Migrate esphome alarm_control_panel platform to use _on_static_info_update (#94961) 2023-06-26 22:58:17 +02: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 021a39a09c
Make deep sleep esphome entities unavailable on unexpected disconnect (#95211) 2023-06-26 14:21:45 +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 57a910a144
Relocate esphome entity code into its own module (#95092) 2023-06-24 23:12:36 -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
J. Nick Koston 7c49324f18
Bump aioesphomeapi to 14.1.1 (#95166) 2023-06-24 14:15:51 -05:00
Daniel Kent 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 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 dd0e6d6481
Migrate esphome media_player platform to use _on_static_info_update (#95071) 2023-06-22 19:57:09 +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 cd5fdb97c0
Small cleanups to esphome sensor and binary_sensor (#95042) 2023-06-22 11:14:33 +02:00
J. Nick Koston 8f6cde5b32
Migrate esphome lock platform to use _on_static_info_update (#95030) 2023-06-22 11:07:51 +02:00
J. Nick Koston adc2df6b8e
Callback esphome EntityInfo by platform instead of all platforms (#95021) 2023-06-22 09:39:48 +02:00
J. Nick Koston 27da7d68de
Migrate esphome fan platform to use _on_static_info_update (#95031) 2023-06-22 09:07:13 +02:00
J. Nick Koston b700400183
Migrate esphome select platform to use _on_static_info_update (#95022) 2023-06-22 09:05:57 +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 235f50a341
Migrate esphome button platform to use _on_static_info_update (#95007) 2023-06-21 22:24:26 +02:00
Marc Mueller 86792fcc2f
Update mypy to 1.4.0 (#94987) 2023-06-21 16:12:51 +02:00
J. Nick Koston 367644afe1
Migrate esphome switch platform to use _on_static_info_update (#94962) 2023-06-21 15:41:24 +02:00
J. Nick Koston 1cb62d776e
Migrate esphome cover platform to use _on_static_info_update (#94959) 2023-06-21 14:54:56 +02:00
J. Nick Koston 9d91cfa27f
Migrate esphome number platform to use _on_static_info_update (#94958) 2023-06-21 13:13:29 +02:00
J. Nick Koston 9876abcac9
Migrate esphome light platform to use _on_static_info_update (#94960) 2023-06-21 12:31:14 +02:00
J. Nick Koston 804a8ef36a
Reduce overhead to update esphome entities (#94930) 2023-06-21 11:00:21 +02:00
J. Nick Koston 2b1660c0f7
Dispatch when esphome static info changes (#94876) 2023-06-20 09:45:30 +02:00
Graham Brown cecdc3bd47
ESPHome Alarm Control Panel (#92357) 2023-06-19 19:19:17 -05:00
J. Nick Koston be638d3772
Bump recommended esphome version for bluetooth to 2023.6.0 (#94773)
2023.6.0 is needed for #94138 to work
2023-06-17 16:23:33 -04:00
J. Nick Koston 7e3510800d
Bump bluetooth-data-tools to 1.2.0 (#94696)
changelog: https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.1.0...v1.2.0

benchmark (0.4.0) currently in 2023.6.x: Parsing 100000 bluetooth messages took 8.928823958034627 seconds
benchmark (1.2.0) this PR: Parsing 100000 bluetooth messages took 1.6808899159659632 seconds
2023-06-15 22:11:14 -04:00
Franck Nijhof 908f3386e7
Fix HAVCMode typing in ESPHome (#94630) 2023-06-15 14:12:11 +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
J. Nick Koston 2a5ffa9a5b
Fix timestamps for bluetooth scanners that bundle advertisements (#94511)
#94138 added support for raw/bundled advertisements. We should use the
same monotonic time for all advertisements in the bundle if not time
is passed, or calculate the timestamp and pass it if its known
2023-06-14 21:47:00 -04:00
J. Nick Koston b149fffa08
Bump bluetooth-data-tools to 1.1.0 (#94610)
Bume bluetooth-data-tools to 1.1.0

performance improvements

https://github.com/Bluetooth-Devices/bluetooth-data-tools/compare/v1.0.0...v1.1.0
2023-06-14 22:25:26 +02:00
J. Nick Koston 223394eaee
Bump bluetooth-data-tools to 1.0.0 (#94145) 2023-06-13 06:42:10 -10:00
Ville Skyttä f7938c940c
Upgrade ruff to 0.0.272 (#94290) 2023-06-08 21:53:43 +02:00
J. Nick Koston 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
Paulus Schoutsen 927b59fe5a
Simplify get pipeline method (#93865) 2023-05-31 10:06:03 -05: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
Ville Skyttä 70c49824d7
Import `util.dt` as `dt_util` in `components/[e-f]*` (#93758) 2023-05-30 00:00:11 +03:00
J. Nick Koston 9443ca89bc
Handle exceptions to prevent disconnect when esphome state subscription raises (#93723) 2023-05-29 20:41:50 +02:00
Jesse Hills bb39b99a3f
ESPHome fix changing light color_mode (#93434) 2023-05-24 08:37:42 +02:00
epenet dad3fbf5e2
Fix lingering timer in esphome (#92533) 2023-05-17 22:05:44 +02:00
J. Nick Koston 64623283b2
Bump aioesphomeapi to 13.7.5 (#93121)
performance improvements

changelog: https://github.com/esphome/aioesphomeapi/compare/v13.7.4...v13.7.5
2023-05-15 22:24:17 +03:00
J. Nick Koston cdc4b315e5
Bump aioesphomeapi to 3.7.4 to fix proxied BLE connections not retrying right away on error (#92741) 2023-05-08 18:56:06 +02:00
J. Nick Koston 3f630493ff
Allow duplicate state updates when force_update is set on an esphome sensor (#92553)
* Allow duplicate states when force_update is set on an esphome sensor

fixes #91221

* Update homeassistant/components/esphome/entry_data.py

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>

---------

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>
2023-05-04 22:21:42 -04:00
J. Nick Koston 785faf4380
Bump aioesphomeapi to 13.7.3 to fix disconnecting while handshake is in progress (#92537)
Bump aioesphomeapi to 13.7.3

fixes #92432
2023-05-04 22:18:20 -04: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 Schoutsen 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
J. Nick Koston 5f1fc3259c
Bump aioesphomeapi to 13.7.2 (#92027) 2023-04-26 09:12:52 +02:00
J. Nick Koston 458276a6a6
Bump aioesphomeapi to 13.7.1 (#91783)
changelog: https://github.com/esphome/aioesphomeapi/compare/v13.7.0...v13.7.1
2023-04-20 16:36:11 -10:00
J. Nick Koston c407fb0861
Bump recommended esphome version to 2023.4.0 for bluetooth (#91509) 2023-04-20 15:36:12 -10:00
Erik Montnemery 090f59aaa2
Make context a mandatory parameter for async_pipeline_from_audio_stream (#91658) 2023-04-19 09:30:29 -04: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 Hills 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 Hills 42b0602190
ESPHome: Use existing property with generated signal string (#91525) 2023-04-16 18:37:12 -10:00
J. Nick Koston 4420201fe6
Use bluetooth data tools for address conversion in esphome (#91443) 2023-04-16 11:55:08 -10:00
Jesse Hills 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
J. Nick Koston 87c22c3ad5
Fix state being cleared on disconnect with deep sleep esphome devices (#90925)
* Fix state being cleared on disconnect with deep sleep esphome devices

fixes #90923

* fix logic
2023-04-06 16:32:02 -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
J. Nick Koston 02c749a111
Bump aioesphomeapi to 10.6.1 (#90816) 2023-04-04 17:22:01 -10:00
J. Nick Koston c566303edb
Avoid writing state to all esphome entities at shutdown (#90555) 2023-03-31 18:23:05 +02:00
Alexander Momchilov abe60375b3
Disable esphome stopping a cover if the cover doesn't support stopping (#80104)
* Make "CoverEntityFeature.STOP" conditional

* Check APIVersion before checking false by default flag

* sort

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-03-28 16:43:47 +02:00
J. Nick Koston 6a5c05e7d2
Add support for clearing the on device GATT cache to esphome (#90318) 2023-03-27 09:34:28 +02:00
J. Nick Koston 65e46e3261
Bump aioesphomeapi to 13.6.0 (#90330) 2023-03-26 12:58:07 -10:00
J. Nick Koston a7c796a2f7
Ensure esphome connected future is awaited when connecting is canceled (#90329) 2023-03-26 12:30:00 -10:00
J. Nick Koston 8c9966aa05
Ensure esphome subscribes to bluetooth connection free before accepting connect requests (#90319) 2023-03-26 22:06:14 +02:00
epenet f56bf134d2
Improve browse_media type hints in media player (#90060)
* Improve browse_media type hints in media player

* Adjust components

* Adjust base entity
2023-03-24 21:49:12 -07:00
J. Nick Koston 0303618705
Handle cancelation of wait_for_ble_connections_free in esphome bluetooth (#90014)
Handle cancelation in wait_for_ble_connections_free

If `wait_for_ble_connections_free` was canceled due to timeout or
the esp disconnecting from Home Assistant the future would get
canceled. When we reconnect and get the next callback we need
to handle it being done.

fixes
```
2023-03-21 02:34:36.876 ERROR (MainThread) [homeassistant] Error doing job: Fatal error: protocol.data_received() call failed.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/selector_events.py", line 868, in _read_ready__data_received
    self._protocol.data_received(data)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/_frame_helper.py", line 195, in data_received
    self._callback_packet(msg_type_int, bytes(packet_data))
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/_frame_helper.py", line 110, in _callback_packet
    self._on_pkt(Packet(type_, data))
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/connection.py", line 688, in _process_packet
    handler(msg)
  File "/usr/local/lib/python3.10/site-packages/aioesphomeapi/client.py", line 482, in on_msg
    on_bluetooth_connections_free_update(resp.free, resp.limit)
  File "/usr/src/homeassistant/homeassistant/components/esphome/entry_data.py", line 136, in async_update_ble_connection_limits
    fut.set_result(free)
asyncio.exceptions.InvalidStateError: invalid state
```
2023-03-20 23:49:59 -04:00
J. Nick Koston 49f08ad71d
Filter out duplicate updates in esphome state dispatch (#89779) 2023-03-20 20:04:46 +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
J. Nick Koston c707ddbf7c
Bump aioesphomeapi to 13.5.1 (#89777) 2023-03-15 20:00:47 -10:00
epenet ff2a88b426
Bump ruff to 0.0.254 (#89273) 2023-03-07 13:25:31 +01:00
J. Nick Koston ee89922c1b
Add support for bluetooth pairing in esphome (#88603)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-03-06 14:24:35 -10:00
J. Nick Koston 5ccaa549d1
Bump aioesphomeapi to 13.5.0 (#89262) 2023-03-06 14:04:10 -10:00
J. Nick Koston 83fa4c6c60
Bump aioesphomeapi to 13.4.2 (#89210) 2023-03-06 18:49:54 +01:00
epenet eebcf70b41
Re-enable Ruff D411 (#89035) 2023-03-02 13:01:05 -05:00
J. Nick Koston ee7dfdae30
Bump aioesphomeapi to 13.4.1 (#88703)
changelog: https://github.com/esphome/aioesphomeapi/releases/tag/v13.4.1
2023-02-24 11:09:12 -05:00
Michael Muré d14000f704
Add esphome climate quiet fan mode (#74303)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-02-21 11:09:41 -06:00
Jesse Hills 6da524b378
ESPHome: Add additional field for current temperature precision (#88464) 2023-02-20 09:54:40 +01:00
Franck Nijhof d3ed8de232
Update Ruff to v0.0.247 (#88210)
* Update Ruff to v0.0.247

* Fix new found violations
2023-02-15 16:46:03 -05:00
J. Nick Koston ae06d9fd5c
Bump aioesphomeapi to 13.3.1 (#87969)
* Bump aioesphomeapi to 13.3.0

We probably need to include https://github.com/esphome/aioesphomeapi/pull/382
as well in another bump

* bump
2023-02-13 09:07:56 -05:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Erik Montnemery 78c9b70c8d
Sort manifests 3 (#87024) 2023-02-08 20:19:19 +01:00
Franck Nijhof cc3ae5b19b
Mark ESPHome update entity unavailable when device is offline (#87576) 2023-02-07 22:15:54 +01:00
Marc Mueller 342b406dc0
Add Self typing (1) [mypy 1.0] (#87598) 2023-02-06 22:29:47 -06:00