108 Commits

Author SHA1 Message Date
Jan Bouwhuis
2de941bc11
Fix - Allow brightness only light MQTT json light to be set up using the brightness flag or via supported_color_modes (#139585)
* Fix - Allow brightness only light MQTT json light to be set up using the `brightness` flag or via  `supported_color_modes`

* Improve comment
2025-03-01 19:35:39 +01:00
Jan Bouwhuis
efc515ff4e
Remove legacy color_mode support for legacy mqtt json light (#136996) 2025-02-04 12:34:36 +01:00
Jan Bouwhuis
cabdae98e8
Allow to process kelvin as color_temp for mqtt json light (#133955) 2025-01-09 18:34:42 +01:00
Jan Bouwhuis
6b666b3a0f
Test color_temp updates are processed when an mqtt json light is turned off (#133715) 2024-12-21 12:44:00 +01:00
Jan Bouwhuis
2003fc7ae0
Adjust MQTT tests not to assert on deprecated color_temp attribute (#133198) 2024-12-15 19:42:54 +01:00
Jan Bouwhuis
16ad2d52c7
Improve MQTT json color_temp validation (#133174)
* Improve MQTT json color_temp validation

* Revert unrelated changes and assert on logs

* Typo
2024-12-15 13:07:10 +01:00
epenet
2ce2765e67
Adjust light test helpers to use Kelvin, and cleanup unused helpers (#133048)
Cleanup light test helper methods
2024-12-12 16:49:25 +01:00
epenet
33c799b2d0
Migrate mqtt light tests to use Kelvin (#133035) 2024-12-12 16:42:10 +01:00
epenet
0d71828def
Migrate mqtt lights to use Kelvin (#132828)
* Migrate mqtt lights to use Kelvin

* Adjust restore_cache tests

* Adjust tests
2024-12-11 16:11:14 +01:00
Petar Petrov
c68cadad7a
Improve precision of HSV color conversion (#130880) 2024-11-19 22:06:57 +01:00
Jan Bouwhuis
ac6d893758
Correct type hints on MQTT tests (#128299) 2024-10-16 13:49:18 +02:00
Jan Bouwhuis
e907c45981
Cleanup mqtt platform tests part 5 (#120719) 2024-06-28 09:22:56 -05:00
Jan Bouwhuis
a8f4684929
Cleanup mqtt platform tests part 6 (last) (#120736) 2024-06-28 09:22:25 -05:00
Jan Bouwhuis
cbcf29720d
Cleanup common mqtt tests (#120446) 2024-06-25 19:15:11 +02:00
Marc Mueller
a0314cddd4
Fix invalid tuple annotations (#116035) 2024-04-23 16:02:16 +02:00
Sid
d5fd005db8
Add ruff rule PIE808 (#113621) 2024-03-17 09:56:26 +01:00
Jan Bouwhuis
caaa03536b
Cleanup mqtt PLATFORMS constant and CI-test platform filters (#112847) 2024-03-09 23:48:54 +01:00
Marc Mueller
32f3f46542
Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Jan Bouwhuis
0c2cf881ac
Deprecate old config options for MQTT json light (#111676)
* add deprecaction

* Deprecate old config options for mqtt json light

* Do not deprecate brightness flag

* Enable brightness support by default

* Keep `false` as default for brightness flag

* Add warnings and register issue

* log warning and register on use of color_mode flag

* Remove redundant cv.deprecated logging + follow up comments
2024-03-05 08:49:05 +01:00
Jan Bouwhuis
7bec5ef6bc
Use unknown color_mode for MQTT json lights if color mode is not set (#108909) 2024-01-26 14:42:47 +01:00
Jan Bouwhuis
e5a115ce1f
Fix mqtt json light state updates using deprecated color handling (#105283) 2023-12-08 16:54:02 +01:00
Jan Bouwhuis
4bf88b1690
Improve MQTT json light brightness scaling (#104510)
* Improve MQTT json light brightness scaling

* Revert unrelated changes

* Format
2023-11-29 16:42:10 +01:00
Jan Bouwhuis
68f8b2cab5
Fix mqtt json light allows to set brightness value >255 (#104220) 2023-11-19 19:50:25 +01:00
Jan Bouwhuis
d149bffb07
Do not fail MQTT setup if lights configured via yaml can't be validated (#101649)
* Add light

* Deduplicate code

* Follow up comment
2023-10-19 17:34:43 +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
Jan Bouwhuis
5b422daf36
Avoid redundant calls to async_write_ha_state in MQTT light (#100690)
* Limit state writes for mqtt light

* Additional tests and review follow up
2023-09-22 13:32:30 +02:00
Jan Bouwhuis
7c22225cd1
Allow ADR 0007 compliant schema for mqtt (#94305)
* Enforce listed entities in MQTT yaml config

* Add tests for setup with listed items

* Fix test

* Remove validator add comment

* Update homeassistant/components/mqtt/__init__.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-07-18 14:29:45 +02:00
Jan Bouwhuis
c984604a6c
Refactor some mqtt tests not the just use schema validation (#94330)
Remove help_test_validate_platform_config
2023-06-09 12:30:26 +02:00
Jan Bouwhuis
9197316b57
Add tests mqtt light with single supported color_mode (#91811) 2023-04-22 13:55:43 +02:00
Jan Bouwhuis
fc8c5f1bbd
Do not allow mqtt lights to set brightness to zero (#91296)
* Do not allow mqtt lights to set brightness to zero

* Loglevel to debug

* Typo
2023-04-14 09:01:29 +02:00
Jan Bouwhuis
bb15923968
Rename MQTT entry mock and cleanup (#91223)
Rename to mqtt_mock_entry and cleanup
2023-04-12 09:43:03 +02:00
Jan Bouwhuis
a404d5f6d7
Prepare MQTT platform tests part5 (#90108)
* Tests light_json

* Tests light_template

* Tests light
2023-03-24 08:41:04 +01:00
Jan Bouwhuis
d865440012
Prepare MQTT common tests part3 (#90022) 2023-03-21 09:19:20 +01:00
Jan Bouwhuis
fe49861e26
Prepare MQTT common tests part4 (#90023)
* Upd test_setting_attribute_via_mqtt_json_message

* Update test_setting_attribute_with_template

* Update test_update_with_json_attrs_not_dict

* Update test_update_with_json_attrs_bad_json
2023-03-21 09:07:46 +01:00
Jan Bouwhuis
91dbda1ce7
Add mqtt common tests for availability (part2) (#89805)
* update test_availability_when_connection_lost

* Adjust test_availability_without_topic

* Update test_default_availability_payload + helper

* Update test_default_availability_list_payload

* Use helper for async_setup_component

* Update test_default_availability_list_*

* Update test_custom_availability_payload
2023-03-21 08:20:37 +01:00
Jan Bouwhuis
c81a38effb
Mqtt prepare test base part1 (#89796)
* Refactor test_reloadable

* Refactor test_disabling_and_enabling_entry

* optimize test_unload_config_entry

* Cleanup help_test_unload_config_entry

* cleanup test_unload_entry

* Update test tls_version

* More tests to entry only

* Add validate and hassconfig patch

* Revert fixture changes patch_hass_config

* Follow up comments
2023-03-16 15:57:01 +01:00
anotherthomas
179cc4d7f7
Improve warnings in mqtt light messages (#89552)
* improved warnings in mqtt light messages.

* fixed tests.
2023-03-13 14:46:16 +01:00
epenet
ba23816a0c
Inverse json import logic (#88099)
* Fix helpers and util

* Adjust components

* Move back errors

* Add report

* mypy

* mypy

* Assert deprecation messages

* Move test_json_loads_object

* Adjust tests

* Fix rebase

* Adjust pylint plugin

* Fix plugin

* Adjust references

* Adjust backup tests
2023-02-16 11:37:57 +01: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
Jan Bouwhuis
dc5f35a85e
Add missed type hints on MQTT platform tests (#87781) 2023-02-09 15:22:30 +01:00
epenet
bb174780b9
Apply registry type hints on mqtt platform tests (#87758)
Apply registry fixture types on platform tests
2023-02-09 11:53:56 +01:00
Jan Bouwhuis
df76e31cdf
Apply MQTT fixture types on platform tests (#87722)
* Apply MQTT fixture types on platform tests

* Add caplog type hint

* Add hass_ws_client type hint

* Add tmp_path type hint

* Add hass_client_no_auth type hint
2023-02-09 09:48:22 +01:00
Jan Bouwhuis
1a414f1433
Add hass and None return type on MQTT platform tests (#87713)
Add hass and `None` return type on MQTT tests
2023-02-08 18:08:03 +01:00
Jan Bouwhuis
7c2e7863d2
Remove legacy YAML support from MQTT (#82102) 2022-11-17 22:55:31 +01:00
Jan Bouwhuis
9a4c8f5f0e
Refactor common MQTT tests to use modern schema (#77583)
* Common tests availability

* Common tests attributes

* Common tests unique id

* Common tests discovery

* Common tests encoding

* Common tests device info

* Common tests entity_id updated

* Common tests entity debug info

* Common test entity category

* Common tests setup reload unload+corrections

* Cleanup sweep

* Comments from curent change

* Cleanup

* Remove unused legacy config
2022-09-09 11:15:48 +02:00
Erik Montnemery
b21f8c9ea8
Remove use of deprecated SUPPORT_* constants from MQTT light (#77828)
* Remove use of deprecated SUPPORT_* constants from MQTT light

* Refactor
2022-09-08 11:21:46 +02:00
Jan Bouwhuis
13188a5c63
Refactor MQTT tests to use modern platform schema part 2 (#77525)
* Tests light json

* Tests light template

* Missed test light json

* Tests light

* Tests lock

* Tests number

* Tests scene

* Tests select

* Tests sensor

* Tests siren

* Tests state vacuuum

* Tests switch

* Derive DEFAULT_CONFIG_LEGACY from DEFAULT_CONFIG

* Suggested comment changes
2022-09-06 11:03:02 +02:00
Erik Montnemery
c55505b47b
Use mock_restore_cache in mqtt tests (#77297) 2022-08-25 09:27:38 +02:00
Erik Montnemery
4cc1428eea
Add support for color_mode white to MQTT JSON light (#76918) 2022-08-17 13:07:50 +02:00
Erik Montnemery
73001e29ff
Remove deprecated white_value support from MQTT light (#76848)
* Remove deprecated white_value support from MQTT light

* Remove deprecated white_value support from MQTT JSON light

* Remove deprecated white_value support from MQTT template light
2022-08-16 16:47:21 +02:00