Commit Graph

39 Commits

Author SHA1 Message Date
Abílio Costa
b626204f63 Add default device class display precision for Sensor (#145013)
* Add default device class display precision for Sensor

* Renaming, docstrings, cleanup

* Simplify units list

* Fix tests

* Fix missing precision when suggested is specified

* Update snapshots

* Fix when unit of measurement is not valid

* Fix tests

* Fix deprecated unit usage

* Fix goalzero tests

The sensor native_value method was accessing the data dict and trowing,
since the mock did not have any data for the sensors.

Since now the precision is always specified (it was missing for those
sensors), the throw was hitting async_update_entity_options in _update_suggested_precision.
Previously, async_update_entity_options was not called since it had no
precision.

* Fix metoffice

* Fix smartthings

* Add default sensor data for Tesla Wall Connector tests

* Update snapshots

* Revert spaces

* Update smartthings snapshots

* Add missing sensor mock for tesla wall connector

* Address review comments

* Add doc comment

* Add cap to doc comment

* Update comment

* Update snapshots

* Update comment
2025-05-26 19:40:29 +02:00
Erik Montnemery
4e1d5fbeb0 Add WS command to help reset custom entity_id (#145504)
* Add WS command to help reset custom entity_id

* Calculate suggested object id from entity properties

* Fix logic and add additional tests

* Adjust test

* Update folder_watcher test

* Handle current entity id matches the automatic entity id

* Don't store calculated_object_id

* Update snapshots

* Update snapshots

* Update test

* Tweak logic for reusing current entity_id

* Improve test

* Don't assign same entity_id to several entities

* Prioritize custom entity name

* Update snapshots

* Update snapshots
2025-05-26 19:28:27 +02:00
Simone Chemelli
484a547758 Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
Norbert Rittel
a338205b73 Fix sentence-casing of "round-trip time" sensors in ping (#141012)
* Fix sentence-casing of "round-trip time" sensors in `ping`

Also add a hyphen for better English grammar.

* Update test_sensor.ambr
2025-03-20 20:30:28 +02:00
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 ecb3bf79f3.

* 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
Thomas Lake
cad49453eb ping: Suppress ProcessLookupError on timeout (#134281) 2025-01-22 22:30:04 +01:00
Jan-Philipp Benecke
2a1cdf6ff2 Strip whitespaces from host in ping config flow (#130970) 2024-11-19 21:57:57 -05:00
Jan-Philipp Benecke
f6cf23a8c2 Remove deprecated attributes from ping binary sensor (#125760) 2024-09-11 16:17:20 +02:00
Joost Lekkerkerker
e8d7eb05ae Delete unused snapshots (#123656)
* Delete unused snapshots

* Delete unused snapshots
2024-08-12 13:28:09 +02:00
Marc Mueller
921430d497 Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
G Johansson
f14e8b728c Remove YAML import from ping (#120176) 2024-06-22 20:39:32 +02:00
epenet
fbaba3753b Fix root-import pylint warning in components (#119294)
* Fix root-import pylint warning in components

* Adjust

* Adjust
2024-06-10 15:14:49 +02:00
Marc Mueller
837ee7c4fb Import Generator from typing_extensions (4) (#118992) 2024-06-06 17:41:37 +02:00
epenet
c7cc465e5c Add return type hints in tests (k-z) (#118942) 2024-06-06 10:11:29 +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
Joost Lekkerkerker
6bb4e7d62c Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01: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
Sid
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc Mueller
1722e23df8 Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Jan-Philipp Benecke
25551fa938 Move Ping binary sensor attributes to sensor entities (#112004)
* Move Ping binary sensor attributes to sensor entities

* Process code review

* Update snapshot
2024-03-03 11:08:28 +01:00
Franck Nijhof
e0a9dcd996 Add label registry (#110821) 2024-02-19 11:59:08 +01:00
J. Nick Koston
4a98f3f223 Migrate ping to use async_update_entry to alter config entries (#110404) 2024-02-12 21:25:17 +01:00
Jan-Philipp Benecke
d1c1eb8428 Add test for avoid triggering ping device tracker home after reload (#107107) 2024-01-09 18:39:31 +01:00
Jan-Philipp Benecke
13504d5fd5 Add consider home interval to ping (#104881)
* Add consider home interval to ping

* Run ruff after rebase

* Fix buggy consider home interval
2023-12-22 14:50:58 +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
Jan-Philipp Benecke
a9a95ad881 Revert "Introduce base entity for ping" (#104682) 2023-11-29 08:42:02 +01:00
Jan-Philipp Benecke
6f54aaf564 Introduce base entity for ping (#104197) 2023-11-24 11:20:34 +01:00
Jan-Philipp Benecke
c2e81bbafb Add entity tests for ping (#104168)
* Add entity tests for ping

* Remove unused param

* Use async_setup of config_entries
2023-11-18 23:45:24 +01:00
Jan-Philipp Benecke
e5bc25523e Add config flow for Ping (#103743) 2023-11-17 13:30:30 -06:00
Jan-Philipp Benecke
f0a455e5c7 Update icmplib privilege detection function to be async in ping integration (#103925)
* Make icmplib privilege detection function async

* I should also commit the tests..
2023-11-13 19:37:58 +01:00
G Johansson
67586caaf9 Cleanup ping (#95168) 2023-06-25 09:00:52 -05:00
epenet
2cdc741900 Add type hints to integration tests (part 17) (#88163) 2023-02-15 11:14:04 +01:00
Paulus Schoutsen
31153ac155 Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Erik Montnemery
a793fd4134 Prevent 3rd party lib from opening sockets in ping tests (#56329) 2021-09-16 23:41:19 -10:00
J. Nick Koston
0cd0733438 Remove empty tests for ping now that the code in icmplib is used (#51454) 2021-06-05 01:20:41 +03:00
J. Nick Koston
68714c2067 Update ping to use asyncio function in icmplib (#50808) 2021-06-02 06:10:33 -10:00
J. Nick Koston
9b0b2d9168 Prevent ping id allocation conflict with device_tracker (#48969)
* Prevent ping id allocation conflict with device_tracker

- Solves id conflict resulting unexpected home state

* Update homeassistant/components/ping/device_tracker.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-04-09 16:56:15 -07:00
Franck Nijhof
65cf2fcb6f Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
J. Nick Koston
57848cdf35 Add the ability to reload ping platforms from yaml (#39344) 2020-08-28 12:40:30 -05:00