pub enum SensorEvent {
Show 47 variants
CachedDataLoaded {
devices: Vec<CachedDevice>,
},
ScanStarted,
ScanComplete {
devices: Vec<DiscoveredDevice>,
},
ScanError {
error: String,
},
DeviceConnecting {
device_id: String,
},
DeviceConnected {
device_id: String,
name: Option<String>,
device_type: Option<DeviceType>,
rssi: Option<i16>,
},
DeviceDisconnected {
device_id: String,
},
ConnectionError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
ReadingUpdated {
device_id: String,
reading: CurrentReading,
},
ReadingError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
HistoryLoaded {
device_id: String,
records: Vec<HistoryRecord>,
},
HistorySyncStarted {
device_id: String,
total_records: Option<u16>,
},
HistorySyncProgress {
device_id: String,
downloaded: usize,
total: usize,
},
HistorySynced {
device_id: String,
count: usize,
},
HistorySyncError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
IntervalChanged {
device_id: String,
interval_secs: u16,
},
IntervalError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
SettingsLoaded {
device_id: String,
settings: DeviceSettings,
},
BluetoothRangeChanged {
device_id: String,
extended: bool,
},
BluetoothRangeError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
SmartHomeChanged {
device_id: String,
enabled: bool,
},
SmartHomeError {
device_id: String,
error: String,
context: Option<ErrorContext>,
},
ServiceStatusRefreshed {
reachable: bool,
collector_running: bool,
uptime_seconds: Option<u64>,
devices: Vec<ServiceDeviceStats>,
},
ServiceStatusError {
error: String,
},
ServiceCollectorStarted,
ServiceCollectorStopped,
ServiceCollectorError {
error: String,
},
AliasChanged {
device_id: String,
alias: Option<String>,
},
AliasError {
device_id: String,
error: String,
},
DeviceForgotten {
device_id: String,
},
ForgetDeviceError {
device_id: String,
error: String,
},
OperationCancelled {
operation: String,
},
BackgroundPollingStarted {
device_id: String,
interval_secs: u64,
},
BackgroundPollingStopped {
device_id: String,
},
SignalStrengthUpdate {
device_id: String,
rssi: i16,
quality: SignalQuality,
},
SystemServiceStatus {
installed: bool,
running: bool,
},
SystemServiceInstalled,
SystemServiceUninstalled,
SystemServiceStarted,
SystemServiceStopped,
SystemServiceError {
operation: String,
error: String,
},
ServiceConfigFetched {
devices: Vec<ServiceMonitoredDevice>,
},
ServiceConfigError {
error: String,
},
ServiceDeviceAdded {
device: ServiceMonitoredDevice,
},
ServiceDeviceUpdated {
device: ServiceMonitoredDevice,
},
ServiceDeviceRemoved {
address: String,
},
ServiceDeviceError {
operation: String,
error: String,
},
}Expand description
Events sent from the background worker to the UI thread.
These events represent the results of background operations and are used to update the UI state.
Variants§
CachedDataLoaded
Cached data loaded from the store on startup.
Fields
devices: Vec<CachedDevice>Cached devices with their latest readings.
ScanStarted
A device scan has started.
ScanComplete
A device scan has completed successfully.
Fields
devices: Vec<DiscoveredDevice>The list of discovered devices.
ScanError
A device scan failed.
DeviceConnecting
Attempting to connect to a device.
DeviceConnected
Successfully connected to a device.
Fields
device_type: Option<DeviceType>The device type, if detected.
DeviceDisconnected
Disconnected from a device.
ConnectionError
Failed to connect to a device.
Fields
context: Option<ErrorContext>Additional error context with retry info.
ReadingUpdated
Received an updated reading from a device.
ReadingError
Failed to read from a device.
Fields
context: Option<ErrorContext>Additional error context with retry info.
HistoryLoaded
Historical data loaded for a device.
HistorySyncStarted
History sync started for a device.
Fields
HistorySyncProgress
History sync progress update.
Fields
HistorySynced
History sync completed for a device.
HistorySyncError
History sync failed for a device.
Fields
context: Option<ErrorContext>Additional error context with retry info.
IntervalChanged
Measurement interval changed for a device.
IntervalError
Failed to set measurement interval.
Fields
context: Option<ErrorContext>Additional error context with retry info.
SettingsLoaded
Device settings loaded from the device.
BluetoothRangeChanged
Bluetooth range changed for a device.
Fields
BluetoothRangeError
Failed to set Bluetooth range.
Fields
context: Option<ErrorContext>Additional error context with retry info.
SmartHomeChanged
Smart Home setting changed for a device.
Fields
SmartHomeError
Failed to set Smart Home mode.
Fields
context: Option<ErrorContext>Additional error context with retry info.
ServiceStatusRefreshed
Service status refreshed successfully.
Fields
devices: Vec<ServiceDeviceStats>Monitored devices with their collection stats.
ServiceStatusError
Service status refresh failed.
ServiceCollectorStarted
Service collector started successfully.
ServiceCollectorStopped
Service collector stopped successfully.
ServiceCollectorError
Service collector action failed.
AliasChanged
Device alias changed successfully.
Fields
AliasError
Failed to set device alias.
DeviceForgotten
Device was forgotten (removed from known devices).
ForgetDeviceError
Failed to forget device.
OperationCancelled
An operation was cancelled by user request.
BackgroundPollingStarted
Background polling started for a device.
BackgroundPollingStopped
Background polling stopped for a device.
SignalStrengthUpdate
Signal strength update (can be sent periodically or on connect).
Fields
quality: SignalQualityQuality assessment.
SystemServiceStatus
System service status retrieved.
Fields
SystemServiceInstalled
System service was installed successfully.
SystemServiceUninstalled
System service was uninstalled successfully.
SystemServiceStarted
System service was started successfully.
SystemServiceStopped
System service was stopped successfully.
SystemServiceError
System service operation failed.
ServiceConfigFetched
Service configuration fetched.
Fields
devices: Vec<ServiceMonitoredDevice>List of monitored devices in service config.
ServiceConfigError
Failed to fetch service configuration.
ServiceDeviceAdded
Device added to service monitoring.
Fields
device: ServiceMonitoredDeviceThe device that was added.
ServiceDeviceUpdated
Device updated in service monitoring.
Fields
device: ServiceMonitoredDeviceThe device that was updated.
ServiceDeviceRemoved
Device removed from service monitoring.
ServiceDeviceError
Failed to modify service device.
Trait Implementations§
Source§impl Clone for SensorEvent
impl Clone for SensorEvent
Source§fn clone(&self) -> SensorEvent
fn clone(&self) -> SensorEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SensorEvent
impl RefUnwindSafe for SensorEvent
impl Send for SensorEvent
impl Sync for SensorEvent
impl Unpin for SensorEvent
impl UnwindSafe for SensorEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more