update dependencies

This commit is contained in:
Robin Appelman 2021-07-31 15:19:58 +02:00
commit 887c84d071
3 changed files with 182 additions and 255 deletions

View file

@ -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")
);
}