use crate::state::{DeviceState, StateChange};
use crate::subscription::{EnergyData, SubscriptionId};
use crate::types::{ColorTemperature, Dimmer, HsbColor, PowerState, Scheme};
pub trait Subscribable {
fn on_power_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(u8, PowerState) + Send + Sync + 'static;
fn on_dimmer_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(Dimmer) + Send + Sync + 'static;
fn on_color_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(HsbColor) + Send + Sync + 'static;
fn on_color_temp_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(ColorTemperature) + Send + Sync + 'static;
fn on_scheme_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(Scheme) + Send + Sync + 'static;
fn on_energy_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(EnergyData) + Send + Sync + 'static;
fn on_connected<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(&DeviceState) + Send + Sync + 'static;
fn on_disconnected<F>(&self, callback: F) -> SubscriptionId
where
F: Fn() + Send + Sync + 'static;
fn on_reconnected<F>(&self, callback: F) -> SubscriptionId
where
F: Fn() + Send + Sync + 'static;
fn on_state_changed<F>(&self, callback: F) -> SubscriptionId
where
F: Fn(&StateChange) + Send + Sync + 'static;
fn unsubscribe(&self, id: SubscriptionId) -> bool;
}