Move imports in mqtt component (#27835)
* move imports to top-level in mqtt server * move imports to top-level in mqtt configflow * move imports to top-level in mqtt init * move imports to top-level in mqtt vacuum * move imports to top-level in mqtt light
This commit is contained in:
parent
7637ceb880
commit
1a5b4c105a
19 changed files with 130 additions and 144 deletions
|
@ -27,6 +27,7 @@ from homeassistant.auth import (
|
|||
)
|
||||
from homeassistant.auth.permissions import system_policies
|
||||
from homeassistant.components import mqtt, recorder
|
||||
from homeassistant.components.mqtt.models import Message
|
||||
from homeassistant.config import async_process_component_config
|
||||
from homeassistant.const import (
|
||||
ATTR_DISCOVERED,
|
||||
|
@ -271,7 +272,7 @@ def async_fire_mqtt_message(hass, topic, payload, qos=0, retain=False):
|
|||
"""Fire the MQTT message."""
|
||||
if isinstance(payload, str):
|
||||
payload = payload.encode("utf-8")
|
||||
msg = mqtt.Message(topic, payload, qos, retain)
|
||||
msg = Message(topic, payload, qos, retain)
|
||||
hass.data["mqtt"]._mqtt_handle_message(msg)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue