Commit Graph

23 Commits (5c018f6ffceefd02f0f42779c2348e802a7e0541)

Author SHA1 Message Date
epenet 9204ccfa17
Use is in ConfigEntryState enum comparison in tests (N-Z) (#114926) 2024-04-05 17:37:00 +02:00
Joost Lekkerkerker ee66f6ec8c
Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
Erik Montnemery 426f73b1f4
Add State.last_reported (#113511)
* Add State.last_reported

* Update tests

* Update test snapshots

* Call state_reported listeners when firing state_changed event

* Add tests
2024-03-20 21:05:07 +01:00
Marc Mueller 32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc Mueller 1722e23df8
Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Michael 45f44e9216
Use tracked entity friendly name for proximity sensors (#109744)
user tracked entity friendly name
2024-02-05 20:18:59 +01:00
Michael ffe9f0825a
Add zone related sensors in proximity (#109630)
* move legacy needed convertions into legacy entity

* add zone related sensors

* fix test coverage

* fix typing

* fix entity name translations

* rename placeholder to tracked_entity
2024-02-05 00:42:07 +01:00
Michael ac8a4f4b05
Redact location names in proximity diagnostics (#109600) 2024-02-04 15:12:08 +01:00
Michael 17f1aa644b
Avoid duplicate entity names in proximity (#109413)
* avoid duplicate config entry title

* consecutive range 2..10

* use existing logic
2024-02-04 13:26:51 +01:00
Michael e567236cac
Add diagnostics to proximity (#109393) 2024-02-02 23:03:55 +01:00
Michael 30c5baf522
Add configflow to Proximity integration (#103894)
* add config flow

* fix tests

* adjust and fix tests

* fix tests

* config_zones as fixture

* add config flow tests

* use coordinator.async_config_entry_first_refresh

* use entry.entry_id for hass.data

* fix doc string

* remove unused unit_of_measurement string key

* don't store friendly_name, just use self.name

* abort on matching entiry

* break out legacy setup into seperate function

* make tracked entites required

* move _asnyc_setup_legacy to module level

* use zone name as config entry title

* add entity_used_in helper

* check entry source if imported

* create repair issue for removed tracked entities

* separate state change from registry change event handling

* migrate unique ids after tracked entity renamed

* use full words for the variable names

* use defaultdict

* add test

* remove unnecessary if not in check

* use unique_id of tracked entity

* use the entity registry entry id

* Apply suggestions from code review

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-01-31 12:47:23 +01:00
Michael d007327cf5
Deprecate legacy Proximity entity (#108730)
* deprecate proximity entity

* add test

* extend tests

* adjust strings

* make issue fixable

* use default repairflow
2024-01-26 19:04:48 +01:00
Michael eaa32146a6
Add sensor platform to Proximity (#101497)
* add sensor platform

* transl. of distance already covered by dev.class

* add untested files to .coveragerc

* add missing state translations

* remove translation key for distance sensor

* proximity entity do not use HA number system

* fix

* extend tests

* make const final to be usable as key for TypedDict

* remove proximity from .coveragerc

* replace typeddict by simple dict definition

* make black happy

* rework to create proximity sensor for each tracked entity and always recalculate all entites

* apply review comments

* move direction of travel calc out of the loop

* make direction of travel an enum sensor

* remove unique_id from sensors

* don't set distance=0 when in monitored zone

* set None when direction is unknown

* keep distance 0 in case arrived for legacy entity

* exclude from nearest when in ignored zone

* keep distance=0 when arrived

* use description name for entity name

* remove uneeded typing

* uses consistent variable name

* fix debug messages

* use entity_id as loop var

* rename device_state to tracked_entity_state

* correct MRO for sensor entity classes
2024-01-23 10:56:02 +01:00
Michael 2616794e1d
Fix proximity entity id (#102992)
* fix proximity entity id

* extend test to cover entity id
2023-10-29 10:43:57 +01:00
Michael 6202f178af
Fix proximity zone handling (#102971)
* fix proximity zone

* fix test
2023-10-28 22:32:42 -04:00
epenet 3abf7ea18a
Add type hints to integration tests (m-p) (#87705) 2023-02-08 07:48:54 -08:00
Ariana Hlavaty c9ba5bfebd
Rewrite proximity tests to be pytest functions (#41711) 2020-10-16 13:13:34 +02:00
Paulus Schoutsen c33edbe5bb
Use TestCase.addCleanup (#36560) 2020-06-08 12:26:40 -07:00
springstan eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Paulus Schoutsen 0fba9e44ed
Migrate zone to use collection helpers (#30774) 2020-01-22 12:36:25 -08:00
Bas Nijholt 21816eeed4 Sort imports according to PEP8 for components starting with "P" (#29775) 2019-12-09 14:29:39 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen b8cc547fa3
Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00