pub struct MqttIncomingReadingDto {
pub value: f64,
pub unit: String,
pub ts: DateTime<Utc>,
pub device_type: DeviceType,
pub metric_type: MetricType,
pub quality: Option<String>,
}Expand description
DTO pour les messages entrants depuis MQTT (Home Assistant → Mosquitto → KoproGo). Correspond au JSON publié par Home Assistant automations.
Exemple de payload Home Assistant:
{
"value": 12.47,
"unit": "kWh",
"ts": "2026-03-17T14:00:00Z",
"device_type": "electricity_meter",
"metric_type": "electricity_consumption",
"quality": "good"
}Fields§
§value: f64Valeur mesurée
unit: StringUnité (ex: “kWh”, “°C”, “%”)
ts: DateTime<Utc>Timestamp ISO8601 émis par le capteur
device_type: DeviceTypeType d’appareil (serde snake_case)
metric_type: MetricTypeType de métrique (serde snake_case)
quality: Option<String>Qualité de la mesure (“good”, “estimated”, “bad”)
Trait Implementations§
Source§impl Clone for MqttIncomingReadingDto
impl Clone for MqttIncomingReadingDto
Source§fn clone(&self) -> MqttIncomingReadingDto
fn clone(&self) -> MqttIncomingReadingDto
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MqttIncomingReadingDto
impl Debug for MqttIncomingReadingDto
Source§impl<'de> Deserialize<'de> for MqttIncomingReadingDto
impl<'de> Deserialize<'de> for MqttIncomingReadingDto
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for MqttIncomingReadingDto
impl RefUnwindSafe for MqttIncomingReadingDto
impl Send for MqttIncomingReadingDto
impl Sync for MqttIncomingReadingDto
impl Unpin for MqttIncomingReadingDto
impl UnwindSafe for MqttIncomingReadingDto
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.