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:
1 parent
8d2d71c16a
commit
b25e951dcc
8 files changed
+32
-32
No files matched your search
@@ -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']
|
||||
|
||||
Reference in new issue
Block a user