denki 0.2.0

CLI for controlling TP-Link smart home devices — denki (電気) means electricity in Japanese
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use serde::Serialize;

/// The sections that a request reads of a module: `{"name": ["basic_info"]}`.
#[derive(Debug, Serialize)]
pub(crate) struct SectionNames {
    name: Vec<String>,
}

impl SectionNames {
    pub fn new(names: &[&str]) -> Self {
        Self {
            name: names.iter().map(|s| (*s).to_string()).collect(),
        }
    }
}