mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-08-02 12:14:45 +02:00
new mqtt topic
This commit is contained in:
parent
f51fe2c2ab
commit
f0e28ed95c
3 changed files with 7 additions and 9 deletions
|
|
@ -13,11 +13,10 @@ pub enum Topic {
|
|||
impl From<&str> for Topic {
|
||||
fn from(raw: &str) -> Self {
|
||||
let mut parts = raw.split('/');
|
||||
if let (Some(prefix), Some(topic), Some(hostname), Some(cmd)) =
|
||||
(parts.next(), parts.next(), parts.next(), parts.next())
|
||||
if let (Some(prefix), Some(hostname), Some(cmd)) =
|
||||
(parts.next(), parts.next(), parts.next())
|
||||
{
|
||||
let device = Device {
|
||||
topic: topic.to_string(),
|
||||
hostname: hostname.to_string(),
|
||||
};
|
||||
match (prefix, cmd) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue