1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// SPDX-License-Identifier: MPL-2.0
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
//! Response parsing for Tasmota JSON responses.
//!
//! This module provides structures for deserializing JSON responses from
//! Tasmota devices. Each response type corresponds to a specific command
//! or status query.
//!
//! # Response Types
//!
//! | Response Type | Tasmota Commands | Description |
//! |--------------|------------------|-------------|
//! | [`PowerResponse`] | `Power`, `Power1`-`Power8` | Relay on/off state |
//! | [`DimmerResponse`] | `Dimmer` | Brightness level (0-100) |
//! | [`HsbColorResponse`] | `HSBColor` | Color in HSB format |
//! | [`RgbColorResponse`] | `HSBColor` (via RGB) | Color in RGB format |
//! | [`ColorTemperatureResponse`] | `CT` | White color temperature |
//! | [`SchemeResponse`] | `Scheme` | Light scheme/effect (0-4) |
//! | [`WakeupDurationResponse`] | `WakeupDuration` | Wakeup effect duration |
//! | [`FadeResponse`] | `Fade` | Fade transition enable/disable |
//! | [`FadeDurationResponse`] | `Speed` | Fade transition duration (0.5-20s) |
//! | [`StartupFadeResponse`] | `SetOption91` | Fade at startup setting |
//! | [`EnergyResponse`] | `Status 10` | Power consumption data |
//! | [`StatusResponse`] | `Status 0` | Full device status |
//!
//! # Usage Pattern
//!
//! Response types are typically used with `serde_json` to parse the JSON
//! returned by [`Device::send_command`](crate::Device::send_command):
//!
//! ```
//! use tasmor_lib::response::PowerResponse;
//!
//! // Tasmota returns JSON like: {"POWER": "ON"} or {"POWER1": "ON", "POWER2": "OFF"}
//! let json = r#"{"POWER": "ON"}"#;
//! let response: PowerResponse = serde_json::from_str(json).unwrap();
//!
//! // Query the power state
//! let state = response.first_power_state().unwrap();
//! println!("Power is: {}", state); // "ON"
//! ```
pub use ;
pub use DimmerResponse;
pub use EnergyResponse;
pub use ;
pub use PowerResponse;
pub use RgbColorResponse;
pub use RoutineResponse;
pub use ;
pub use ;