get characteristics works!

This commit is contained in:
Alex Janka 2024-02-22 15:29:20 +11:00
parent ab735cf980
commit 015563947e
4 changed files with 323 additions and 291 deletions

View file

@ -7,7 +7,11 @@ use tokio::{
net::TcpStream,
};
use crate::{tlv8::TlvEncode, HomekitError};
use crate::{
pairing_data::{Accessory, ServiceCharacteristic},
tlv8::TlvEncode,
HomekitError,
};
pub(super) struct AccessorySocket {
socket: TcpStream,
@ -77,27 +81,24 @@ impl AccessorySocket {
.await
}
pub async fn get_accessories(&mut self) -> Result<String, HomekitError> {
pub async fn get_accessories(&mut self) -> Result<Vec<Accessory>, HomekitError> {
let response = self.req("/accessories", Method::GET, None, &[]).await?;
Ok(String::from_utf8(response)?)
let accessories: crate::pairing_data::Accessories = serde_json::from_slice(&response)?;
Ok(accessories.accessories)
}
pub async fn get_characteristics(
&mut self,
characteristics: &[String],
) -> Result<(), HomekitError> {
) -> Result<Vec<ServiceCharacteristic>, HomekitError> {
let characteristic_request = characteristics.join(",");
let url =
format!("/characteristics?id={characteristic_request}&meta=1&perms=1&type=1&ev=1");
let response = self.req(&url, Method::GET, None, &[]).await?;
if let Ok(string) = String::from_utf8(response.clone()) {
log::info!("got as string: {string}")
} else {
log::info!("got: {response:?}");
}
let characteristics: crate::pairing_data::Characteristics =
serde_json::from_slice(&response)?;
Ok(())
Ok(characteristics.characteristics)
}
pub async fn req(
@ -184,9 +185,9 @@ impl AccessorySocket {
log::info!("response:\n{response:#?}");
let header_size = match result {
httparse::Status::Complete(header_size) => header_size,
httparse::Status::Partial => panic!("LOL"),
};
httparse::Status::Complete(header_size) => Ok(header_size),
httparse::Status::Partial => Err(HomekitError::Http),
}?;
let mut packet = packet[header_size..].to_vec();
if let Some(transfer_encoding) = response
@ -223,6 +224,20 @@ impl AccessorySocket {
}
}
}
if let Some(content_length) = response
.headers
.iter()
.find(|v| v.name.to_lowercase() == "Content-Length".to_lowercase())
{
if let Some(length) = std::str::from_utf8(content_length.value)
.ok()
.and_then(|v| v.parse::<usize>().ok())
{
while packet.len() < length {
packet.append(&mut self.get_next().await?);
}
}
}
Ok(packet)
}

View file

@ -244,22 +244,24 @@ impl DevicePairingData {
socket.set_encryption(controller_to_accessory_key, accessory_to_controller_key);
socket.get_accessories().await?;
let accessories = socket.get_accessories().await?;
log::info!("accessories: {accessories:#?}");
for a in &accessories {
log::info!("{}: service ids: {:#?}", a.id, a.get_service_ids());
}
// now get characteristics
// socket
// .get_characteristics(
// &self
// .accessories
// .as_ref()
// .map(|a| {
// a.iter()
// .flat_map(|v| v.get_service_ids())
// .collect::<Vec<_>>()
// })
// .unwrap_or_default(),
// )
// .await?;
let characteristics = socket
.get_characteristics(
&accessories
.iter()
.flat_map(|v| v.get_service_ids())
.collect::<Vec<_>>(),
)
.await?;
log::info!("characteristics:\n{characteristics:#?}");
Ok(())
}

View file

