21 lines
434 B
Python
21 lines
434 B
Python
|
"""MQTT Discovery data."""
|
||
|
from dataclasses import dataclass
|
||
|
import datetime as dt
|
||
|
from typing import Union
|
||
|
|
||
|
from homeassistant.data_entry_flow import BaseServiceInfo
|
||
|
|
||
|
ReceivePayloadType = Union[str, bytes]
|
||
|
|
||
|
|
||
|
@dataclass
|
||
|
class MqttServiceInfo(BaseServiceInfo):
|
||
|
"""Prepared info from mqtt entries."""
|
||
|
|
||
|
topic: str
|
||
|
payload: ReceivePayloadType
|
||
|
qos: int
|
||
|
retain: bool
|
||
|
subscribed_topic: str
|
||
|
timestamp: dt.datetime
|