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 2019-10-18 11:04:27 +11:00 committed by Paulus Schoutsen
parent 7637ceb880
commit 1a5b4c105a
19 changed files with 130 additions and 144 deletions

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]