mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 02:37:08 +00:00
Fix encoding for MQTT camera (#20932)
This commit is contained in:
parent
5def64156f
commit
5f7f7777a0
@ -110,7 +110,8 @@ class MqttCamera(MqttDiscoveryUpdate, Camera):
|
|||||||
self.hass, self._sub_state,
|
self.hass, self._sub_state,
|
||||||
{'state_topic': {'topic': self._config.get(CONF_TOPIC),
|
{'state_topic': {'topic': self._config.get(CONF_TOPIC),
|
||||||
'msg_callback': message_received,
|
'msg_callback': message_received,
|
||||||
'qos': self._qos}})
|
'qos': self._qos,
|
||||||
|
'encoding': None}})
|
||||||
|
|
||||||
async def async_will_remove_from_hass(self):
|
async def async_will_remove_from_hass(self):
|
||||||
"""Unsubscribe when removed."""
|
"""Unsubscribe when removed."""
|
||||||
|
@ -168,7 +168,7 @@ async def test_entity_id_update(hass, mqtt_mock):
|
|||||||
state = hass.states.get('camera.beer')
|
state = hass.states.get('camera.beer')
|
||||||
assert state is not None
|
assert state is not None
|
||||||
assert mock_mqtt.async_subscribe.call_count == 1
|
assert mock_mqtt.async_subscribe.call_count == 1
|
||||||
mock_mqtt.async_subscribe.assert_any_call('test-topic', ANY, 0, 'utf-8')
|
mock_mqtt.async_subscribe.assert_any_call('test-topic', ANY, 0, None)
|
||||||
mock_mqtt.async_subscribe.reset_mock()
|
mock_mqtt.async_subscribe.reset_mock()
|
||||||
|
|
||||||
registry.async_update_entity('camera.beer', new_entity_id='camera.milk')
|
registry.async_update_entity('camera.beer', new_entity_id='camera.milk')
|
||||||
@ -181,4 +181,4 @@ async def test_entity_id_update(hass, mqtt_mock):
|
|||||||
state = hass.states.get('camera.milk')
|
state = hass.states.get('camera.milk')
|
||||||
assert state is not None
|
assert state is not None
|
||||||
assert mock_mqtt.async_subscribe.call_count == 1
|
assert mock_mqtt.async_subscribe.call_count == 1
|
||||||
mock_mqtt.async_subscribe.assert_any_call('test-topic', ANY, 0, 'utf-8')
|
mock_mqtt.async_subscribe.assert_any_call('test-topic', ANY, 0, None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user