Commit Graph

103 Commits (drop-ignore-missing-annotations)

Author SHA1 Message Date
J. Diego Rodríguez Royo 3af0d6e484
Use `is` instead of `==` on check against enum value at Home Connect (#144083)
* Use `is` instead of `==` on check against enum value at Home Connect

* Revert HTTP status checks
2025-05-02 10:08:46 +02:00
J. Diego Rodríguez Royo 883ab44437
Move Home Connect entry state assertion at tests (#144027) 2025-05-01 23:04:03 +02:00
J. Diego Rodríguez Royo 79aa7aacec
Sort Home Connect test params (#144035) 2025-05-01 12:04:25 +02:00
J. Diego Rodríguez Royo c0f0a4a1ac
Listen for an event just once at Home Connect test (#144031) 2025-05-01 11:24:29 +02:00
J. Diego Rodríguez Royo a084b9fdde
Set `autouse` to `setup_credentials` Home Connect fixture (#144028) 2025-05-01 11:24:05 +02:00
J. Diego Rodríguez Royo bc47049d42
Remove non required Home Connect tests (#144024) 2025-05-01 10:18:32 +02:00
J. Diego Rodríguez Royo 4061314cd2
Allow multiple config entries in Home Connect (#143935)
* Allow multiple config entries in Home Connect

* Config entry migration

* Create new entry if reauth flow is completed with other account

* Abort if different account on reauth
2025-04-30 16:22:18 +02:00
J. Diego Rodríguez Royo 15aff9662c
Refresh Home Connect program entities possible options when an appliance gets connected (#143213)
Refresh options when an appliance gets connected
2025-04-29 13:12:21 +02:00
J. Diego Rodríguez Royo 1bfd585f3c
Adjust Home Connect max executions parameters (#143509)
Adjust max executions parameters to ensure that 1000 calls per day are not reached
2025-04-23 15:52:53 +02:00
J. Diego Rodríguez Royo 60293648dc
Create Home Connect active and selected program entities only when there are programs (#143185)
* Create active and selected program entities only when there are programs

* Test improvements
2025-04-18 00:09:52 +02:00
J. Diego Rodríguez Royo eb19c7af32
Disable Home Connect appliance refresh when frequent disconnects are detected (#142615)
* Disable specific updates for an appliance when is done repeatedly

* Fix deprecation issues fix tests

* Fix message

* Avoid fetching appliance info also

* Apply suggestions

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Create specific RepairFlow for enabling appliance's updates

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-04-12 14:58:35 +02:00
J. Diego Rodríguez Royo 7ad13c8897
Delete Home Connect deprecated binary door sensor (#142490) 2025-04-07 20:23:38 +02:00
J. Diego Rodríguez Royo 5ca0441771
Do not fetch disconnected Home Connect appliances (#142200)
* Do not fetch disconnected Home Connect appliances

* Apply suggestions

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update docstring

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-04-04 09:56:40 +02:00
J. Diego Rodríguez Royo 09f6246d1b
Dynamically add Home Connect event sensors (#141198)
* Dynamically add Home Connect event sensors to HA

* Add and remove listeners on paired and depaired events

* Apply suggestion

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update test

* Adjust English

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-03-29 12:53:34 +01:00
J. Diego Rodríguez Royo d9d74107fe
Improve some Home Connect deprecations (#141508) 2025-03-27 10:18:30 +01:00
J. Diego Rodríguez Royo b5910dd7d6
Move Home Connect alarm clock entity from time platform to number platform (#141400)
* Move alarm clock entity from time platform to number platform

* Deprecate alarm clock time entity

* Don't update unique id

* Fix tests

* Fixable issues

* improvement

* Make the issues persistent
2025-03-26 14:46:07 +01:00
J. Diego Rodríguez Royo d8a5881eaa
Home Connect test improvements (#141135)
* Home Connect test improvements

* Remove `appliance_ha_id` fixture in favour of `appliance` fixture
2025-03-23 11:33:55 +01:00
J. Diego Rodríguez Royo 9d9b352631
Move Home Connect service actions to a services.py (#141100)
* Move Home Connect service actions to a actions.py

* Rename actions.py to services.py

* Move more fuctions to module level
2025-03-22 12:35:46 +01:00
J. Diego Rodríguez Royo 2ec80fd1ca
Fix initial fetch of Home Connect appliance data to handle API rate limit errors (#139379)
* Fix initial fetch of appliance data to handle API rate limit errors

* Apply comments

* Delete stale function

* Handle api rate limit error at options fetching

* Update appliances after stream non-breaking error

* Always initialize coordinator data

* Improve device update

* Update test description

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-03-20 09:39:28 +01:00
J. Diego Rodríguez Royo 8afd9c0c44
Handle API rate limit error on Home Connect entities fetch (#139384)
* Handle API rate limit error on entities fetch

* Apply suggestions

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add decorator (does not work)

* Fix decorator

* Apply suggestions

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add test

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-03-19 18:53:14 +01:00
J. Diego Rodríguez Royo 940625505f
Handle non documented options at Home Connect select entities (#140608)
* Allow non documented options at select entities

* Don't allow undocumented options
2025-03-15 14:17:16 +01:00
J. Diego Rodríguez Royo 1766f87620
Refresh Home Connect token during config entry setup (#140233)
* Refresh token during config entry setup

* Test 500 error

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-03-09 21:59:09 +01:00
J. Diego Rodríguez Royo 3dd1fadc7d
Check operation state on Home Connect program sensor update (#140011)
Check operation state on program sensor update
2025-03-07 01:50:06 +01:00
Martin Hjelmare c671862d3f
Improve Home Connect appliances test fixture (#139787)
Improve Home Connect appliances fixture
2025-03-05 00:45:58 +01:00
Martin Hjelmare e8099fd3b2
Fix home connect available (#139760)
* Fix home connect available

* Extend and clarify test

* Do not change connected state on stream interrupted
2025-03-04 19:26:20 +01:00
J. Diego Rodríguez Royo 973fee9fe1
Delete refresh after a non-breaking error at event stream at Home Connect (#139740)
* Delete refresh after non-breaking error

And improve how many time does it take to retry to open stream

* Update tests
2025-03-04 11:07:44 +01:00
J. Diego Rodríguez Royo cc18ec2de8
Fix fetch options error for Home connect (#139392)
* Handle errors when obtaining options definitions

* Don't fetch program options if the program key is unknown

* Test to ensure that available program endpoint is not called on unknown program
2025-02-27 12:00:14 +01:00
J. Diego Rodríguez Royo 42f55bf271
Small improvements to Home Connect strings and icons (#139386)
* Small improvements to Home Connect strings and icons

* Fix test
2025-02-26 21:02:00 +01:00
J. Diego Rodríguez Royo 5be7f49146
Improve Home Connect oven cavity temperature sensor (#139355)
* Improve oven cavity temperature translation

* Fetch cavity temperature unit

* Handle generic Home Connect error

* Improve test clarity
2025-02-26 18:11:40 +01:00
J. Diego Rodríguez Royo 8644fb1887
Add missing Home Connect context at event listener registration for appliance options (#139292)
* Add missing context at event listener registration for appliance options

* Add tests
2025-02-25 23:05:52 +01:00
J. Diego Rodríguez Royo b86bb75e5e
Add missing exception translation to Home Connect (#139218)
Add missing exception translation
2025-02-24 23:25:24 +01:00
J. Diego Rodríguez Royo 1cd82ab8ee
Deprecate Home Connect command actions (#139093)
* Deprecate command actions

* Improve issue description

* Improve issue description

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-23 16:18:20 +01:00
J. Diego Rodríguez Royo 6ebda9322d
Fetch allowed values for select entities at Home Connect (#139103)
Fetch allowed values for enum settings
2025-02-23 13:54:02 +01:00
J. Diego Rodríguez Royo 5b0eca7f85
Add select setting entities to Home Connect (#138884)
* Add select setting entities

* Improvements
2025-02-23 01:42:25 +01:00
J. Diego Rodríguez Royo 98c6a578b7
Add buttons to Home Connect (#138792)
* Add buttons

* Fix stale documentation
2025-02-22 21:14:11 +01:00
J. Diego Rodríguez Royo 92788a04ff
Add entities that represent program options to Home Connect (#138674)
* Add program options as entities

* Use program options constraints

* Only fetch the available options on refresh

* Extract the option definitions getter from the loop

* Add the option entities only when it is required

* Fix typo
2025-02-22 21:08:39 +01:00
J. Diego Rodríguez Royo 8e887f550e
Add connectivity binary sensor to Home Connect (#138795)
Add connectivity binary sensor
2025-02-18 22:08:40 +01:00
J. Diego Rodríguez Royo c75707ec79
Use correct inputs for relative time and duration options (#138619) 2025-02-16 00:29:38 +01:00
J. Diego Rodríguez Royo 78c4d815ce
Fix home connect coffe-milk ratio option (#138593)
* Fix home connect milk ratio option

* Use enumeration instead of number selector for coffee-milk ratio
2025-02-15 20:10:27 +01:00
J. Diego Rodríguez Royo 2bfe96dded
Add Home Connect action with recognized programs and options (#130662)
* Added recognized options to Home Connect actions

* Fix ruff

* Fix strings.json

* Fix dishwasher typo

* Improved test_bsh_key_transformations

* Add missing return types

* Added descriptions

* Remove custom options

* Fixes

* Merge the 4 services (select, start, set options for active or selected program)

And deprecate the original ones

* Delete stale snapshots

* Clean up logic after service validation

* Make deprecated actions issues fixable

And delete issue on entry unload

* Fixes and improvements

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Improvements

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Fix name and descriptions

* Add `affects_to` to strings and service.yaml

* Add missing periods at strings

* Fix

Co-authored-by: Norbert Rittel <norbert@rittel.de>

* Add tests to check if the flow removes the deprecated action issue

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Norbert Rittel <norbert@rittel.de>
2025-02-14 20:21:01 +01:00
J. Diego Rodríguez Royo 4a8c96471b
Raise `ConfigEntryAuthFailed` at Home Connect update auth error (#136953)
* Raise `ConfigEntryAuthFailed` on `UnauthorizedError` handling

* Implement reauth flow

* Add tests

* Remove unnecessary code from tests
2025-02-09 12:36:08 +01:00
J. Diego Rodríguez Royo 91dbe3092f
Only allow single Home Connect config entry (#137088)
* Make Home Connect config entry unique

* Use unique ID for Home connect config entry

* Remove unnecessary code

* Revert "Use unique ID for Home connect config entry"

This reverts commit 4241317469.

* Added tests
2025-02-08 16:29:00 +01:00
J. Diego Rodríguez Royo 30314ca32b
Add and delete Home Connect devices on CONNECTED/PAIRED and DEPAIRED events (#136952)
* Add and delete devices on CONNECT/PAIRED and DEPAIRED events

* Simplify device depairing

* small fixes

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add always the devices

* kind of revert changes

to simplify the entity fetch and removing on connected/paired and depaired

* cache `ha_id`

* Fix typo

* Remove unnecessary device info at HomeConnectEntity

* Move common code of each platform to `common.py`

* Added docstring to clarify usage

* Apply suggestions

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-02 02:02:45 +01:00
J. Diego Rodríguez Royo 147b5f549f
Fetch current active and selected programs at Home Connect (#136948)
* Fetch current active and selected programs

* Intialize HomeConnectEntity first at SelectProgramEntity

* Use the right exception

* Use active/selected program from `get_all_programs`

This will allow us to reduce the number of requests that we need to perform to get all the data ready (only one requests vs. three requests)

* Remove no longer required mocks

* Fix
2025-02-02 00:12:26 +01:00
J. Diego Rodríguez Royo 63ab13681a
Home Connect entities availability based on the connected state of the appliance (#136951)
* Base the entity availability on the connected state of the appliance

* cache `ha_id`

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Inlcude coordinator `available` property at entity

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-01 12:46:49 +01:00
J. Diego Rodríguez Royo efcfd97d1b
Filter programs by execution type at select program entities at Home Connect (#136950)
* Filter programs by execution type at select program entities

* Suggestions and improvements

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Use function and translation key at select program entity description

* Fix select entity description docstring

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-01 12:06:39 +01:00
J. Diego Rodríguez Royo 285a0a6c81
Fix Home Connect actions keys (#137027)
* Fix actions

* Use coerce

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-01 10:47:27 +01:00
J. Diego Rodríguez Royo 4d4e11a0eb
Fetch all programs instead of only the available ones at Home Connect (#136949)
Fetch all programs instead of only the available ones
2025-01-31 08:26:57 +01:00
J. Diego Rodríguez Royo b637129208
Migrate from homeconnect dependency to aiohomeconnect (#136116)
* Migrate from homeconnect dependency to aiohomeconnect

* Reload the integration if there is an API error on event stream

* fix typos at coordinator tests

* Setup config entry at coordinator tests

* fix ruff

* Bump aiohomeconnect to version 0.11.4

* Fix set program options

* Use context based updates at coordinator

* Improved how `context_callbacks` cache is invalidated

* fix

* fixes and improvements at coordinator

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove stale Entity inheritance

* Small improvement for light subscriptions

* Remove non-needed function

It had its purpose before some refactoring before the firs commit, no is no needed as is only used at HomeConnectEntity constructor

* Static methods and variables at conftest

* Refresh the data after an event stream interruption

* Cleaned debug logs

* Fetch programs at coordinator

* Improvements

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Simplify obtaining power settings from coordinator data

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove unnecessary statement

* use `is UNDEFINED` instead of `isinstance`

* Request power setting only when it is strictly necessary

* Bump aiohomeconnect to 0.12.1

* use raw keys for diagnostics

* Use keyword arguments where needed

* Remove unnecessary statements

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-01-30 02:42:41 +01:00
epenet b43379be7d
Standardize `helpers.xxx_registry` imports (#136688)
Standardize registry imports
2025-01-28 08:48:34 +01:00