Correct arguments to MQTT will_set (#38036)

pull/38038/head^2
Erik Montnemery 2020-07-21 21:36:21 +02:00 committed by GitHub
parent 01d2d2f315
commit 908b72370b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -716,7 +716,8 @@ class MQTT:
self._mqttc.will_set( # pylint: disable=no-value-for-parameter self._mqttc.will_set( # pylint: disable=no-value-for-parameter
*attr.astuple( *attr.astuple(
will_message, will_message,
filter=lambda attr, value: attr.name != "subscribed_topic", filter=lambda attr, value: attr.name
not in ["subscribed_topic", "timestamp"],
) )
) )

View File

@ -799,13 +799,13 @@ async def test_no_birth_message(hass, mqtt_client_mock, mqtt_mock):
) )
async def test_custom_will_message(hass, mqtt_client_mock, mqtt_mock): async def test_custom_will_message(hass, mqtt_client_mock, mqtt_mock):
"""Test will message.""" """Test will message."""
mqtt_client_mock.will_set.assert_called_with("death", "death", 0, False, None) mqtt_client_mock.will_set.assert_called_with("death", "death", 0, False)
async def test_default_will_message(hass, mqtt_client_mock, mqtt_mock): async def test_default_will_message(hass, mqtt_client_mock, mqtt_mock):
"""Test will message.""" """Test will message."""
mqtt_client_mock.will_set.assert_called_with( mqtt_client_mock.will_set.assert_called_with(
"homeassistant/status", "offline", 0, False, None "homeassistant/status", "offline", 0, False
) )