Filter MQTT lock JSON attributes (#52285)
This commit is contained in:
parent
7de3e7d1dd
commit
3b89fcfe83
2 changed files with 18 additions and 0 deletions
|
@ -10,6 +10,7 @@ from homeassistant.components.lock import (
|
|||
STATE_LOCKED,
|
||||
STATE_UNLOCKED,
|
||||
)
|
||||
from homeassistant.components.mqtt.lock import MQTT_LOCK_ATTRIBUTES_BLOCKED
|
||||
from homeassistant.const import ATTR_ASSUMED_STATE, ATTR_ENTITY_ID
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
|
@ -32,6 +33,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,
|
||||
|
@ -311,6 +313,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, LOCK_DOMAIN, DEFAULT_CONFIG, MQTT_LOCK_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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue