pub enum ControlCommand {
Show 17 variants
Floodlight {
camera: String,
state: bool,
},
FloodlightTasks {
camera: String,
state: bool,
},
Led {
camera: String,
state: bool,
},
Ir {
camera: String,
mode: IrMode,
},
Pir {
camera: String,
state: bool,
},
Reboot {
camera: String,
},
Ptz {
camera: String,
direction: PtzDirection,
amount: f32,
},
PtzPreset {
camera: String,
preset_id: u8,
},
PtzPresetByName {
camera: String,
name: String,
},
PtzAssign {
camera: String,
preset_id: u8,
name: String,
},
Zoom {
camera: String,
level: f32,
},
Siren {
camera: String,
state: bool,
},
Wakeup {
camera: String,
minutes: u32,
},
QueryBattery {
camera: String,
},
QueryPreview {
camera: String,
},
QueryPir {
camera: String,
},
QueryPtzPreset {
camera: String,
},
}Expand description
A validated control or query command extracted from an MQTT message.
Variants§
Floodlight
FloodlightTasks
Led
Ir
Pir
Reboot
Ptz
PtzPreset
PtzPresetByName
Variant used by HA’s preset select entity, which publishes the
preset name (the option label). The dispatcher resolves the
name to an id via the camera’s preset_cache.
PtzAssign
Zoom
Siren
Wakeup
QueryBattery
QueryPreview
QueryPir
QueryPtzPreset
Implementations§
Source§impl ControlCommand
impl ControlCommand
Sourcepub fn control_topic(&self, prefix: &str) -> String
pub fn control_topic(&self, prefix: &str) -> String
Returns the MQTT control topic this command was received on.
Used for publishing OK/FAIL replies. prefix is the configured
mqtt.topic_prefix.
Sourcepub fn camera_name(&self) -> &str
pub fn camera_name(&self) -> &str
Returns the camera name that this command targets.
Trait Implementations§
Source§impl Clone for ControlCommand
impl Clone for ControlCommand
Source§fn clone(&self) -> ControlCommand
fn clone(&self) -> ControlCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ControlCommand
impl RefUnwindSafe for ControlCommand
impl Send for ControlCommand
impl Sync for ControlCommand
impl Unpin for ControlCommand
impl UnsafeUnpin for ControlCommand
impl UnwindSafe for ControlCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more