2022-07-14 16:09:09 +00:00
|
|
|
"""MQTT Discovery data."""
|
|
|
|
from dataclasses import dataclass
|
|
|
|
import datetime as dt
|
|
|
|
|
|
|
|
from homeassistant.data_entry_flow import BaseServiceInfo
|
|
|
|
|
2023-01-23 08:04:40 +00:00
|
|
|
ReceivePayloadType = str | bytes
|
2022-07-14 16:09:09 +00:00
|
|
|
|
|
|
|
|
2023-04-11 17:58:28 +00:00
|
|
|
@dataclass(slots=True)
|
2022-07-14 16:09:09 +00:00
|
|
|
class MqttServiceInfo(BaseServiceInfo):
|
|
|
|
"""Prepared info from mqtt entries."""
|
|
|
|
|
|
|
|
topic: str
|
|
|
|
payload: ReceivePayloadType
|
|
|
|
qos: int
|
|
|
|
retain: bool
|
|
|
|
subscribed_topic: str
|
|
|
|
timestamp: dt.datetime
|