Update additional platforms to use new MQTT message callback (#22030)

* Move additional platforms to new MQTT callback

* Fix automation.mqtt
This commit is contained in:
emontnemery authored and Paulus Schoutsen committed 2019-03-14 10:58:32 -07:00
1 parent 8d2d71c16a
commit b25e951dcc
8 files changed
+32 -32

No files matched your search

+4 -4
View File
@@ -95,14 +95,14 @@ async def async_setup(hass, config):
if CONF_FEEDBACK in config[DOMAIN]:
async_set_feedback(None, config[DOMAIN][CONF_FEEDBACK])
async def message_received(topic, payload, qos):
async def message_received(msg):
"""Handle new messages on MQTT."""
_LOGGER.debug("New intent: %s", payload)
_LOGGER.debug("New intent: %s", msg.payload)
try:
request = json.loads(payload)
request = json.loads(msg.payload)
except TypeError:
_LOGGER.error('Received invalid JSON: %s', payload)
_LOGGER.error('Received invalid JSON: %s', msg.payload)
return
if (request['intent']['confidenceScore']