* 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
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
* 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
* 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>
* 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
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
* 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
* 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
* 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>
* 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>
* Fix esphome binary sensors when state is missing
* Fix esphome binary sensors when state is missing
* Fix esphome binary sensors when state is missing
#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
* 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
* 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>
* 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>
* Make "CoverEntityFeature.STOP" conditional
* Check APIVersion before checking false by default flag
* sort
---------
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
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
```