Commit graph

103 commits

Author SHA1 Message Date
epenet
2699eb62bd
Rename DOMAIN_DATA HassKey constants to DATA_COMPONENT (#126746)
* Rename DOMAIN_DATA HassKey constant to DATA

* DATA -> DATA_COMPONENT
2024-09-25 15:53:58 +02:00
epenet
f7004188d2
Use HassKey in group (#126321)
* Use HassKey in group

* Adjust

* Improve
2024-09-21 13:11:57 +02:00
Jan Bouwhuis
66faeb28d7
Fix late group platform registration (#119789)
* Fix late group platform registration

* use a callback instead

* Run thread safe

* Not working domain filter

* Also update if a group has nested group's

* Only update if the siingle state type key could change

* Avoid redundant regisister hooks

* Use set, add comment

* Revert changes

* Keep callback cleanup const

* Cleanup after dependencies

* Preimport and cleanup excluded domains

* Revert test changes as we assume early set up now

* Migrate alarm_control_panel

* Migrate climate

* Migrate cover

* Migrate device_tracker

* Migrate lock

* Migrate media_player

* Migrate person

* Migrate plant

* Migrate vacuum

* Migrate water_heater

* Remove water_heater group_pre_import

* Use Platform enum if possible

* Also use platform enum for excluded domains

* Set registry to self._registry

* move deregistering call back hook to async_added_to_hass

* Add comment

* Do no pass mutable reference to EXCLUDED_DOMAINS

* Remove unneeded type hint
2024-06-18 20:01:16 +02:00
J. Nick Koston
aa85e59c6f
Migrate group to use shorthand attributes for name and icon (#115244) 2024-04-08 11:05:56 -10:00
J. Nick Koston
9a6804b5d7
Adjust config flow pre-import comment in group (#113702) 2024-03-17 14:28:29 -10:00
Sid
6ee273a548
Clean up unneeded ruff noqa directives (#113616) 2024-03-16 09:48:37 -10:00
J. Nick Koston
702488062b
Move group config flow pre-import to its init (#113564) 2024-03-15 18:44:10 -10:00
J. Nick Koston
bb667abd51
Cleanup some circular imports in group (#113554) 2024-03-15 15:45:43 -10:00
J. Nick Koston
c3b5e819c5
Fix group loading too late resulting in incorrect state (#113262) 2024-03-13 19:18:15 -10:00
Joost Lekkerkerker
761933acfe
Improve lists in integrations [G-H] (#113168) 2024-03-13 17:25:27 +01:00
Marc Mueller
25237e0377
Replace EventType with Event [a-g] (#112739) 2024-03-08 19:35:17 +01:00
Marc Mueller
8809d3aa88
Add empty line after module docstring [g-i] (#112699) 2024-03-08 08:52:48 -05:00
J. Nick Koston
0d4c82b54d
Convert Integration platforms processors where nothing is awaited to callbacks (#110825)
Convert Integration platforms processors where nothing is awaited callbacks
2024-02-17 20:49:47 -05:00
J. Nick Koston
0695bf8988
Move group helpers into their own module (#106924)
This gets rid of the legacy need to use bind_hass, and
the expand function no longer looses typing.
2024-01-04 17:34:56 +01:00
Erik Montnemery
dd5a48996a
Keep capabilities up to date in the entity registry (#101748)
* Keep capabilities up to date in the entity registry

* Warn if entities update their capabilities very often

* Fix updating of device class

* Stop tracking capability updates once flooding is logged

* Only sync registry if state changed

* Improve test

* Revert "Only sync registry if state changed"

This reverts commit 1c52571596c06444df234d4b088242b494b630f2.

* Avoid calculating device class twice

* Address review comments

* Revert using dataclass

* Fix unintended revert

* Add helper method
2023-12-13 17:27:26 +01:00
Erik Montnemery
e880ad7bda
Improve reload of legacy groups (#102925)
* Improve reload of legacy groups

* Simplify reload

* Get rid of inner function

* Fix logic when there are no group.group entities

* Update homeassistant/components/group/__init__.py

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

* Fix type hints

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-11-01 00:18:21 +01:00
Erik Montnemery
03d3a87f23
Small cleanup of legacy groups (#102918)
* Small cleanup of legacy groups

* Update tests which create groups
2023-10-28 17:16:41 +02:00
J. Nick Koston
393544b3e7
Make group _update_at_start a callback (#102286) 2023-10-18 22:41:39 -10:00
Erik Montnemery
df73850f56
Move definition of attributes excluded from history to entity classes (#100430)
* Move definition of attributes excluded from history to entity classes

* Revert change which should be in a follow-up PR

* Fix sun unrecorded attributes

* Fix input_select unrecorded attributes
2023-09-21 15:02:47 +02:00
Erik Montnemery
3c10d0e1f7
Deduplicate entities derived from GroupEntity (#98893) 2023-08-23 19:20:58 +02:00
Marc Mueller
2618bfc073
Use EventType for state changed [core] (#97115) 2023-07-23 18:10:03 -05:00
J. Nick Koston
fca40be5df
Small cleanups to expand_entity_ids (#96585) 2023-07-18 09:41:37 +02:00
Franck Nijhof
3e85a29b86
Move overlapping pylint rules to ruff, disable mypy overlap (#94359) 2023-06-27 17:42:46 +02:00
G Johansson
b3c5c6ae9c
Add sensor to group (#83186) 2023-01-24 20:12:27 +01:00
G Johansson
68dd2802a1
Add remove entity in group.set service (#79401)
* Group set remove entities

* simplify

* Add test

* Fix test
2023-01-23 15:00:40 +01:00
Michaël Arnauts
7142b4ecac
Fixes some grammar mistakes (#84283) 2022-12-20 11:10:31 +01:00
epenet
b4afb1cb6b
Make use of generic EntityComponent (#78492) 2022-09-15 11:53:00 +02:00
epenet
5cccb24830
Improve type hints in group (#78350) 2022-09-14 11:36:28 +02:00
Martin Hjelmare
c05905ebda
Remove callback decorator from coroutine functions (#75626)
* Remove callback decorator from coroutine functions

* Remove some more callback decorators
2022-07-22 19:09:02 +02:00
J. Nick Koston
cd03c49fc2
Wait for config entry platform forwards (#73806) 2022-07-09 17:27:42 +02:00
J. Nick Koston
db9c242723
Speed up creating group entities from YAML (#73649)
* Speed up creating group entities from YAML

- Pass all the entities to async_add_entities in one call to
  avoid multiple levels of gather

* Speed up creating group entities from YAML

- Pass all the entities to async_add_entities in one call to
  avoid multiple levels of gather

* Update homeassistant/components/group/__init__.py

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

* Update homeassistant/components/group/__init__.py

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

* Update homeassistant/components/group/__init__.py

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

* Update homeassistant/components/group/__init__.py

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

* typing

* unbreak

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-06-21 18:56:32 +02:00
J. Nick Koston
236d8aa277
Avoid recording static attributes for group entities (#71256) 2022-05-03 13:22:49 -05:00
Erik Montnemery
ae9c2df691
Return unsubscribe callback from start.async_at_start (#69083)
* Return unsubscribe callback from start.async_at_start

* Update calling code
2022-04-01 23:34:36 +02:00
Jason Hunter
94df0844b3
Add lock groups (#68857) 2022-03-29 17:07:23 -07:00
Franck Nijhof
01980f0445
Add switch groups (#68528) 2022-03-28 12:27:26 +02:00
Erik Montnemery
1b955970f8
Allow hiding and unhiding group members (#68192) 2022-03-22 12:14:34 +01:00
Erik Montnemery
e02c21a4de
Remove unused constant from group (#67910) 2022-03-09 16:45:09 +01:00
Erik Montnemery
a9cc2d2322
Add config flow for cover, fan, light and media_player groups (#67660)
* Add options flow support to HelperConfigFlowHandler

* Add config flow for cover, fan, light and media_player groups

* Update according to review comments

* Update translation strings

* Update translation strings

* Copy schema before adding suggested values
2022-03-07 13:05:04 +01:00
Erik Montnemery
1ebe82fc4b
Fix reload of media player groups (#67653) 2022-03-04 14:17:43 -08:00
epenet
bd859f428a
Add setup type hints to group (#64002)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-13 12:25:20 +01:00
Marc Mueller
4e2cd1bec0
Update typing (2) [a-i] (#63923) 2022-01-11 21:23:26 +01:00
Erik Montnemery
8bf8709d99
Simplify groups (#63477)
* Simplify group

* Rename async_update to async_update_group_state and mark it as callback

* Simplify _async_start
2022-01-07 08:58:45 +01:00
Sebastian Lövdahl
bc3bf2ffe3
Use Platform constants all over the place 1/3 (#62952) 2021-12-28 21:13:20 +01:00
epenet
656d383ba6
Ensure service calls are typed [e-g] (#62912)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-28 14:23:01 +01:00
Marc Mueller
7063c05127
Use assignment expressions 33 (#58717) 2021-10-30 16:32:41 +02:00
J. Nick Koston
def7c80e71
Add support for fan groups (#57941)
* Add support for fan groups

* dry

* dry

* fix refactor error

* tweaks

* wip

* tweaks

* tweaks

* fix

* fixes

* coverage

* tweaks
2021-10-26 10:32:49 +02:00
Marc Mueller
12d1dfdaf9
Use assignment expressions 10 (#57791) 2021-10-15 21:36:03 +02:00
Brian Egge
e638e5bb42
Add component for binary sensor groups (#55365)
* Add component for binary sensor groups
https://github.com/home-assistant/home-assistant.io/pull/19239

* Accidental push over prior commit

* Add test for any case

* Add unavailable attribute and tests for unique_id

* Added tests for attributes

link to documentation: https://github.com/home-assistant/home-assistant.io/pull/19297
2021-09-13 15:28:37 +02:00
Marc Mueller
c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
Franck Nijhof
c1d5638739
Remove HomeAssistantType alias from entity components - Part 2 (#48468) 2021-03-29 13:24:56 -10:00