@ -477,309 +477,309 @@ impl std::fmt::Display for CharacteristicType {
#[derive(Deserialize)]
#[serde(field_identifier)]
enum CharacteristicTypeInner {
#[serde(rename = "000000E5-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E5-0000-1000-8000-0026BB765291", alias = "E5")]
AccessControlLevel,
#[serde(rename = "000000A6-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A6-0000-1000-8000-0026BB765291", alias = "A6")]
AccessoryFlags,
#[serde(rename = "00000220-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000220-0000-1000-8000-0026BB765291", alias = "220")]
ProductData,
#[serde(rename = "000000B0-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B0-0000-1000-8000-0026BB765291", alias = "B0")]
Active,
#[serde(rename = "00000001-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000001-0000-1000-8000-0026BB765291", alias = "1")]
AdministratorOnlyAccess,
#[serde(rename = "00000064-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000064-0000-1000-8000-0026BB765291", alias = "64")]
AirParticulateDensity,
#[serde(rename = "00000065-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000065-0000-1000-8000-0026BB765291", alias = "65")]
AirParticulateSize,
#[serde(rename = "00000095-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000095-0000-1000-8000-0026BB765291", alias = "95")]
AirQuality,
#[serde(rename = "00000005-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000005-0000-1000-8000-0026BB765291", alias = "5")]
AudioFeedback,
#[serde(rename = "00000068-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000068-0000-1000-8000-0026BB765291", alias = "68")]
BatteryLevel,
#[serde(rename = "00000008-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000008-0000-1000-8000-0026BB765291", alias = "8")]
Brightness,
#[serde(rename = "00000092-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000092-0000-1000-8000-0026BB765291", alias = "92")]
CarbonDioxideDetected,
#[serde(rename = "00000093-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000093-0000-1000-8000-0026BB765291", alias = "93")]
CarbonDioxideLevel,
#[serde(rename = "00000094-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000094-0000-1000-8000-0026BB765291", alias = "94")]
CarbonDioxidePeakLevel,
#[serde(rename = "00000069-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000069-0000-1000-8000-0026BB765291", alias = "69")]
CarbonMonoxideDetected,
#[serde(rename = "00000090-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000090-0000-1000-8000-0026BB765291", alias = "90")]
CarbonMonoxideLevel,
#[serde(rename = "00000091-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000091-0000-1000-8000-0026BB765291", alias = "91")]
CarbonMonoxidePeakLevel,
#[serde(rename = "0000008F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008F-0000-1000-8000-0026BB765291", alias = "8F")]
ChargingState,
#[serde(rename = "000000CE-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CE-0000-1000-8000-0026BB765291", alias = "CE")]
ColorTemperature,
#[serde(rename = "0000006A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006A-0000-1000-8000-0026BB765291", alias = "6A")]
ContactSensorState,
#[serde(rename = "0000000D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000000D-0000-1000-8000-0026BB765291", alias = "D")]
CoolingThresholdTemperature,
#[serde(rename = "000000A9-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A9-0000-1000-8000-0026BB765291", alias = "A9")]
CurrentAirPurifierState,
#[serde(rename = "0000006B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006B-0000-1000-8000-0026BB765291", alias = "6B")]
CurrentAmbientLightLevel,
#[serde(rename = "0000000E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000000E-0000-1000-8000-0026BB765291", alias = "E")]
CurrentDoorState,
#[serde(rename = "000000AF-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AF-0000-1000-8000-0026BB765291", alias = "AF")]
CurrentFanState,
#[serde(rename = "000000B1-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B1-0000-1000-8000-0026BB765291", alias = "B1")]
CurrentHeaterCoolerState,
#[serde(rename = "0000000F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000000F-0000-1000-8000-0026BB765291", alias = "F")]
CurrentHeatingCoolingState,
#[serde(rename = "0000006C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006C-0000-1000-8000-0026BB765291", alias = "6C")]
CurrentHorizontalTiltAngle,
#[serde(rename = "000000B3-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B3-0000-1000-8000-0026BB765291", alias = "B3")]
CurrentHumidifierDehumidifierState,
#[serde(rename = "0000006D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006D-0000-1000-8000-0026BB765291", alias = "6D")]
CurrentPosition,
#[serde(rename = "00000010-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000010-0000-1000-8000-0026BB765291", alias = "10")]
CurrentRelativeHumidity,
#[serde(rename = "000000AA-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AA-0000-1000-8000-0026BB765291", alias = "AA")]
CurrentSlatState,
#[serde(rename = "00000011-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000011-0000-1000-8000-0026BB765291", alias = "11")]
CurrentTemperature,
#[serde(rename = "000000C1-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C1-0000-1000-8000-0026BB765291", alias = "C1")]
CurrentTiltAngle,
#[serde(rename = "0000006E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006E-0000-1000-8000-0026BB765291", alias = "6E")]
CurrentVerticalTiltAngle,
#[serde(rename = "0000011D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011D-0000-1000-8000-0026BB765291", alias = "11D")]
DigitalZoom,
#[serde(rename = "000000AC-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AC-0000-1000-8000-0026BB765291", alias = "AC")]
FilterChangeIndication,
#[serde(rename = "000000AB-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AB-0000-1000-8000-0026BB765291", alias = "AB")]
FilterLifeLevel,
#[serde(rename = "00000052-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000052-0000-1000-8000-0026BB765291", alias = "52")]
FirmwareRevision,
#[serde(rename = "00000053-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000053-0000-1000-8000-0026BB765291", alias = "53")]
HardwareRevision,
#[serde(rename = "00000012-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000012-0000-1000-8000-0026BB765291", alias = "12")]
HeatingThresholdTemperature,
#[serde(rename = "0000006F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000006F-0000-1000-8000-0026BB765291", alias = "6F")]
HoldPosition,
#[serde(rename = "00000013-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000013-0000-1000-8000-0026BB765291", alias = "13")]
Hue,
#[serde(rename = "00000014-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000014-0000-1000-8000-0026BB765291", alias = "14")]
Identify,
#[serde(rename = "0000011F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011F-0000-1000-8000-0026BB765291", alias = "11F")]
ImageMirroring,
#[serde(rename = "0000011E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011E-0000-1000-8000-0026BB765291", alias = "11E")]
ImageRotation,
#[serde(rename = "000000D2-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D2-0000-1000-8000-0026BB765291", alias = "D2")]
InUse,
#[serde(rename = "000000D6-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D6-0000-1000-8000-0026BB765291", alias = "D6")]
IsConfigured,
#[serde(rename = "00000070-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000070-0000-1000-8000-0026BB765291", alias = "70")]
LeakDetected,
#[serde(rename = "00000019-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000019-0000-1000-8000-0026BB765291", alias = "19")]
LockControlPoint,
#[serde(rename = "0000001D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000001D-0000-1000-8000-0026BB765291", alias = "1D")]
LockCurrentState,
#[serde(rename = "0000001C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000001C-0000-1000-8000-0026BB765291", alias = "1C")]
LockLastKnownAction,
#[serde(rename = "0000001A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000001A-0000-1000-8000-0026BB765291", alias = "1A")]
LockManagementAutoSecurityTimeout,
#[serde(rename = "000000A7-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A7-0000-1000-8000-0026BB765291", alias = "A7")]
LockPhysicalControls,
#[serde(rename = "0000001E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000001E-0000-1000-8000-0026BB765291", alias = "1E")]
LockTargetState,
#[serde(rename = "0000001F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000001F-0000-1000-8000-0026BB765291", alias = "1F")]
Logs,
#[serde(rename = "00000020-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000020-0000-1000-8000-0026BB765291", alias = "20")]
Manufacturer,
#[serde(rename = "00000021-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000021-0000-1000-8000-0026BB765291", alias = "21")]
Model,
#[serde(rename = "00000022-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000022-0000-1000-8000-0026BB765291", alias = "22")]
MotionDetected,
#[serde(rename = "0000011A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011A-0000-1000-8000-0026BB765291", alias = "11A")]
Mute,
#[serde(rename = "00000023-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000023-0000-1000-8000-0026BB765291", alias = "23")]
Name,
#[serde(rename = "0000011B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011B-0000-1000-8000-0026BB765291", alias = "11B")]
NightVision,
#[serde(rename = "000000C4-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C4-0000-1000-8000-0026BB765291", alias = "C4")]
NitrogenDioxideDensity,
#[serde(rename = "00000024-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000024-0000-1000-8000-0026BB765291", alias = "24")]
ObstructionDetected,
#[serde(rename = "00000071-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000071-0000-1000-8000-0026BB765291", alias = "71")]
OccupancyDetected,
#[serde(rename = "00000025-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000025-0000-1000-8000-0026BB765291", alias = "25")]
On,
#[serde(rename = "0000011C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000011C-0000-1000-8000-0026BB765291", alias = "11C")]
OpticalZoom,
#[serde(rename = "00000026-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000026-0000-1000-8000-0026BB765291", alias = "26")]
OutletInUse,
#[serde(rename = "000000C3-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C3-0000-1000-8000-0026BB765291", alias = "C3")]
OzoneDensity,
#[serde(rename = "0000004C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000004C-0000-1000-8000-0026BB765291", alias = "4C")]
PairSetup,
#[serde(rename = "0000004E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000004E-0000-1000-8000-0026BB765291", alias = "4E")]
PairVerify,
#[serde(rename = "0000004F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000004F-0000-1000-8000-0026BB765291", alias = "4F")]
PairingFeatures,
#[serde(rename = "00000050-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000050-0000-1000-8000-0026BB765291", alias = "50")]
PairingPairings,
#[serde(rename = "000000E4-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E4-0000-1000-8000-0026BB765291", alias = "E4")]
PasswordSetting,
#[serde(rename = "000000C7-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C7-0000-1000-8000-0026BB765291", alias = "C7")]
PM10Density,
#[serde(rename = "000000C6-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C6-0000-1000-8000-0026BB765291", alias = "C6")]
PM2_5Density,
#[serde(rename = "00000072-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000072-0000-1000-8000-0026BB765291", alias = "72")]
PositionState,
#[serde(rename = "000000D1-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D1-0000-1000-8000-0026BB765291", alias = "D1")]
ProgramMode,
#[serde(rename = "00000073-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000073-0000-1000-8000-0026BB765291", alias = "73")]
ProgrammableSwitchEvent,
#[serde(rename = "000000C9-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C9-0000-1000-8000-0026BB765291", alias = "C9")]
RelativeHumidityDehumidifierThreshold,
#[serde(rename = "000000CA-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CA-0000-1000-8000-0026BB765291", alias = "CA")]
RelativeHumidityHumidifierThreshold,
#[serde(rename = "000000D4-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D4-0000-1000-8000-0026BB765291", alias = "D4")]
RemainingDuration,
#[serde(rename = "000000AD-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AD-0000-1000-8000-0026BB765291", alias = "AD")]
ResetFilterIndication,
#[serde(rename = "00000028-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000028-0000-1000-8000-0026BB765291", alias = "28")]
RotationDirection,
#[serde(rename = "00000029-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000029-0000-1000-8000-0026BB765291", alias = "29")]
RotationSpeed,
#[serde(rename = "0000002F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000002F-0000-1000-8000-0026BB765291", alias = "2F")]
Saturation,
#[serde(rename = "0000008E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008E-0000-1000-8000-0026BB765291", alias = "8E")]
SecuritySystemAlarmType,
#[serde(rename = "00000066-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000066-0000-1000-8000-0026BB765291", alias = "66")]
SecuritySystemCurrentState,
#[serde(rename = "00000067-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000067-0000-1000-8000-0026BB765291", alias = "67")]
SecuritySystemTargetState,
#[serde(rename = "00000117-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000117-0000-1000-8000-0026BB765291", alias = "117")]
SelectedRTPStreamConfiguration,
#[serde(rename = "00000030-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000030-0000-1000-8000-0026BB765291", alias = "30")]
SerialNumber,
#[serde(rename = "000000CB-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CB-0000-1000-8000-0026BB765291", alias = "CB")]
ServiceLabelIndex,
#[serde(rename = "000000CD-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CD-0000-1000-8000-0026BB765291", alias = "CD")]
ServiceLabelNamespace,
#[serde(rename = "000000D3-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D3-0000-1000-8000-0026BB765291", alias = "D3")]
SetDuration,
#[serde(rename = "00000118-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000118-0000-1000-8000-0026BB765291", alias = "118")]
SetupEndpoints,
#[serde(rename = "000000C0-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C0-0000-1000-8000-0026BB765291", alias = "C0")]
SlatType,
#[serde(rename = "00000076-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000076-0000-1000-8000-0026BB765291", alias = "76")]
SmokeDetected,
#[serde(rename = "00000075-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000075-0000-1000-8000-0026BB765291", alias = "75")]
StatusActive,
#[serde(rename = "00000077-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000077-0000-1000-8000-0026BB765291", alias = "77")]
StatusFault,
#[serde(rename = "00000078-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000078-0000-1000-8000-0026BB765291", alias = "78")]
StatusJammed,
#[serde(rename = "00000079-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000079-0000-1000-8000-0026BB765291", alias = "79")]
StatusLowBattery,
#[serde(rename = "0000007A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007A-0000-1000-8000-0026BB765291", alias = "7A")]
StatusTampered,
#[serde(rename = "00000120-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000120-0000-1000-8000-0026BB765291", alias = "120")]
StreamingStatus,
#[serde(rename = "000000C5-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C5-0000-1000-8000-0026BB765291", alias = "C5")]
SulphurDioxideDensity,
#[serde(rename = "00000115-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000115-0000-1000-8000-0026BB765291", alias = "115")]
SupportedAudioStreamConfiguration,
#[serde(rename = "00000116-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000116-0000-1000-8000-0026BB765291", alias = "116")]
SupportedRTPConfiguration,
#[serde(rename = "00000114-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000114-0000-1000-8000-0026BB765291", alias = "114")]
SupportedVideoStreamConfiguration,
#[serde(rename = "000000B6-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B6-0000-1000-8000-0026BB765291", alias = "B6")]
SwingMode,
#[serde(rename = "000000A8-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A8-0000-1000-8000-0026BB765291", alias = "A8")]
TargetAirPurifierState,
#[serde(rename = "000000AE-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000AE-0000-1000-8000-0026BB765291", alias = "AE")]
TargetAirQuality,
#[serde(rename = "00000032-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000032-0000-1000-8000-0026BB765291", alias = "32")]
TargetDoorState,
#[serde(rename = "000000BF-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BF-0000-1000-8000-0026BB765291", alias = "BF")]
TargetFanState,
#[serde(rename = "000000B2-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B2-0000-1000-8000-0026BB765291", alias = "B2")]
TargetHeaterCoolerState,
#[serde(rename = "00000033-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000033-0000-1000-8000-0026BB765291", alias = "33")]
TargetHeatingCoolingState,
#[serde(rename = "0000007B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007B-0000-1000-8000-0026BB765291", alias = "7B")]
TargetHorizontalTiltAngle,
#[serde(rename = "000000B4-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B4-0000-1000-8000-0026BB765291", alias = "B4")]
TargetHumidifierDehumidifierState,
#[serde(rename = "0000007C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007C-0000-1000-8000-0026BB765291", alias = "7C")]
TargetPosition,
#[serde(rename = "00000034-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000034-0000-1000-8000-0026BB765291", alias = "34")]
TargetRelativeHumidity,
#[serde(rename = "000000BE-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BE-0000-1000-8000-0026BB765291", alias = "BE")]
TargetSlatState,
#[serde(rename = "00000035-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000035-0000-1000-8000-0026BB765291", alias = "35")]
TargetTemperature,
#[serde(rename = "000000C2-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C2-0000-1000-8000-0026BB765291", alias = "C2")]
TargetTiltAngle,
#[serde(rename = "0000007D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007D-0000-1000-8000-0026BB765291", alias = "7D")]
TargetVerticalTiltAngle,
#[serde(rename = "00000036-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000036-0000-1000-8000-0026BB765291", alias = "36")]
TemperatureDisplayUnits,
#[serde(rename = "000000D5-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D5-0000-1000-8000-0026BB765291", alias = "D5")]
ValveType,
#[serde(rename = "00000037-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000037-0000-1000-8000-0026BB765291", alias = "37")]
Version,
#[serde(rename = "000000C8-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000C8-0000-1000-8000-0026BB765291", alias = "C8")]
VOCDensity,
#[serde(rename = "00000119-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000119-0000-1000-8000-0026BB765291", alias = "119")]
Volume,
#[serde(rename = "000000B5-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B5-0000-1000-8000-0026BB765291", alias = "B5")]
WaterLevel,
#[serde(rename = "00000226-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000226-0000-1000-8000-0026BB765291", alias = "226")]
RecordingAudioActive,
#[serde(rename = "00000205-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000205-0000-1000-8000-0026BB765291", alias = "205")]
SupportedCameraRecordingConfiguration,
#[serde(rename = "00000206-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000206-0000-1000-8000-0026BB765291", alias = "206")]
SupportedVideoRecordingConfiguration,
#[serde(rename = "00000207-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000207-0000-1000-8000-0026BB765291", alias = "207")]
SupportedAudioRecordingConfiguration,
#[serde(rename = "00000209-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000209-0000-1000-8000-0026BB765291", alias = "209")]
SelectedCameraRecordingConfiguration,
#[serde(rename = "0000021D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021D-0000-1000-8000-0026BB765291", alias = "21D")]
CameraOperatingModeIndicator,
#[serde(rename = "00000223-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000223-0000-1000-8000-0026BB765291", alias = "223")]
EventSnapshotsActive,
#[serde(rename = "00000224-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000224-0000-1000-8000-0026BB765291", alias = "224")]
DiagonalFieldOfView,
#[serde(rename = "0000021B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021B-0000-1000-8000-0026BB765291", alias = "21B")]
HomeKitCameraActive,
#[serde(rename = "00000227-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000227-0000-1000-8000-0026BB765291", alias = "227")]
ManuallyDisabled,
#[serde(rename = "0000021C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021C-0000-1000-8000-0026BB765291", alias = "21C")]
ThirdPartyCameraActive,
#[serde(rename = "00000225-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000225-0000-1000-8000-0026BB765291", alias = "225")]
PeriodicSnapshotsActive,
#[serde(rename = "0000020C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000020C-0000-1000-8000-0026BB765291", alias = "20C")]
NetworkClientProfileControl,
#[serde(rename = "0000020D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000020D-0000-1000-8000-0026BB765291", alias = "20D")]
NetworkClientStatusControl,
#[serde(rename = "0000020E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000020E-0000-1000-8000-0026BB765291", alias = "20E")]
RouterStatus,
#[serde(rename = "00000210-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000210-0000-1000-8000-0026BB765291", alias = "210")]
SupportedRouterConfiguration,
#[serde(rename = "00000211-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000211-0000-1000-8000-0026BB765291", alias = "211")]
WANConfigurationList,
#[serde(rename = "00000212-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000212-0000-1000-8000-0026BB765291", alias = "212")]
WANStatusList,
#[serde(rename = "00000215-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000215-0000-1000-8000-0026BB765291", alias = "215")]
ManagedNetworkEnable,
#[serde(rename = "0000021F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021F-0000-1000-8000-0026BB765291", alias = "21F")]
NetworkAccessViolationControl,
#[serde(rename = "0000021E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021E-0000-1000-8000-0026BB765291", alias = "21E")]
WiFiSatelliteStatus,
#[serde(rename = "00000222-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000222-0000-1000-8000-0026BB765291", alias = "222")]
WakeConfiguration,
#[serde(rename = "00000202-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000202-0000-1000-8000-0026BB765291", alias = "202")]
SupportedTransferTransportConfiguration,
#[serde(rename = "00000201-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000201-0000-1000-8000-0026BB765291", alias = "201")]
SetupTransferTransport,
#[serde(rename = "0000021E-0000-1000-8000-0000023B")]
ActivityInterval,
@ -831,95 +831,95 @@ enum CharacteristicTypeInner {
WiFiCapabilities,
#[serde(rename = "0000021E-0000-1000-8000-0000022D")]
WiFiConfigurationControl,
#[serde(rename = "000000A4-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A4-0000-1000-8000-0026BB765291", alias = "A4")]
AppMatchingIdentifier,
#[serde(rename = "00000074-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000074-0000-1000-8000-0026BB765291", alias = "74")]
ProgrammableSwitchOutputState,
#[serde(rename = "00000054-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000054-0000-1000-8000-0026BB765291", alias = "54")]
SoftwareRevision,
#[serde(rename = "00000057-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000057-0000-1000-8000-0026BB765291", alias = "57")]
AccessoryIdentifier,
#[serde(rename = "000000A3-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A3-0000-1000-8000-0026BB765291", alias = "A3")]
Category,
#[serde(rename = "000000A0-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A0-0000-1000-8000-0026BB765291", alias = "A0")]
ConfigureBridgedAccessory,
#[serde(rename = "0000009D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009D-0000-1000-8000-0026BB765291", alias = "9D")]
ConfigureBridgedAccessoryStatus,
#[serde(rename = "0000009B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009B-0000-1000-8000-0026BB765291", alias = "9B")]
CurrentTime,
#[serde(rename = "00000098-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000098-0000-1000-8000-0026BB765291", alias = "98")]
DayoftheWeek,
#[serde(rename = "0000009E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009E-0000-1000-8000-0026BB765291", alias = "9E")]
DiscoverBridgedAccessories,
#[serde(rename = "0000009F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009F-0000-1000-8000-0026BB765291", alias = "9F")]
DiscoveredBridgedAccessories,
#[serde(rename = "0000009C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009C-0000-1000-8000-0026BB765291", alias = "9C")]
LinkQuality,
#[serde(rename = "00000063-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000063-0000-1000-8000-0026BB765291", alias = "63")]
Reachable,
#[serde(rename = "0000005E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000005E-0000-1000-8000-0026BB765291", alias = "5E")]
RelayControlPoint,
#[serde(rename = "0000005B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000005B-0000-1000-8000-0026BB765291", alias = "5B")]
RelayEnabled,
#[serde(rename = "0000005C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000005C-0000-1000-8000-0026BB765291", alias = "5C")]
RelayState,
#[serde(rename = "0000009A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000009A-0000-1000-8000-0026BB765291", alias = "9A")]
TimeUpdate,
#[serde(rename = "00000061-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000061-0000-1000-8000-0026BB765291", alias = "61")]
TunnelConnectionTimeout,
#[serde(rename = "00000060-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000060-0000-1000-8000-0026BB765291", alias = "60")]
TunneledAccessoryAdvertising,
#[serde(rename = "00000059-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000059-0000-1000-8000-0026BB765291", alias = "59")]
TunneledAccessoryConnected,
#[serde(rename = "00000058-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000058-0000-1000-8000-0026BB765291", alias = "58")]
TunneledAccessoryStateNumber,
#[serde(rename = "000000E7-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E7-0000-1000-8000-0026BB765291", alias = "E7")]
ActiveIdentifier,
#[serde(rename = "000000E3-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E3-0000-1000-8000-0026BB765291", alias = "E3")]
ConfiguredName,
#[serde(rename = "000000E8-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E8-0000-1000-8000-0026BB765291", alias = "E8")]
SleepDiscoveryMode,
#[serde(rename = "000000DD-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000DD-0000-1000-8000-0026BB765291", alias = "DD")]
ClosedCaptions,
#[serde(rename = "00000136-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000136-0000-1000-8000-0026BB765291", alias = "136")]
DisplayOrder,
#[serde(rename = "000000E0-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E0-0000-1000-8000-0026BB765291", alias = "E0")]
CurrentMediaState,
#[serde(rename = "00000137-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000137-0000-1000-8000-0026BB765291", alias = "137")]
TargetMediaState,
#[serde(rename = "000000E2-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E2-0000-1000-8000-0026BB765291", alias = "E2")]
PictureMode,
#[serde(rename = "000000DF-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000DF-0000-1000-8000-0026BB765291", alias = "DF")]
PowerModeSelection,
#[serde(rename = "000000E1-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E1-0000-1000-8000-0026BB765291", alias = "E1")]
RemoteKey,
#[serde(rename = "000000DB-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000DB-0000-1000-8000-0026BB765291", alias = "DB")]
InputSourceType,
#[serde(rename = "000000DC-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000DC-0000-1000-8000-0026BB765291", alias = "DC")]
InputDeviceType,
#[serde(rename = "000000E6-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E6-0000-1000-8000-0026BB765291", alias = "E6")]
Identifier,
#[serde(rename = "00000135-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000135-0000-1000-8000-0026BB765291", alias = "135")]
CurrentVisibilityState,
#[serde(rename = "00000134-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000134-0000-1000-8000-0026BB765291", alias = "134")]
TargetVisibilityState,
#[serde(rename = "000000E9-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000E9-0000-1000-8000-0026BB765291", alias = "E9")]
VolumeControlType,
#[serde(rename = "000000EA-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000EA-0000-1000-8000-0026BB765291", alias = "EA")]
VolumeSelector,
#[serde(rename = "00000123-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000123-0000-1000-8000-0026BB765291", alias = "123")]
TargetControlSupportedConfiguration,
#[serde(rename = "00000124-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000124-0000-1000-8000-0026BB765291", alias = "124")]
TargetControlList,
#[serde(rename = "00000126-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000126-0000-1000-8000-0026BB765291", alias = "126")]
ButtonEvent,
#[serde(rename = "00000128-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000128-0000-1000-8000-0026BB765291", alias = "128")]
SelectedAudioStreamConfiguration,
#[serde(rename = "00000132-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000132-0000-1000-8000-0026BB765291", alias = "132")]
SiriInputType,
#[serde(rename = "00000130-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000130-0000-1000-8000-0026BB765291", alias = "130")]
SupportedDataStreamTransportConfiguration,
#[serde(rename = "00000131-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000131-0000-1000-8000-0026BB765291", alias = "131")]
SetupDataStreamTransport,
Unknown(String),
}
@ -1381,101 +1381,101 @@ impl std::fmt::Display for ServiceType {
#[derive(Deserialize)]
#[serde(field_identifier)]
pub enum ServiceTypeInner {
#[serde(rename = "'000000DA-0000-1000-8000-0026BB765291")]
#[serde(rename = "'000000DA-0000-1000-8000-0026BB765291", alias = "DA")]
AccessControl,
#[serde(rename = "0000003E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000003E-0000-1000-8000-0026BB765291", alias = "3E")]
AccessoryInformation,
#[serde(rename = "000000BB-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BB-0000-1000-8000-0026BB765291", alias = "BB")]
AirPurifier,
#[serde(rename = "0000008D-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008D-0000-1000-8000-0026BB765291", alias = "8D")]
AirQualitySensor,
#[serde(rename = "00000096-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000096-0000-1000-8000-0026BB765291", alias = "96")]
BatteryService,
#[serde(rename = "00000110-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000110-0000-1000-8000-0026BB765291", alias = "110")]
CameraRTPStreamManagement,
#[serde(rename = "00000097-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000097-0000-1000-8000-0026BB765291", alias = "97")]
CarbonDioxideSensor,
#[serde(rename = "0000007F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007F-0000-1000-8000-0026BB765291", alias = "7F")]
CarbonMonoxideSensor,
#[serde(rename = "00000080-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000080-0000-1000-8000-0026BB765291", alias = "80")]
ContactSensor,
#[serde(rename = "00000081-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000081-0000-1000-8000-0026BB765291", alias = "81")]
Door,
#[serde(rename = "00000121-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000121-0000-1000-8000-0026BB765291", alias = "121")]
Doorbell,
#[serde(rename = "00000040-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000040-0000-1000-8000-0026BB765291", alias = "40")]
Fan,
#[serde(rename = "000000B7-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B7-0000-1000-8000-0026BB765291", alias = "B7")]
Fanv2,
#[serde(rename = "000000BA-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BA-0000-1000-8000-0026BB765291", alias = "BA")]
FilterMaintenance,
#[serde(rename = "000000D7-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D7-0000-1000-8000-0026BB765291", alias = "D7")]
Faucet,
#[serde(rename = "00000041-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000041-0000-1000-8000-0026BB765291", alias = "41")]
GarageDoorOpener,
#[serde(rename = "000000BC-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BC-0000-1000-8000-0026BB765291", alias = "BC")]
HeaterCooler,
#[serde(rename = "000000BD-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000BD-0000-1000-8000-0026BB765291", alias = "BD")]
HumidifierDehumidifier,
#[serde(rename = "00000082-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000082-0000-1000-8000-0026BB765291", alias = "82")]
HumiditySensor,
#[serde(rename = "000000CF-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CF-0000-1000-8000-0026BB765291", alias = "CF")]
IrrigationSystem,
#[serde(rename = "00000083-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000083-0000-1000-8000-0026BB765291", alias = "83")]
LeakSensor,
#[serde(rename = "00000084-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000084-0000-1000-8000-0026BB765291", alias = "84")]
LightSensor,
#[serde(rename = "00000043-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000043-0000-1000-8000-0026BB765291", alias = "43")]
Lightbulb,
#[serde(rename = "00000044-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000044-0000-1000-8000-0026BB765291", alias = "44")]
LockManagement,
#[serde(rename = "00000045-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000045-0000-1000-8000-0026BB765291", alias = "45")]
LockMechanism,
#[serde(rename = "00000112-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000112-0000-1000-8000-0026BB765291", alias = "112")]
Microphone,
#[serde(rename = "00000085-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000085-0000-1000-8000-0026BB765291", alias = "85")]
MotionSensor,
#[serde(rename = "00000086-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000086-0000-1000-8000-0026BB765291", alias = "86")]
OccupancySensor,
#[serde(rename = "00000047-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000047-0000-1000-8000-0026BB765291", alias = "47")]
Outlet,
#[serde(rename = "0000007E-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000007E-0000-1000-8000-0026BB765291", alias = "7E")]
SecuritySystem,
#[serde(rename = "000000CC-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000CC-0000-1000-8000-0026BB765291", alias = "CC")]
ServiceLabel,
#[serde(rename = "000000B9-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000B9-0000-1000-8000-0026BB765291", alias = "B9")]
Slat,
#[serde(rename = "00000087-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000087-0000-1000-8000-0026BB765291", alias = "87")]
SmokeSensor,
#[serde(rename = "00000228-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000228-0000-1000-8000-0026BB765291", alias = "228")]
SmartSpeaker,
#[serde(rename = "00000113-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000113-0000-1000-8000-0026BB765291", alias = "113")]
Speaker,
#[serde(rename = "00000089-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000089-0000-1000-8000-0026BB765291", alias = "89")]
StatelessProgrammableSwitch,
#[serde(rename = "00000049-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000049-0000-1000-8000-0026BB765291", alias = "49")]
Switch,
#[serde(rename = "0000008A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008A-0000-1000-8000-0026BB765291", alias = "8A")]
TemperatureSensor,
#[serde(rename = "0000004A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000004A-0000-1000-8000-0026BB765291", alias = "4A")]
Thermostat,
#[serde(rename = "000000D0-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D0-0000-1000-8000-0026BB765291", alias = "D0")]
Valve,
#[serde(rename = "0000008B-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008B-0000-1000-8000-0026BB765291", alias = "8B")]
Window,
#[serde(rename = "0000008C-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000008C-0000-1000-8000-0026BB765291", alias = "8C")]
WindowCovering,
#[serde(rename = "0000021A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000021A-0000-1000-8000-0026BB765291", alias = "21A")]
CameraOperatingMode,
#[serde(rename = "00000204-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000204-0000-1000-8000-0026BB765291", alias = "204")]
CameraEventRecordingManagement,
#[serde(rename = "0000020A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000020A-0000-1000-8000-0026BB765291", alias = "20A")]
WiFiRouter,
#[serde(rename = "0000020F-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000020F-0000-1000-8000-0026BB765291", alias = "20F")]
WiFiSatellite,
#[serde(rename = "00000221-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000221-0000-1000-8000-0026BB765291", alias = "221")]
PowerManagement,
#[serde(rename = "00000203-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000203-0000-1000-8000-0026BB765291", alias = "203")]
TransferTransportManagement,
#[serde(rename = "00000203-0000-1000-8000-00000239")]
AccessoryRuntimeInformation,
@ -1483,39 +1483,39 @@ pub enum ServiceTypeInner {
Diagnostics,
#[serde(rename = "00000203-0000-1000-8000-0000022A")]
WiFiTransport,
#[serde(rename = "00000111-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000111-0000-1000-8000-0026BB765291", alias = "111")]
CameraControl,
#[serde(rename = "00000088-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000088-0000-1000-8000-0026BB765291", alias = "88")]
StatefulProgrammableSwitch,
#[serde(rename = "000000A1-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A1-0000-1000-8000-0026BB765291", alias = "A1")]
BridgeConfiguration,
#[serde(rename = "00000062-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000062-0000-1000-8000-0026BB765291", alias = "62")]
BridgingState,
#[serde(rename = "00000055-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000055-0000-1000-8000-0026BB765291", alias = "55")]
Pairing,
#[serde(rename = "000000A2-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000A2-0000-1000-8000-0026BB765291", alias = "A2")]
ProtocolInformation,
#[serde(rename = "0000005A-0000-1000-8000-0026BB765291")]
#[serde(rename = "0000005A-0000-1000-8000-0026BB765291", alias = "5A")]
Relay,
#[serde(rename = "00000099-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000099-0000-1000-8000-0026BB765291", alias = "99")]
TimeInformation,
#[serde(rename = "00000056-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000056-0000-1000-8000-0026BB765291", alias = "56")]
TunneledBTLEAccessoryService,
#[serde(rename = "000000D8-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D8-0000-1000-8000-0026BB765291", alias = "D8")]
Television,
#[serde(rename = "000000D9-0000-1000-8000-0026BB765291")]
#[serde(rename = "000000D9-0000-1000-8000-0026BB765291", alias = "D9")]
InputSource,
#[serde(rename = "00000113-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000113-0000-1000-8000-0026BB765291", alias = "113")]
TelevisionSpeaker,
#[serde(rename = "00000122-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000122-0000-1000-8000-0026BB765291", alias = "122")]
TargetControlManagement,
#[serde(rename = "00000125-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000125-0000-1000-8000-0026BB765291", alias = "125")]
TargetControl,
#[serde(rename = "00000127-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000127-0000-1000-8000-0026BB765291", alias = "127")]
AudioStreamManagement,
#[serde(rename = "00000133-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000133-0000-1000-8000-0026BB765291", alias = "133")]
Siri,
#[serde(rename = "00000129-0000-1000-8000-0026BB765291")]
#[serde(rename = "00000129-0000-1000-8000-0026BB765291", alias = "129")]
DataStreamTransportManagement,
Unknown(String),
}

View file

@ -34,11 +34,21 @@ pub struct Accessory {
pub services: Vec<AccessoryService>,
}
#[derive(Deserialize)]
pub struct Accessories {
pub accessories: Vec<Accessory>,
}
impl Accessory {
pub fn get_service_ids(&self) -> Vec<String> {
self.services
.iter()
.map(|service| format!("{}.{}", self.id, service.id))
.flat_map(|service| {
service
.characteristics
.iter()
.map(|c| format!("{}.{}", self.id, c.id))
})
.collect()
}
}
@ -76,6 +86,11 @@ pub struct ServiceCharacteristic {
pub unit: Option<String>,
}
#[derive(Deserialize)]
pub struct Characteristics {
pub characteristics: Vec<ServiceCharacteristic>,
}
#[allow(clippy::enum_variant_names)]
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(tag = "format", content = "value")]