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:
Malte Franken authored and Paulus Schoutsen committed 2019-10-17 17:04:27 -07:00
1 parent 7637ceb880
commit 1a5b4c105a
19 files changed
+130 -144

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
"""Modesl used by multiple MQTT modules."""
from typing import Union, Callable
import attr
# pylint: disable=invalid-name
PublishPayloadType = Union[str, bytes, int, float, None]
@attr.s(slots=True, frozen=True)
class Message:
"""MQTT Message."""
topic = attr.ib(type=str)
payload = attr.ib(type=PublishPayloadType)
qos = attr.ib(type=int)
retain = attr.ib(type=bool)
MessageCallbackType = Callable[[Message], None]