Commit Graph

346 Commits (c896458fcf75102c88ecc90ffa61a7b9f632336e)

Author SHA1 Message Date
epenet ac588ddc75
Use relative imports in tests [j-r] (#119282) 2024-06-10 13:32:31 +02:00
epenet c7e065c413
Move enable_custom_integrations fixture to decorator (#118844) 2024-06-05 09:20:08 +02:00
epenet 7e62061b9a
Improve typing for `calls` fixture in tests (a-l) (#118349)
* Improve typing for `calls` fixture in tests (a-l)

* More

* More
2024-05-29 09:06:48 +02:00
Michael Hansen 75ab4d2398
Add temperature slot to light turn on intent (#118321) 2024-05-28 14:53:49 -04:00
Michael Hansen 7923471b94
Intent target matching and media player enhancements (#115445)
* Working

* Tests are passing

* Fix climate

* Requested changes from review
2024-05-07 22:01:03 -04:00
Sid 9bf87329da
Enable Ruff FLY002 rule (#115112)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-04-12 09:04:16 +02:00
Sid 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
J. Nick Koston cabc4f797a
Preload storage for integrations we know we are going to setup (#114192) 2024-03-25 15:49:54 -10:00
Jan-Philipp Benecke 9580adfde9
Use new `setup_test_component_platform` helper instead of test fixture for light platform (#114200) 2024-03-26 00:17:16 +01:00
Marc Mueller efc54971d3
Update empty line formatting after module docstring (#114040) 2024-03-23 00:27:57 +01:00
Jan-Philipp Benecke ff6812a798
Split light fixture from implementation to only import when fixture is actually used (#113892)
* Split light fixture from implementation to only import when fixture is actually used

* Non-local import
2024-03-21 10:49:32 +01:00
Jan-Philipp Benecke 685468d845
Use `mock_platform` for light entity component tests instead of `hass.components` (#113845)
* Use `mock_platform` for light entity component tests instead of `hass.components`

* Move pytest_plugins to top

* Fix comment
2024-03-20 01:09:48 +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
soonsouth cfc2f17f35
Remove repetitive words in comments and docstrings (#113529)
chore: remove repetitive words

Signed-off-by: soonsouth <cuibuwei@163.com>
2024-03-15 18:11:12 +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
Erik Montnemery 770e48d512
Simplify color mode logic in Tuya light (#110327)
* Simplify color mode logic in Tuya light

* Remove exclusion from LightEntity.__should_report_light_issue

* Fix test
2024-03-06 18:28:12 +01:00
puddly 016f2c7581
Improve ZHA group color modes (#111669)
* Set the color mode based on supported color modes

* Replace `zha` with `tuya` in unit test
2024-02-28 17:20:19 -05:00
Erik Montnemery 1764c031df
Warn when lights violate color mode rules (#110336)
* Warn when lights violate color mode rules

* Update test

* Remove redundant warning, add tests

* Improve test coverage
2024-02-12 17:43:50 +01:00
Erik Montnemery 4229c35fcd
Improve color mode handling in MockLight (#109298) 2024-02-02 09:49:32 +01:00
Erik Montnemery c3de193e2e
Adjust color_mode checks when lights render effects (#108737)
* Adjust color_mode checks when lights render effects

* Improve comment

* Avoid calling effect property if light does not support effects

* Fix test
2024-01-24 15:44:45 +01:00
J. Nick Koston e4a25825d3
Migrate light entity to use contains for LightEntityFeature with deprecation warnings (#106622) 2023-12-28 15:45:06 -10:00
Niccolò Maggioni 0232c8dcb0
Add temperature to the light color mode parameter fallbacks (#86026)
* Add color temperature to the color mode fallbacks

* Manually add ATTR_COLOR_TEMP since ATTR_COLOR_TEMP_KELVIN is pre-parsed

* Include the legacy ATTR_COLOR_TEMP attribute in the tests

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Add citation for McCamy's approximation formula

If still existing, also see page 3 of https://www.st.com/resource/en/application_note/an5638-how-correlated-color-temperature-is-calculated-by-vd6283-stmicroelectronics.pdf

* Update homeassistant/util/color.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-12-01 08:26:07 +01:00
Erik Montnemery 645f916cf4
Remove support for deprecated light attributes from light scenes (#104254) 2023-11-21 07:51:41 +01:00
Erik Montnemery 0304ac5a1b
Fix restore state for light when saved attribute is None (#103096) 2023-10-31 10:05:03 +01:00
Erik Montnemery a6c5927976
Use real devices in light device condition tests (#102756) 2023-10-25 09:42:35 +02:00
Erik Montnemery 02a83740cc
Use real devices in light device action tests (#102722) 2023-10-24 21:38:24 +00:00
Erik Montnemery 691de148cf
Use real devices in light device trigger tests (#102689) 2023-10-24 21:58:37 +02:00
Paul Bottein c98c18f25e
Return 'None' for light attributes when off instead of removing them (#101946) 2023-10-19 01:08:08 +02:00
Franck Nijhof 868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
Erik Montnemery 433d640071
Use entity registry id in light device actions (#95271) 2023-06-26 22:27:19 +02:00
Erik Montnemery a338e7e242
Use entity registry id in toggle_entity device automations (#94995)
* Use entity registry id in toggle_entity device automations

* Update tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-06-26 09:59:01 +02:00
Erik Montnemery fd822bce56
Replace assert_lists_same with pytest_unordered in integrations h-m (#94901) 2023-06-20 20:16:25 +02:00
J. Nick Koston 68cf796be8
Speed up entity service calls (#94731)
* Speed up entity service calls

- Avoid permissions check if the caller is an admin
- Use set intersection instead of linear search of entity platforms to find entities

* tweak

* fix light test to not use an admin user
2023-06-16 21:07:57 -04:00
Erik Montnemery 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
Jan Bouwhuis 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 Montnemery 3cca338c6e
Improve blueprint test fixtures (#93519) 2023-05-25 13:45:19 +02:00
J. Nick Koston 41aa3e223e
Update light tests to avoid patching utcnow (#93490) 2023-05-24 15:21:40 -05:00
Erik Montnemery e3c16e634b
Allow exposing entities not in the entity registry to assistants (#92363) 2023-05-02 22:08:09 +02:00
J. Nick Koston d0d4ab6056
Require a list of entity ids when fetching history (#90992) 2023-04-08 16:14:44 -10:00
Erik Montnemery ae127e7687
Change light white service call attribute to accept True (#89803) 2023-03-16 23:02:56 -04:00
J. Nick Koston 1c57339ec3
Refactor recorder tests to use recorder history API (#89565) 2023-03-11 21:51:16 -05:00
J. Nick Koston e6c792deed
Add missing kelvin attributes to light recorder platform (#88561) 2023-02-21 14:23:53 -06:00
Erik Montnemery 9989a4787b
Fix recorder platform tests (#88330) 2023-02-17 08:22:15 -06:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet ea11a30a35
Add type hints to integration tests (part 13) (#87998) 2023-02-13 14:38:37 +01:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
Franck Nijhof 51a9f65a01
Clean up unnecessary registry mocks from Core tests (#87726) 2023-02-08 13:28:44 -06:00
epenet f75ac17554
Add type hints to integration tests (j-m) (#87704) 2023-02-08 19:06:59 +01:00
epenet 4142f0d15d
Add return type to tests without arguments (#87613)
* Add return type to tests without arguments

* Black

* Cancel fixture amends
2023-02-07 14:20:06 +01:00