rsiot_messages_core/eav_helpers/
command.rs

1use crate::{eav, Timestamp};
2
3/// Команда или событие
4pub struct Command {
5    pub ts: Timestamp,
6    pub entity: String,
7    pub attr: Option<String>,
8}
9
10impl From<Command> for Vec<eav::EavModel> {
11    fn from(value: Command) -> Self {
12        let eav_value = eav::EavModel {
13            ts: value.ts,
14            entity: value.entity,
15            attr: value.attr,
16            value: eav::ValueType::bool(true),
17            agg: eav::AggType::Current,
18            aggts: None,
19            aggnext: vec![eav::AggType::Count, eav::AggType::First],
20        };
21        vec![eav_value]
22    }
23}