Commit Graph

41 Commits

Author SHA1 Message Date
J. Nick Koston
916b4368dd Bump aioesphomeapi to 36.0.1 (#148991) 2025-07-18 07:30:34 -10:00
J. Nick Koston
87fd45d4ab Add device_id parameter to ESPHome command calls for sub-device support (#148667) 2025-07-12 20:12:14 -10:00
Gábor Kiss
b95af2d86b Fix ESPHome entity_id generation if name contains unicode characters (#146796)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-06-25 13:19:55 +02:00
J. Nick Koston
23ac22e213 Remove default args to ESPHome test fixture calls (#145840) 2025-05-29 01:45:37 -05:00
Jesse Hills
bdf4a21976 Use async_release_notes in ESPHome update entity (#144440) 2025-05-08 23:52:43 +02:00
J. Nick Koston
2a5c0d9b88 Add support for updating ESPHome deep sleep devices (#144161)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-05-03 20:50:17 -05:00
J. Nick Koston
5a6ce34352 Improve ESPHome test typing (#143617) 2025-04-24 10:41:37 -10:00
J. Nick Koston
3aa1c60fe3 ESPHome quality improvements round 2 (#143613)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2025-04-24 09:51:33 -10:00
J. Nick Koston
d4970f81aa Cleanup ESPHome update tests to avoid accessing integration internals (#141786)
We should not access DomainData directly in the test
2025-03-29 22:30:06 -10:00
J. Nick Koston
6d48fc183a Fix ESPHome update entities being loaded before device_info is available (#141704)
* Fix ESPHome update entities being loaded before device_info is available

Since we load platforms when restoring config, the update
platform could be loaded before the connection to the
device was finished which meant device_info could still
be empty. Wait until device_info is available to
load the update platform.

fixes #135906

* Apply suggestions from code review

* move comment

* Update entry_data.py

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2025-03-29 17:53:01 +01:00
Jesse Hills
a1f5e4f37a Do not create ESPHome Dashboard update entity if no configuration found (#129751) 2024-11-15 17:22:06 +01:00
Erik Montnemery
e861cab727 Add update_percentage state attribute to update entity (#128877)
* Add update_percentage state attribute to update entity

* Update tests

* Update tests
2024-10-21 15:31:48 +02:00
Franck Nijhof
0558c85b5d Revert "Remove ESPHome legacy entity naming" (#123453) 2024-08-10 18:38:20 +02:00
Jesse Hills
84d6f5ed07 Remove ESPHome legacy entity naming (#123436)
* Remove ESPHome legacy entity naming

* Update test entity_ids to use sanitized name instead of object_id
2024-08-09 11:43:02 +02:00
Jesse Hills
164cfa85da Add support for ESPHome update entities to be checked on demand (#123161) 2024-08-06 10:12:31 +02:00
Jesse Hills
72d706ab52 [ESPHome] Disable dashboard based update entities by default (#120907)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-07-02 13:51:14 +02:00
epenet
e446875c7e Improve type hints in esphome tests (#120674) 2024-06-27 09:33:14 -05:00
epenet
f5fd389512 Fix hass-component-root-import warning in esphome tests (#119883) 2024-06-18 12:39:36 +02:00
Jesse Hills
f8711dbfbf Add esphome native device update entities (#119339)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-18 16:31:50 +12:00
J. Nick Koston
ed0568c655 Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
J. Nick Koston
d0f5e40b19 Refactor ESPHome manager to avoid sending signals in tests (#116033) 2024-04-24 16:14:44 +02:00
Joost Lekkerkerker
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
J. Nick Koston
f1b5dcdd1b Refactor handling of device updates in ESPHome (#112864) 2024-03-09 20:30:17 -10:00
Marc Mueller
38adfbf1a3 Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Marc Mueller
7a89e58873 Use builtin TimeoutError [e-i] (#109679) 2024-02-05 12:00:37 +01:00
J. Nick Koston
4f213f6df3 Fix first ESPHome device update entity not offering install feature (#106993)
In the case where the user gets their first ESPHome device such as a RATGDO,
they will usually add the device first in HA, and than find the dashboard.

The install function will be missing because we do not know if the dashboard
supports updating devices until the first device is added. We now set the
supported features when we learn the version when the first device is added
2024-01-03 19:58:04 -05:00
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
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
ffe81a9716 Improve ESPHome update platform error reporting (#96455) 2023-07-12 16:46:29 -10: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
fde82ee323 Keep esphome update entity available when disconnected is expected (#95278) 2023-06-26 22:20:56 +02:00
J. Nick Koston
ec5f50913a Retry creating esphome update entities later if dashboard is unavailable (#92042) 2023-04-26 18:41:00 +02:00
Franck Nijhof
ed79265843 Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet
b9beed4624 Add type hints to integration tests (part 6) (#87979) 2023-02-13 09:45:11 +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
ad87c4557d Guard what version we can install ESPHome updates with (#87059)
* Guard what version we can install ESPHome updates with

* Update homeassistant/components/esphome/dashboard.py
2023-01-31 23:15:23 -05: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
Paulus Schoutsen
8f10c22a23 Update ESPHome devices from HA (#86249)
* Update ESPHome devices from HA

* esphome-dashboard-api==1.2.2

* Limit to 1 parallel ESPHome update
2023-01-19 16:28:46 -05:00
Paulus Schoutsen
a83318f373 ESPHome dashboard tweaks (#86176) 2023-01-18 21:15:37 +01:00
Paulus Schoutsen
29337bc6eb Reload ESPHome config entries when dashboard info received (#86174) 2023-01-18 17:59:55 +01:00
Paulus Schoutsen
c8cd41b5d4 Add ESPHome update entities (#85717) 2023-01-11 16:26:13 -05:00