mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 08:34:21 +02:00
update dependencies
This commit is contained in:
parent
58ee4aab9a
commit
887c84d071
3 changed files with 182 additions and 255 deletions
14
src/topic.rs
14
src/topic.rs
|
|
@ -37,26 +37,22 @@ impl From<&str> for Topic {
|
|||
fn parse_topic() {
|
||||
let device = Device {
|
||||
hostname: "hostname".to_string(),
|
||||
topic: "foo".to_string(),
|
||||
};
|
||||
assert_eq!(
|
||||
Topic::LWT(device.clone()),
|
||||
Topic::from("tele/foo/hostname/LWT")
|
||||
);
|
||||
assert_eq!(Topic::LWT(device.clone()), Topic::from("tele/hostname/LWT"));
|
||||
assert_eq!(
|
||||
Topic::Power(device.clone()),
|
||||
Topic::from("stat/foo/hostname/POWER")
|
||||
Topic::from("stat/hostname/POWER")
|
||||
);
|
||||
assert_eq!(
|
||||
Topic::State(device.clone()),
|
||||
Topic::from("tele/foo/hostname/STATE")
|
||||
Topic::from("tele/hostname/STATE")
|
||||
);
|
||||
assert_eq!(
|
||||
Topic::Sensor(device.clone()),
|
||||
Topic::from("tele/foo/hostname/SENSOR")
|
||||
Topic::from("tele/hostname/SENSOR")
|
||||
);
|
||||
assert_eq!(
|
||||
Topic::Result(device.clone()),
|
||||
Topic::from("stat/foo/hostname/RESULT")
|
||||
Topic::from("stat/hostname/RESULT")
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue