Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bytes = "1.0"
chacha20poly1305 = "0.8"
ed25519-dalek = { version = "1.0", features = ["std", "serde"] }
erased-serde = "0.3"
eui48 = { version = "1.0", features = ["serde"] }
macaddr = { version = "1.0.1", features = ["serde"] }
futures = "0.3"
get_if_addrs = "0.5"
hkdf = "0.11"
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: \"Acme {{service.DefaultDescription}}\".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: {{category service.DefaultDescription}},
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/adding_accessories_dynamically.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Bridge".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Bridge,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/air_purifier.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{air_purifier::AirPurifierAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, air_purifier::AirPurifierAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Air Purifier".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::AirPurifier,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/air_quality_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{air_quality_sensor::AirQualitySensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, air_quality_sensor::AirQualitySensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Air Quality Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/async_callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Lightbulb".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Lightbulb,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/bridged_accessories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Bridge".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Bridge,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Lightbulb".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Lightbulb,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/carbon_dioxide_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{carbon_dioxide_sensor::CarbonDioxideSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, carbon_dioxide_sensor::CarbonDioxideSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Carbon dioxide Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/carbon_monoxide_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{carbon_monoxide_sensor::CarbonMonoxideSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, carbon_monoxide_sensor::CarbonMonoxideSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Carbon monoxide Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/contact_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{contact_sensor::ContactSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, contact_sensor::ContactSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Contact Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/cooler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Cooler".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::AirConditioner,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_characteristics_services_accessories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Foo".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Other,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_multi_sensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Temperature & Humidity Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/dehumidifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Dehumidifier".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::AirDehumidifier,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/door.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{door::DoorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, door::DoorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Door".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Door,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/fan.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{fan::FanAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, fan::FanAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Fan".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Fan,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/fan_v2.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{fan_v2::FanV2Accessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, fan_v2::FanV2Accessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Fan v2".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Fan,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/faucet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Faucet".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Faucet,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/garage_door_opener.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{garage_door_opener::GarageDoorOpenerAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, garage_door_opener::GarageDoorOpenerAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Garage Door Opener".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::GarageDoorOpener,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/heater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Heater".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::AirHeater,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/humidifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Humidifier-Dehumidifier".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::AirDehumidifier,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/humidity_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{humidity_sensor::HumiditySensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, humidity_sensor::HumiditySensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Humidity Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/irrigation_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Irrigation-System".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sprinkler,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/leak_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{leak_sensor::LeakSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, leak_sensor::LeakSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Leak Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/light_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{light_sensor::LightSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, light_sensor::LightSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Light Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/lightbulb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Lightbulb".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Lightbulb,
..Default::default()
};
Expand Down
2 changes: 1 addition & 1 deletion examples/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Lock".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::DoorLock,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/motion_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{motion_sensor::MotionSensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, motion_sensor::MotionSensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Motion Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
4 changes: 2 additions & 2 deletions examples/occupancy_sensor.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use tokio;

use hap::{
accessory::{occupancy_sensor::OccupancySensorAccessory, AccessoryCategory, AccessoryInformation},
accessory::{AccessoryCategory, AccessoryInformation, occupancy_sensor::OccupancySensorAccessory},
server::{IpServer, Server},
storage::{FileStorage, Storage},
Config,
Expand Down Expand Up @@ -29,7 +29,7 @@ async fn main() -> Result<()> {
let config = Config {
pin: Pin::new([1, 1, 1, 2, 2, 3, 3, 3])?,
name: "Acme Occupancy Sensor".into(),
device_id: MacAddress::new([10, 20, 30, 40, 50, 60]),
device_id: MacAddress::from([10, 20, 30, 40, 50, 60]),
category: AccessoryCategory::Sensor,
..Default::default()
};
Expand Down
Loading