Removed DebugBridge as it no longer served a purpose
This commit is contained in:
@@ -1,39 +0,0 @@
|
|||||||
use std::convert::Infallible;
|
|
||||||
|
|
||||||
use async_trait::async_trait;
|
|
||||||
use automation_lib::config::MqttDeviceConfig;
|
|
||||||
use automation_lib::device::{Device, LuaDeviceCreate};
|
|
||||||
use automation_lib::mqtt::WrappedAsyncClient;
|
|
||||||
use automation_macro::{LuaDevice, LuaDeviceConfig};
|
|
||||||
use tracing::trace;
|
|
||||||
|
|
||||||
#[derive(Debug, LuaDeviceConfig, Clone)]
|
|
||||||
pub struct Config {
|
|
||||||
pub identifier: String,
|
|
||||||
#[device_config(flatten)]
|
|
||||||
pub mqtt: MqttDeviceConfig,
|
|
||||||
#[device_config(from_lua)]
|
|
||||||
pub client: WrappedAsyncClient,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, LuaDevice)]
|
|
||||||
pub struct DebugBridge {
|
|
||||||
config: Config,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[async_trait]
|
|
||||||
impl LuaDeviceCreate for DebugBridge {
|
|
||||||
type Config = Config;
|
|
||||||
type Error = Infallible;
|
|
||||||
|
|
||||||
async fn create(config: Self::Config) -> Result<Self, Self::Error> {
|
|
||||||
trace!(id = config.identifier, "Setting up DebugBridge");
|
|
||||||
Ok(Self { config })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Device for DebugBridge {
|
|
||||||
fn get_id(&self) -> String {
|
|
||||||
self.config.identifier.clone()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
mod air_filter;
|
mod air_filter;
|
||||||
mod contact_sensor;
|
mod contact_sensor;
|
||||||
mod debug_bridge;
|
|
||||||
mod hue_bridge;
|
mod hue_bridge;
|
||||||
mod hue_group;
|
mod hue_group;
|
||||||
mod hue_switch;
|
mod hue_switch;
|
||||||
@@ -19,7 +18,6 @@ use zigbee::outlet::{OutletOnOff, OutletPower};
|
|||||||
|
|
||||||
pub use self::air_filter::AirFilter;
|
pub use self::air_filter::AirFilter;
|
||||||
pub use self::contact_sensor::ContactSensor;
|
pub use self::contact_sensor::ContactSensor;
|
||||||
pub use self::debug_bridge::DebugBridge;
|
|
||||||
pub use self::hue_bridge::HueBridge;
|
pub use self::hue_bridge::HueBridge;
|
||||||
pub use self::hue_group::HueGroup;
|
pub use self::hue_group::HueGroup;
|
||||||
pub use self::hue_switch::HueSwitch;
|
pub use self::hue_switch::HueSwitch;
|
||||||
@@ -41,7 +39,6 @@ macro_rules! register_device {
|
|||||||
pub fn register_with_lua(lua: &mlua::Lua) -> mlua::Result<()> {
|
pub fn register_with_lua(lua: &mlua::Lua) -> mlua::Result<()> {
|
||||||
register_device!(lua, AirFilter);
|
register_device!(lua, AirFilter);
|
||||||
register_device!(lua, ContactSensor);
|
register_device!(lua, ContactSensor);
|
||||||
register_device!(lua, DebugBridge);
|
|
||||||
register_device!(lua, HueBridge);
|
register_device!(lua, HueBridge);
|
||||||
register_device!(lua, HueGroup);
|
register_device!(lua, HueGroup);
|
||||||
register_device!(lua, HueSwitch);
|
register_device!(lua, HueSwitch);
|
||||||
|
|||||||
@@ -103,12 +103,6 @@ on_light:add(function(light)
|
|||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
automation.device_manager:add(DebugBridge.new({
|
|
||||||
identifier = "debug_bridge",
|
|
||||||
topic = mqtt_automation("debug"),
|
|
||||||
client = mqtt_client,
|
|
||||||
}))
|
|
||||||
|
|
||||||
local hue_ip = "10.0.0.102"
|
local hue_ip = "10.0.0.102"
|
||||||
local hue_token = automation.util.get_env("HUE_TOKEN")
|
local hue_token = automation.util.get_env("HUE_TOKEN")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user