Commit Graph
86 Commits
Author SHA1 Message Date
Franck NijhofandGitHub 83fbea2158 Fix line length violations in tests/components n-o (#170967) 2026-05-17 10:32:44 -04:00
epenetandGitHub 88525955ce Remove import annotations from tests (#169527) 2026-04-30 09:30:46 +02:00
Erik MontnemeryandGitHub 5e665093c9 Revert "Add number.changed trigger" (#165193) 2026-03-09 13:55:08 +01:00
MichaelandGitHub 536cfc4c67 Add number.changed trigger (#163984) 2026-03-05 21:36:39 +01:00
Abílio CostaandGitHub fd78e35a86 Align number unit converters with sensor (#162662) 2026-02-11 23:07:04 +01:00
Erik MontnemeryandGitHub deefcbcbe4 Remove stub_blueprint_populate test fixture (#161288) 2026-01-20 15:46:06 +01:00
Erik MontnemeryandGitHub a020a32d8a Remove translations from WS get_services and REST /api/services (#147120) 2025-10-23 17:26:33 +02:00
krahabbandGitHub afeaf2409f Add TEMPERATURE_DELTA device class to Number and Sensor entities (#147358) 2025-10-15 11:49:12 +02:00
48300f4563 Use greek small letter mu "\u03bc" instead of micro sign "\u00B5" for micro unit prefix (alt 1) (#144853)
Co-authored-by: Erik Montnemery <[email protected]>
2025-08-19 18:48:50 +02:00
epenetandGitHub c3ade400fb Use Platform constant in tests (#145801)
* Use Platform constant in tests

* spelling

* Fix platform
2025-05-28 15:51:37 +02:00
Erik MontnemeryandGitHub 428cc1a951 Update signature of platforms' async_setup_entry in tests (#138271) 2025-02-11 13:17:39 +01:00
Erik MontnemeryandGitHub 5888b83f22 Validate device id when adding or updating entity registry entry (#134982) 2025-01-07 16:10:51 +00:00
208b14dd2b Use translations on NumberEntity unit_of_measurement property (#132095)
Co-authored-by: Martin Hjelmare <[email protected]>
2024-12-03 17:08:09 +01:00
Robert ReschandGitHub a01e7cd6cf Remove deprecated number constants (#131810) 2024-11-28 12:20:43 +01:00
epenetandGitHub 5608301178 Add missing return type in test __init__ methods (#123932)
* Add missing return type in test __init__ methods

* Adjust
2024-08-14 16:48:52 +02:00
Marc MuellerandGitHub 921430d497 Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
Joost LekkerkerkerandGitHub 0fdf037ba0 Fix ruff type comparison E721 (#120731)
Fix E721
2024-06-28 11:56:49 +02:00
epenetandGitHub 99b349fa2c Fix consider-using-dict-items warnings in tests (#119497) 2024-06-12 16:44:29 +02:00
fb1b0058ee Fix consider-using-tuple pylint warnings in component tests (#119464)
* Fix consider-using-tuple pylint warnings in component tests

* Apply su

Co-authored-by: Michael <[email protected]>

---------

Co-authored-by: Michael <[email protected]>
2024-06-12 15:50:27 +02:00
epenetandGitHub ac588ddc75 Use relative imports in tests [j-r] (#119282) 2024-06-10 13:32:31 +02:00
Marc MuellerandGitHub 33ed4fd862 Import Generator from typing_extensions (3) (#118990) 2024-06-06 17:28:59 +02:00
J. Nick KostonandGitHub ed0568c655 Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
epenetandGitHub ead0e797c1 Use registry fixtures in tests (m-n) (#118291) 2024-05-28 13:40:45 +02:00
Jan BouwhuisandGitHub acf2f855fe Raise ServiceValidationError on number out of range exception (#114589) 2024-04-02 12:22:00 +02:00
SidandGitHub d5f883fbf0 Unignore Ruff PLR in tests (#114470)
* Unignore Ruff PLR in tests

* Address review comments

* review comments

* fix import

* Update test_api.py

* Update test_api.py

* Update test_api.py
2024-04-01 11:11:59 +02:00
Jan-Philipp BeneckeandGitHub f94f1fb826 Use setup_test_component_platform func for number entity component tests instead of hass.components (#114017)
* Use `setup_test_component_platform` fixture for number entity component tests instead of `hass.components`

* Now function

* Ruff format
2024-03-26 21:56:38 +01:00
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <[email protected]>
2024-03-19 09:01:07 +01:00
Marc MuellerandGitHub 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc MuellerandGitHub 1722e23df8 Add empty line after module docstring [tests l-p] (#112710) 2024-03-08 14:55:15 +01:00
Joakim PlateandGitHub eefc6cd50a Correct flow rate conversion review after merge (#109501) 2024-02-04 15:01:06 +01:00
Joakim PlateandGitHub cece117c93 Flow rate unit conversions and device class (#106077)
* Add volume flow rate conversions

* Add missing translations

* Adjust liter unit and add gallons per minute

* Adjust to min instead of m for minutes

* Add matching class for number

* Add some tests for number and sensor platform

* Add deprecated constants

* Add explicit list of flow rate for check

This reverts commit 105171af31.
2024-01-30 15:01:08 +01:00
Erik MontnemeryandGitHub c805ea7b4f Include deprecated constants in wildcard imports (#107114) 2024-01-05 11:46:45 +01:00
MichaelandGitHub 117ff21c48 Add significant Change support for number (#105863) 2023-12-27 16:54:08 +01:00
J. Nick KostonandGitHub e43f4412fa Fix native_step in number not looking at _attr_native_step (#106327) 2023-12-23 13:20:24 -10:00
Robert ReschandGitHub 036c856500 Deprecate deprecated number constants (#106114) 2023-12-20 17:28:52 +01:00
Erik MontnemeryandGitHub 56ee1753ec Use real devices in number device action tests (#102724) 2023-10-24 23:26:12 +02:00
J. Nick KostonandGitHub b980ed3eac Avoid more device_class lookups for number entities when writing state (#102381) 2023-10-22 23:55:13 +02:00
Erik MontnemeryandGitHub d0dc4d0963 Add missing device class to sensor.DEVICE_CLASS_UNITS (#101256) 2023-10-02 13:01:26 +02:00
Ville SkyttäandGitHub 3094991236 Upgrade ruff to 0.0.285 (#98647) 2023-08-19 08:17:17 -04:00
Robert ReschandGitHub 7ac2c61f24 Fix copy-paste error in comments of number tests (#98615) 2023-08-18 11:02:30 +02:00
Erik MontnemeryandGitHub fa0d68b1d7 Add NumberDeviceClass.DURATION (#96932) 2023-07-20 11:10:03 +02:00
Erik MontnemeryandGitHub 9dc586bd98 Use entity registry id in number device actions (#95273) 2023-06-27 08:20:45 +02:00
J. Nick KostonandGitHub c6b3d538de Remove deprecated non-native number support (#95178)
* Remove deprecated non-native number support

These were scheduled to be removed in 2022.10 but were left
in to give custom component authors a bit more time.

Its been a year since they were deprecated so its time
to remove the old code

https://developers.home-assistant.io/blog/2022/06/14/number_entity_refactoring/

* strip unneeded change from testing
2023-06-24 23:01:44 -04:00
Franck NijhofandGitHub e68916b2fc Name unnamed numbers by their device class (#95083) 2023-06-22 23:48:49 +02:00
Erik MontnemeryandGitHub eba04824a4 Replace assert_lists_same with pytest_unordered in integrations n-s (#94902) 2023-06-20 20:23:14 +02:00
Erik MontnemeryandGitHub 9a3077d64a Always setup demo platforms with device support from config entry (#94586)
* Always setup demo platforms with device support from config entry

* Adjust test fixutres

* Update tests depending on the demo integration
2023-06-14 16:50:35 +02:00
Erik MontnemeryandGitHub 59f5b8f2d6 Remove unneeded checks for Entity.platform (#94321)
* Remove unneeded checks for Entity.platform

* Update tests

* Prevent breaking integrations without an EntityComponent

* Warn when entity has no platform
2023-06-09 15:17:41 +02:00
J. Nick KostonandGitHub fba826ae9e Migrate restore_state helper to use registry loading pattern (#93773)
* Migrate restore_state helper to use registry loading pattern

As more entities have started using restore_state over time, it
has become a startup bottleneck as each entity being added is
creating a task to load restore state data that is already loaded
since it is a singleton

We now use the same pattern as the registry helpers

* fix refactoring error -- guess I am tired

* fixes

* fix tests

* fix more

* fix more

* fix zha tests

* fix zha tests

* comments

* fix error

* add missing coverage

* s/DATA_RESTORE_STATE_TASK/DATA_RESTORE_STATE/g
2023-05-30 20:48:17 -05:00
Jan BouwhuisandGitHub ec98e22330 Add type hints for stub_blueprint_populate fixture (#93568)
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Erik MontnemeryandGitHub 3cca338c6e Improve blueprint test fixtures (#93519) 2023-05-25 13:45:19 +02:00