mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Filter MQTT climate JSON attributes (#52280)
This commit is contained in:
@@ -23,6 +23,7 @@ from homeassistant.components.climate.const import (
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||
)
|
||||
from homeassistant.components.mqtt.climate import MQTT_CLIMATE_ATTRIBUTES_BLOCKED
|
||||
from homeassistant.const import STATE_OFF
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -45,6 +46,7 @@ from .test_common import (
|
||||
help_test_entity_id_update_subscriptions,
|
||||
help_test_setting_attribute_via_mqtt_json_message,
|
||||
help_test_setting_attribute_with_template,
|
||||
help_test_setting_blocked_attribute_via_mqtt_json_message,
|
||||
help_test_unique_id,
|
||||
help_test_update_with_json_attrs_bad_JSON,
|
||||
help_test_update_with_json_attrs_not_dict,
|
||||
@@ -923,6 +925,13 @@ async def test_setting_attribute_via_mqtt_json_message(hass, mqtt_mock):
|
||||
)
|
||||
|
||||
|
||||
async def test_setting_blocked_attribute_via_mqtt_json_message(hass, mqtt_mock):
|
||||
"""Test the setting of attribute via MQTT with JSON payload."""
|
||||
await help_test_setting_blocked_attribute_via_mqtt_json_message(
|
||||
hass, mqtt_mock, CLIMATE_DOMAIN, DEFAULT_CONFIG, MQTT_CLIMATE_ATTRIBUTES_BLOCKED
|
||||
)
|
||||
|
||||
|
||||
async def test_setting_attribute_with_template(hass, mqtt_mock):
|
||||
"""Test the setting of attribute via MQTT with JSON payload."""
|
||||
await help_test_setting_attribute_with_template(
|
||||
|
||||
Reference in New Issue
Block a user