83 Commits

Author SHA1 Message Date
Keith Burzinski
14515b77bb
Add valve entity support for ESPHome (#115341)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-04-17 20:47:15 -05:00
Jesse Hills
68384bba67
Send/receive Voice Assistant audio via ESPHome native API (#114800)
* Protobuf audio test

* Remove extraneous code

* Rework voice assistant pipeline

* Move variables

* Fix reading flags

* Dont directly put to queue

* Bump aioesphomeapi to 24.0.0

* Update tests

- Add more tests for API pipeline
- Convert some udp tests to use api pipeline
- Update fixtures for new device info flags

* Fix bad merge

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-04-09 10:55:59 -04:00
Sid
a5b609f081
Enable ruff TRY401 (#114395)
* Enable ruff TRY401

* fix tests
2024-03-29 07:20:36 +01:00
Marc Mueller
09ebca9630
Use SignalType to improve typing [esphome] (#114296) 2024-03-27 08:22:10 -04:00
J. Nick Koston
a0d43aeba2
Remove unused code in ESPHome entry_data (#114263) 2024-03-26 10:32:16 -10:00
Jesse Hills
6ddef7bbff
ESPHome: Add Time Entity support (#113852) 2024-03-21 16:59:43 +13:00
Sid
6ee273a548
Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
Jesse Hills
3d7d3d263d
ESPHome: Add Date Entity support (#112475)
* ESPHome: Add Date Entity support

* Formatting

* Add missing state test
2024-03-13 08:02:52 +01:00
J. Nick Koston
f1b5dcdd1b
Refactor handling of device updates in ESPHome (#112864) 2024-03-09 20:30:17 -10:00
Marc Mueller
0e3945ca6c
Add empty line after module docstring [d-f] (#112698) 2024-03-08 14:15:26 +01:00
J. Nick Koston
fb7da1ba83
Simplify ESPHome entity removal process (#111076) 2024-02-22 11:39:53 -10:00
J. Nick Koston
fd1f712d67
Bump esphome dependencies (#110892) 2024-02-19 10:38:28 +01:00
J. Nick Koston
d588ec8202
Fix ESPHome not fully removing entities when entity info changes (#108823) 2024-01-24 17:29:11 -10:00
J. Nick Koston
901b9365b4
Small cleanups to ESPHome callbacks (#107428) 2024-01-07 07:39:33 -10:00
J. Nick Koston
89513efd8d
Refactor ESPHome Bluetooth connection logic to prepare for esphome-bleak (#105747) 2023-12-17 04:42:28 -10:00
J. Nick Koston
8d1a69ae84
Migrate ESPHome bleak implementation to bleak-esphome library (#105611) 2023-12-14 07:21:31 -10:00
J. Nick Koston
df37ee4033
Remove chatty ESPHome state debug logging (#104477) 2023-11-25 10:41:51 +01:00
J. Nick Koston
29ac3a8f66
Fix memory leak in ESPHome disconnect callbacks (#104149) 2023-11-21 07:58:22 +01: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
Ville Skyttä
3094991236
Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
J. Nick Koston
095146b163
Fix has_entity_name not always being set in ESPHome (#97055) 2023-07-23 10:45:48 +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
505f8fa363
Fix ESPHome camera not accepting the same exact image bytes (#95822) 2023-07-05 07:17:28 -05: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
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
adc2df6b8e
Callback esphome EntityInfo by platform instead of all platforms (#95021) 2023-06-22 09:39:48 +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
9443ca89bc
Handle exceptions to prevent disconnect when esphome state subscription raises (#93723) 2023-05-29 20:41:50 +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
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
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
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
Franck Nijhof
cc3ae5b19b
Mark ESPHome update entity unavailable when device is offline (#87576) 2023-02-07 22:15:54 +01:00
Paulus Schoutsen
8417f22904
Trigger update of ESPHome update entity when static info updates (#87058)
Trigger update of update entity when static info updates
2023-01-31 22:13:41 -05:00
Jesse Hills
d3c41bc31c
Add friendly name support for ESPHome (#85976)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-15 21:33:44 -10:00
Franck Nijhof
9415e7e51b
Address small review comments in ESPHome (#85770) 2023-01-12 22:55:18 +01:00
Paulus Schoutsen
c8cd41b5d4
Add ESPHome update entities (#85717) 2023-01-11 16:26:13 -05:00
J. Nick Koston
5a970e0a2b
Adjust additional esphome bluetooth debug messages for unique id change (#83955) 2022-12-13 12:57:29 -10:00
J. Nick Koston
95641fa780
Revert "Move esphome gatt services cache to be per device" #81265 (#83793) 2022-12-11 17:50:18 -10:00
J. Nick Koston
955d4abf13
Fix missing services with esp32 proxies (#83192) 2022-12-03 13:50:59 -05:00
J. Nick Koston
fb98128b9f
Add support for esphome ble client connections v3 (#82815) 2022-11-28 16:56:18 -10:00
J. Nick Koston
8db7afb2e0
Include esphome device name in BLE logs (#81284)
* Include esphome device name in BLE logs

This makes it easier to debug what is going on when there
are multiple esphome proxies

* revert unintended change
2022-10-31 00:31:37 -05:00
J. Nick Koston
c8a3392471
Move esphome gatt services cache to be per device (#81265) 2022-10-30 18:02:54 -05:00
J. Nick Koston
0b5289f748
Wait for disconnect when we are out of connection ble slots in esphome (#79246) 2022-09-29 08:42:55 -04:00