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
16
17
use serde::Deserialize;

use crate::tapo_vendor::responses::{TapoResponse, TapoResponseExt};

/// SmartCam `controlChild` item result. Unlike the Smart
/// [`ControlChildResult`](crate::tapo_vendor::responses::ControlChildResult), the field is
/// snake_case and wraps a single [`TapoResponse`] (not a multiple-request batch).
#[derive(Debug, Deserialize)]
pub(crate) struct SmartCamControlChildResult<T: TapoResponseExt> {
    /// Set instead of `response_data` when the hub refuses to relay the
    /// request, e.g. `-50021` for a model it does not support.
    #[serde(default)]
    pub err_code: i64,
    pub response_data: Option<TapoResponse<T>>,
}

impl<T: TapoResponseExt> TapoResponseExt for SmartCamControlChildResult<T> {}