Commit graph

1054 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
1adaaf49cc
Add specific EntityDescription to describe device tracker entities (#126586)
* Add TrackerEntityDescription to describe tracker entities

* Improve

* Adjust components

* Add ScannerEntityDescription

* Simplify

* Revert

* Set TrackerEntity default source type to SourceType.GPS

* Fix rebase

* Adjust default

* Remove source_type from EntityDescription

* Fix rebase

* Docstring

* Remove BaseTrackerEntityDescription
2024-09-25 07:28:29 +02:00
epenet
2a0c779a02
Avoid raw string in device_tracker source_type (#126601) 2024-09-24 23:01:47 +02:00
epenet
3995d001ec
Set default source_type on TrackerEntity and ScannerEntity (#126648)
* Set default source_type on TrackerEntity and ScannerEntity

* Add samples

* Two more

* Adjust tests
2024-09-24 20:56:01 +02:00
epenet
9dc84bfdca
Add shorthand attributes to device_tracker entities (#126599)
* Add shorthand attributes to device_tracker entities

* Simplify

* Update config_entry.py

* Update config_entry.py

* Update device_tracker.py

* Update device_tracker.py
2024-09-24 15:21:33 +02:00
epenet
83672ee28b
Use HassKey in device_tracker (#126339) 2024-09-21 11:38:27 +02:00
Erik Montnemery
fce2e21c9f
Update icons.json to new service schema part 1 (#124768) 2024-08-28 13:47:02 +02:00
epenet
0bb8c4832d
Enable raise-within-try (TRY301) rule in ruff (#123351) 2024-08-12 09:16:33 +02:00
J. Nick Koston
2b9bddc3fc
Make device_tracker fallback defaults cached_property (#121260) 2024-07-05 09:25: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
Matthias Alphart
171707e8b7
Translation support for device automation extra fields (#115892)
* Translation support for device trigger extra fields

* Move extra_fields translations to backend
2024-06-12 14:10:02 +02:00
Marc Mueller
bc2ee96cae
Remove quotes surrounding annotations (#117817) 2024-05-20 22:06:58 +02:00
Sid
2cc916db6d
Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
Jan Bouwhuis
986df70fe3
Refactor group setup (#116317)
* Refactor group setup

* Add @callback decorator and remove commented out code

* Keep set, add default on state
2024-04-28 16:32:17 +02:00
J. Nick Koston
ca5ed274cb
Deprecate calling async_listen and async_listen_once with run_immediately (#115169) 2024-04-08 10:07:54 -10:00
Marc Mueller
289700dcf5
Improve generic event typing [device_tracker] (#114730) 2024-04-06 14:01:05 +02:00
Sid
0d66d298ec
Enable Ruff RET504 (#114528)
* Enable Ruff RET504

* fix test

* Use noqa instead of cast

* fix sonos RET504

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-04-06 11:07:37 +02:00
Marc Mueller
816ce116bf
Remove unnecessary functools.cached_property backport (#114239) 2024-04-04 11:24:26 +02:00
J. Nick Koston
742643936f
Migrate legacy device_tracker task creation to use eager_start (#114703)
Many of these can finish synchronously without being scheduled on the loop
2024-04-03 12:12:52 +02:00
Phil Bruckner
ea2bb24484
Remove old device tracker device cleanup code & test (#114668) 2024-04-02 15:23:59 -05:00
Marc Mueller
911a31f860
Use SignalType to improve typing [core] (#114298) 2024-03-27 14:25:02 +01:00
J. Nick Koston
6371b344b9
Ensure discovery can setup legacy device tracker platforms (#114101) 2024-03-24 07:38:05 -10:00
J. Nick Koston
39c44ad5b7
Move setup of legacy device_tracker see service to legacy setup task (#114043)
* Move setup of legacy device_tracker see service to legacy setup task

device_tracker can setup synchronously now if there are no legacy
platforms that have to be import to validate the config

The see service is not useful until at least one legacy platform
is loaded so there is no reason to wait for it in the base
setup.

* collapse
2024-03-23 09:40:34 +01:00
J. Nick Koston
7b67a486bd
Migrate legacy device_tracker shutdown to use run_immediately (#113835)
A call_soon is not needed here
2024-03-19 14:07:57 -10:00
J. Nick Koston
c615b52840
Refactor integration startup time to show wall clock time (#113707)
* Refactor setup time tracking to exclude time waiting on other operations

We now exclude the import time and th time waiting on
base platforms to setup from the setup times

* tweak

* tweak

* tweak

* tweak

* adjust

* fixes

* fixes

* preen

* preen

* tweak

* tweak

* adjust

* tweak

* reduce

* do not count integrtion platforms against their parent integration

* handle legacy tts platforms

* stt as well

* one more wait

* use the same pattern in all the legacy

* fix tts and stt legacy

* fix

* fix

* reduce

* preen

* entity comp does not wait for platforms

* scene blocks as well

* fix test

* test fixes

* coverage

* coverage

* coverage

* fix test

* Update tests/test_setup.py

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

* Update tests/test_setup.py

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

* Update homeassistant/setup.py

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

* strip

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* strip WAIT_PLATFORM_INTEGRATION

* remove complexity

* Apply suggestions from code review

* no longer works that way

* fixes

* fixes

* fixes

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-03-18 21:45:34 -04:00
J. Nick Koston
8a144d16f5
Move legacy device_tracker setup to a tracked task (#113715)
* Move legacy device_tracker setup to a tracked task

Legacy platforms are now loaded in a tracked task which
allows anything waiting on device_tracker (such as
a config entry that uses the device_tracker
platform) to proceed.

This also allows us to remove the workaround
of adding device_tracker to
hass.config.components in its setup

* tweak

* tweak

* fix tests
2024-03-18 10:39:59 +01:00
Sid
82a60fe8ad
Enable Ruff RSE (#113695) 2024-03-18 00:40:38 +01:00
Jan-Philipp Benecke
c58bba55bf
Remove deprecated hass.components from legacy device tracker platform (#113612) 2024-03-16 11:19:29 -10:00
J. Nick Koston
b26928878f
Remove group integration platforms that use the default states (#113562)
Remove group integration platforms that use the default

There is no need to register platforms that use the defaults
as the group code already uses STATE_ON/STATE_OFF when there
are no on/off states in the GroupIntegrationRegistry
2024-03-15 20:51:21 -04:00
J. Nick Koston
c3b5e819c5
Fix group loading too late resulting in incorrect state (#113262) 2024-03-13 19:18:15 -10:00
Marc Mueller
aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller
0e3945ca6c
Add empty line after module docstring [d-f] (#112698) 2024-03-08 14:15:26 +01:00
J. Nick Koston
40774101d3
Avoid creating task per device when adding legacy device trackers (#111220) 2024-02-23 23:47:43 +01:00
Paul Bottein
30dec53b07
Add device tracker icon translations (#109109) 2024-01-30 12:32:02 +01:00
Martin Hjelmare
53b73bd0bd
Make device tracker latitude and longitude optional (#108838)
* Make device tracker latitude and longitude optional

* Update test
2024-01-25 13:25:17 +01:00
Martin Hjelmare
852e4c21c6
Complete device tracker entity tests (#108768) 2024-01-24 19:50:55 +01:00
Erik Montnemery
c805ea7b4f
Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
Robert Resch
9dd1b9e268
Deprecate deprecated device tracker constants (#106099) 2023-12-20 18:06:38 +01:00
Jan-Philipp Benecke
dc17780e5b
Remove device from known_devices upon import in ping device tracker (#105009)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-12-05 18:52:22 +01:00
Erik Montnemery
84e74e4c74
Reverse component path (#104087)
* Reverse component path

* Update translations helper

* Fix

* Revert incorrect change of PLATFORM_FORMAT

* Fix use of PLATFORM_FORMAT in tts

* Fix ios
2023-12-05 08:43:58 +01:00
Erik Montnemery
95f7db1970
Move config_per_platform and extract_domain_configs to config.py (#104989) 2023-12-04 12:48:49 +01:00
Jan Bouwhuis
9962301b42
Do not notify config errors during logging (#104466) 2023-11-24 21:34:09 +01:00
Erik Montnemery
5b37096b5f
Refactor config.async_log_exception (#104034)
* Refactor config.async_log_exception

* Improve test coverage

* Make functions public
2023-11-15 19:09:49 +01:00
Martin Hjelmare
bb456464ae
Fix device tracker see gps accuracy selector (#104022) 2023-11-15 10:51:12 +01:00
Jan Bouwhuis
a5f8774878
Use cached_property for legacy device_tracker type (#101125) 2023-09-29 20:54:24 +02:00
J. Nick Koston
a04c61e77b
Replace lambda with attrgetter in device_tracker device_trigger (#99663) 2023-09-05 16:41:35 +02:00
Erik Montnemery
045c327928
Move DeviceInfo from entity to device registry (#98149)
* Move DeviceInfo from entity to device registry

* Update integrations
2023-08-10 22:04:26 -04:00
Meow
024d646526
Aligned integration manifest files (#97175) 2023-07-25 08:33:56 +02:00
Franck Nijhof
30058297cf
Migrate backported StrEnum to built-in StrEnum (#97101) 2023-07-23 23:19:24 +02:00
J. Nick Koston
28ff173f16
Only lookup hostname/ip_address/mac_address once in device_tracker (#96984) 2023-07-21 00:07:06 -05:00