pub struct Scene {
pub name: String,
pub id: i64,
pub param_id: Option<i64>,
pub capability_type: String,
pub instance: String,
}Expand description
A light scene (dynamic or DIY) that can be activated on a device.
Dynamic light scenes (from /router/api/v1/device/scenes) carry a
param_id alongside the scene id; DIY scenes (from
/router/api/v1/device/diy-scenes) are identified by a single integer
value, so param_id is None.
Fields§
§name: StringHuman-readable scene name (e.g., “Sunrise”)
id: i64Scene identifier sent in the control request
param_id: Option<i64>Companion parameter id (dynamic light scenes only)
capability_type: StringCapability type to send when activating this scene (e.g., “devices.capabilities.dynamic_scene” or “devices.capabilities.diy_color_setting”)
instance: StringCapability instance to send when activating this scene (e.g., “lightScene” or “diyScene”)
Implementations§
Source§impl Scene
impl Scene
Sourcepub fn control_value(&self) -> Value
pub fn control_value(&self) -> Value
The control-request value for this scene:
{"paramId": .., "id": ..} for dynamic scenes, a bare integer for
DIY scenes.
Sourcepub fn from_capabilities(capabilities: &[Capability]) -> Vec<Scene>
pub fn from_capabilities(capabilities: &[Capability]) -> Vec<Scene>
Extract scenes from a list of scene capabilities (as returned by the scenes and diy-scenes endpoints).