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:
1 parent
7637ceb880
commit
1a5b4c105a
19 files changed
+130
-144
No files matched your search
+2
-1
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user