532 Commits

Author SHA1 Message Date
Erik Montnemery
4b34d1bbb5
Merge config subentry feature branch to dev (#136121)
* Reapply "Add support for subentries to config entries" (#133470) (#136061)

* Reapply "Add support for subentries to config entries" (#133470)

This reverts commit ecb3bf79f32a2e25d141ff467e5958826ed9fc3a.

* Update test snapshot

* Add config subentry support to device registry (#128157)

* Add config subentry support to device registry

* Apply suggestions from code review

* Update syrupy serializer

* Update snapshots

* Address review comments

* Allow a device to be connected to no or a single subentry of a config entry

* Update snapshots

* Revert "Allow a device to be connected to no or a single subentry of a config entry"

This reverts commit ec6f613151cb4a806b7961033c004b71b76510c2.

* Update test snapshots

* Bump release version in comments

* Rename config_subentries to config_entries_subentries

* Add config subentry support to entity registry (#128155)

* Add config subentry support to entity registry

* Update syrupy serializer

* Update snapshots

* Update snapshots

* Accept suggested changes

* Clean registries when removing subentry (#136671)

* Clean up registries when removing subentry

* Update tests

* Clean up subentries from deleted devices when removing config entry (#136669)

* Clean up subentries from deleted devices when removing config entry

* Move

* Add config subentry support to entity platform (#128161)

* Add config subentry support to entity platform

* Rename subentry_id to config_subentry_id

* Store subentry type in subentry (#136687)

* Add reconfigure support to config subentries (#133353)

* Add reconfigure support to config subentries

* Update test

* Minor adjustment

* Rename supported_subentry_flows to supported_subentry_types

* Address review comments

* Add subentry support to kitchen sink (#136755)

* Add subentry support to kitchen sink

* Add subentry reconfigure support to kitchen_sink

* Update kitchen_sink tests with subentry type stored in config entry

* Update kitchen_sink

* Update kitchen_sink

* Adjust kitchen sink tests

* Fix hassfest

* Apply suggestions from code review

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

* Improve docstrings and strings.json

---------

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

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

* Update snapshots

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2025-02-10 16:40:07 +01:00
puddly
b3205ea1cd
Do not rely on pyserial for port scanning with the CM5 + ZHA (#137585)
Do not rely on pyserial for port scanning with the CM5
2025-02-07 16:33:40 +01:00
puddly
2e8bc56be4
Keep track of addons and integrations when determining HA radio firmware type (#134598)
* Replace `FirmwareGuess` with `FirmwareInfo` with owner tracking

* Fix up config flow

* Account for OTBR addon existing independent of integration

* Fix remaining unit tests

* Add some tests for ownership

* Unit test `get_zha_firmware_info`

* ZHA `homeassistant_hardware` platform

* OTBR `homeassistant_hardware` platform

* Rework imports

* Fix unit tests

* Add OTBR unit tests

* Add hassfest exemption for `homeassistant_hardware` and `otbr`

* Invert registration to decouple the hardware integration

* Revert "Add hassfest exemption for `homeassistant_hardware` and `otbr`"

This reverts commit c8c6e7044f005239d11fc561cca040a6d89a9b39.

* Fix circular imports

* Fix unit tests

* Address review comments

* Simplify API a little

* Fix `| None` mypy issues

* Remove the `unregister_firmware_info_provider` API

* 100% coverage

* Add `HardwareInfoDispatcher.register_firmware_info_callback`

* Unit test `register_firmware_info_callback` (zha)

* Unit test `register_firmware_info_callback` (otbr)

* Update existing hardware helper tests to use the new function

* Add `async_` prefix to helper function names

* Move OTBR implementation to a separate PR

* Update ZHA diagnostics snapshot

* Switch from `dict.setdefault` to `defaultdict`

* Add some error handling to `iter_firmware_info` and increase test coverage

* Oops
2025-02-06 14:46:07 -05:00
epenet
d0a188b86d
Standardize homeassistant imports in component tests (m-z) (#136807) 2025-01-29 08:57:57 +01:00
epenet
64500e837f
Use new ServiceInfo location in component tests (part 1) (#136057) 2025-01-20 13:09:34 +01:00
Marc Mueller
6690b121c0
Fix unicode chars in zha tests (#135954) 2025-01-18 13:47:30 -10:00
Marc Mueller
8a3ef101e6
Replace additional deprecated USBServiceInfo imports (#135953) 2025-01-18 17:43:07 -06:00
epenet
e83ee00af8
Move UsbServiceInfo to service_info helpers (#135663)
* Move UsbServiceInfo to service_info helpers

* Adjust components
2025-01-15 15:10:25 +01:00
epenet
8c13daf6d9
Move SsdpServiceInfo to service_info helpers (#135661)
* Move SsdpServiceInfo to service_info helpers

* docstring

* Move string constants

* Adjust components
2025-01-15 15:00:27 +02:00
puddly
eff440d2a8
Fix ZHA "referencing a non existing via_device" warning (#135008) 2025-01-08 10:51:57 +01:00
puddly
90265e2afd
Move SiLabs firmware probing helper from ZHA into homeassistant_hardware (#131586)
* Move firmware probing helper out of ZHA and into hardware

* Add a unit test
2025-01-03 10:57:39 -05:00
Erik Montnemery
ecb3bf79f3
Revert "Add support for subentries to config entries" (#133470)
Revert "Add support for subentries to config entries (#117355)"

This reverts commit ad15786115673c5b3fe40ea2f5d61b4b896f433e.
2024-12-18 13:51:05 +01:00
Erik Montnemery
ad15786115
Add support for subentries to config entries (#117355)
* Add support for subentries to config entries

* Improve error handling and test coverage

* Include subentry_id in subentry containers

* Auto-generate subentry_id and add optional unique_id

* Tweak

* Update tests

* Fix stale docstring

* Address review comments

* Typing tweaks

* Add methods to ConfigEntries to add and remove subentry

* Improve ConfigSubentryData typed dict

* Update test snapshots

* Adjust tests

* Fix unique_id logic

* Allow multiple subentries with None unique_id

* Add number of subentries to config entry JSON representation

* Add subentry translation support

* Allow integrations to implement multiple subentry flows

* Update translations schema

* Adjust exception text

* Change subentry flow init step to user

* Prevent creating a subentry with colliding unique_id

* Update tests

* Address review comments

* Remove duplicaetd unique_id collision check

* Remove change from the future

* Improve test coverage

* Add default value for unique_id
2024-12-12 20:16:18 +01:00
epenet
b4d01dfd0c
Adjust scope of zha global quirks fixture (#132463) 2024-12-06 10:11:52 +01:00
Sid
9e98e446a2
Bump ruff to 0.8.0 (#131273) 2024-11-22 16:53:26 +01:00
puddly
50fdbe9b3b
Generic ZHA Zeroconf discovery (#126294) 2024-11-21 20:50:21 +01:00
puddly
51e592f450
Add informative header to ZHA update entity release notes (#130099) 2024-11-21 10:17:44 +01:00
puddly
390b83a963
Bump ZHA dependencies (#130563) 2024-11-15 09:55:22 +01:00
puddly
245fc246d8
Ensure ZHA setup works with container installs (#130470) 2024-11-14 10:13:29 +01:00
Marc Mueller
20a367b243
Fix zha tests for Python 3.13 (#129241) 2024-10-27 00:18:21 +02:00
Marc Mueller
44449d8e72
Fix zha test RuntimeWarnings (#128975) 2024-10-22 18:05:40 +02:00
G Johansson
cdfec7ebb4
Implement new state property for alarm_control_panel which is using an enum (#126283)
* Alarm state from enum

* Fixes

* Set final

* Fix rebase

* Test const

* Fix breaking version

* Fix other for alarm_control_panel

* Fix integrations

* More

* More

* More

* More

* Fix zha

* Replace _attr_state

* Fix alarm_control_panel

* Fix tests

* Fixes

* Mods

* Change some

* More

* More

* More

* Tests

* Last tests

* Return enum

* Fix zha

* Remove not needed check

* Fix wording

* Fix homekit

* Mod prometheus

* Fix mypy

* Fix homekit

* Fix ifttt
2024-10-21 22:54:27 +02:00
Mike Degatano
ad55c9cc19
Remaining addon management to aiohasupervisor (#128484)
* Move set addon options to aiohasupervisor

* addon stats to aiohasupervisor and test fixes

* addon changelogs to aiohasupervisor

* Raise correct error for library in tests

* Cache client in instance property

* Use singleton method rather then HassIO instance method

* Mock supervisor client in more tests
2024-10-21 16:41:00 +02: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
David F. Mulcahey
065577c9ca
Keep ZHA entity enabled setting in sync with lib (#125472)
* Add ability to enable / disable entities in the ZHA lib

* disable entities at startup that are not enabled in HA

* fix IEEE lookup

* wrap in async_on_unload

* add test and correct lookup
2024-10-17 07:16:48 -04:00
puddly
f6270d9cfc
Bump ZHA dependencies (#128539)
* Bump ZHA dependencies

* Remove unused ZHA color modes

* Rename `cluster` to `ota_cluster` in update tests to unshadow `cluster` in `endpoint_reply`

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-10-16 22:15:00 -04:00
G Johansson
666e8e133e
Cover state is enum (#127144)
* Change light state to use enum

* Adjust cover tests

* Update cover

* Fix covers

* Some tests

* More tests

* Fix tests

* Fix
2024-10-08 18:39:04 +02:00
puddly
0a44c9456c
Bump ZHA to 0.0.34 (#126766) 2024-09-25 18:44:51 +02:00
G Johansson
93aade6e8e
Change lock state to an enum (#126379)
* Add new LockState enum for lock states

* Add rest

* Fix insteon tests

* Fix mqtt tests

* Fix tesla_fleet

* Revert back ST_STATE_LOCKED

* Add back constant
2024-09-24 12:30:50 +02:00
Erik Montnemery
d82bff1bc2
Index config entry discovery_keys by discovery domain (#126563)
* Index config entry discovery_keys by discovery domain

* Add new signal

* Update tests

* Update homeassistant/config_entries.py

Co-authored-by: J. Nick Koston <nick@koston.org>

* Fix imports

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 21:48:11 +02:00
Erik Montnemery
b2982c18bb
Reinitialize zeroconf discovery flow on unignore (#125753)
* Reinitialize zeroconf discovery flow on unignore

* Adjust tests

* Improve comments

* Fix logic for updating discovery keys

* Add tests

* Use mock_config_flow helper in new config_entries test

* Add discovery_keys attribute to ConfigEntry

* Update zeroconf rediscovery

* Change type of ConfigEntry.discovery_keys

* Update tests

* Fix DiscoveryKey.from_json_dict and add tests

* Fix test

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-09-23 16:49:21 +02:00
David F. Mulcahey
e81a1f7acf
Add config to ZHA to allow disabling polling of mains powered devices when the network is started (#125473) 2024-09-23 14:34:24 +02:00
puddly
ba7ca84899
Remove unused keys from the ZHA config schema (#125710) 2024-09-13 11:34:06 -04:00
epenet
af6434a533
Add alias to DOMAIN import in tests [n-z] (#125581) 2024-09-09 15:14:05 +02:00
puddly
6467c8d611
Bump ZHA to 0.0.32 (#124804)
* Always prefer XY color mode in ZHA

Remove a few more HS remnants

* Use new ZHA OTA format

* Bump ZHA to 0.0.32

* Fix existing OTA unit tests

* Fix schema conversion test to account for new command parameters

* Update snapshot with new `zcl_type` kwarg

* Migrate existing entities to icon translations

* Remove "no longer compatible" test

* Test that the library release summary is correctly exposed to ZHA

* Revert "Always prefer XY color mode in ZHA"

This reverts commit 8fb7789ea8ddb6ed2a287aed5010374c0452f6c9.

* Test `release_notes`, not `release_summary`
2024-08-30 14:48:09 +02:00
epenet
e6fc34325d
Improve type hints in zha tests (#123926) 2024-08-14 15:39:52 +02:00
Joakim Plate
f53da62026
Extend ZHA attribute diagnostic information (#123199)
* Include full attribute representation in in data

* Extend attribute diagnostics for zha
2024-08-10 19:25:21 +02:00
puddly
97410474f5
Bump ZHA library to 0.0.29 (#123464)
* Bump zha to 0.0.29

* Pass the Core timezone to ZHA

* Add a unit test
2024-08-09 10:31:55 -04:00
Joakim Plate
f51cc8fe12
Change zha diagnostic to snapshot (#123198) 2024-08-05 19:02:07 +02:00
David F. Mulcahey
5446dd92a9
Make ZHA load quirks earlier (#123027) 2024-08-02 12:22:36 +02:00
David F. Mulcahey
bd3f0da385
Bump ZHA lib to 0.0.24 and universal-silabs-flasher to 0.0.22 (#122812)
* Bump ZHA lib to 0.0.24

* update for node state change for coordinator data

* bump flasher
2024-07-29 18:16:54 -04:00
epenet
9514a38320
Fix implicit-return rule in zha tests (#122772) 2024-07-29 15:22:08 +02:00
J. Nick Koston
1879db9f8f
Revert to using call_soon for event triggers and state changed event trackers (#122735) 2024-07-29 11:45:39 +02:00
David F. Mulcahey
342e6a503a
Fix group operations in ZHA websocket API (#121881) 2024-07-14 03:25:15 +02:00
puddly
020961d2d8
Fix ZHA select platform state restoration (#121646)
* Ensure `select` entities do not restore state if they were unavailable

* Add a unit test
2024-07-10 10:55:27 -04:00
epenet
b0837dd98f
Use service_calls fixture in zha tests (#120996) 2024-07-10 15:06:49 +02:00
David F. Mulcahey
0aa6a17da8
Prevent entity creation errors from causing all entities for a platform from loading in ZHA (#121631) 2024-07-10 08:31:24 +02:00
puddly
b754f03c11
ZHA as an external library (#120190)
Co-authored-by: David Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2024-07-08 20:18:30 +02:00
Marc Mueller
f11b316dac
Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
epenet
3e9d25f81d
Add missing argument type hints to component tests (#119671) 2024-06-14 09:26:46 +02:00