mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Switch mqtt to use json helper (#73871)
* Switch mqtt to use json helper * whitespace
This commit is contained in:
@ -688,7 +688,7 @@ async def test_sending_mqtt_commands_and_optimistic(
|
||||
await common.async_turn_on(hass, "light.test")
|
||||
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set", '{"state": "ON"}', 2, False
|
||||
"test_light_rgb/set", '{"state":"ON"}', 2, False
|
||||
)
|
||||
mqtt_mock.async_publish.reset_mock()
|
||||
state = hass.states.get("light.test")
|
||||
@ -709,7 +709,7 @@ async def test_sending_mqtt_commands_and_optimistic(
|
||||
await common.async_turn_off(hass, "light.test")
|
||||
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set", '{"state": "OFF"}', 2, False
|
||||
"test_light_rgb/set", '{"state":"OFF"}', 2, False
|
||||
)
|
||||
mqtt_mock.async_publish.reset_mock()
|
||||
state = hass.states.get("light.test")
|
||||
@ -838,7 +838,7 @@ async def test_sending_mqtt_commands_and_optimistic2(
|
||||
# Turn the light on
|
||||
await common.async_turn_on(hass, "light.test")
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set", '{"state": "ON"}', 2, False
|
||||
"test_light_rgb/set", '{"state":"ON"}', 2, False
|
||||
)
|
||||
mqtt_mock.async_publish.reset_mock()
|
||||
state = hass.states.get("light.test")
|
||||
@ -848,7 +848,7 @@ async def test_sending_mqtt_commands_and_optimistic2(
|
||||
await common.async_turn_on(hass, "light.test", color_temp=90)
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set",
|
||||
JsonValidator('{"state": "ON", "color_temp": 90}'),
|
||||
JsonValidator('{"state":"ON","color_temp":90}'),
|
||||
2,
|
||||
False,
|
||||
)
|
||||
@ -859,7 +859,7 @@ async def test_sending_mqtt_commands_and_optimistic2(
|
||||
# Turn the light off
|
||||
await common.async_turn_off(hass, "light.test")
|
||||
mqtt_mock.async_publish.assert_called_once_with(
|
||||
"test_light_rgb/set", '{"state": "OFF"}', 2, False
|
||||
"test_light_rgb/set", '{"state":"OFF"}', 2, False
|
||||
)
|
||||
mqtt_mock.async_publish.reset_mock()
|
||||
state = hass.states.get("light.test")
|
||||
@ -2004,7 +2004,7 @@ async def test_entity_debug_info_message(hass, mqtt_mock_entry_no_yaml_config):
|
||||
light.DOMAIN,
|
||||
DEFAULT_CONFIG,
|
||||
light.SERVICE_TURN_ON,
|
||||
command_payload='{"state": "ON"}',
|
||||
command_payload='{"state":"ON"}',
|
||||
state_payload='{"state":"ON"}',
|
||||
)
|
||||
|
||||
@ -2038,7 +2038,7 @@ async def test_max_mireds(hass, mqtt_mock_entry_with_yaml_config):
|
||||
light.SERVICE_TURN_ON,
|
||||
"command_topic",
|
||||
None,
|
||||
'{"state": "ON"}',
|
||||
'{"state":"ON"}',
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
@ -2047,7 +2047,7 @@ async def test_max_mireds(hass, mqtt_mock_entry_with_yaml_config):
|
||||
light.SERVICE_TURN_OFF,
|
||||
"command_topic",
|
||||
None,
|
||||
'{"state": "OFF"}',
|
||||
'{"state":"OFF"}',
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
|
Reference in New Issue
Block a user