From bef17fb268fa68827904f71dc30c7557d782f8fb Mon Sep 17 00:00:00 2001 From: Gregg Date: Thu, 18 Jan 2024 21:32:35 -0600 Subject: [PATCH] Update test.md --- tools/makeServiceList | 26 +- tools/test.md | 943 ++++++++++++++++++++++++++---------------- 2 files changed, 610 insertions(+), 359 deletions(-) diff --git a/tools/makeServiceList b/tools/makeServiceList index a3bfa31..fe60661 100755 --- a/tools/makeServiceList +++ b/tools/makeServiceList @@ -10,11 +10,12 @@ BEGIN { while(getline < servicesFile ){ gsub("^[ ]+","") # strip out any leading spaces - n=split($0,x,"[,();]+") # split line into separate words + n=split($0,x,"[,(); ]+") # split line into separate words if(x[1]=="CREATE_SERV"){ currentService=x[2] services[nServs++]=currentService + uuid[currentService]=x[3] nReqs[currentService]=0 nOpts[currentService]=0 } @@ -35,11 +36,31 @@ BEGIN { vals[char,i]=x[i+7] } + } + + close(servicesFile) + + while(getline < charsFile){ + + gsub("^[ ]+","") # strip out any leading spaces + n=split($0,x,"[,(); ]+") # split line into separate words + + if(x[1]=="HAPCHAR"){ + char=x[2] + uuid[char]=x[3] + perms[char]=x[4] + format[char]=x[5] + static[char]=x[6] + } + } + close(charsFile) + + for(i=0;i%s (%s)\n",s,uuid[s]) for(j=0;j" } } diff --git a/tools/test.md b/tools/test.md index 2c2a9bd..d9349df 100644 --- a/tools/test.md +++ b/tools/test.md @@ -1,357 +1,586 @@ -### AccessoryInformation -* Required: - * Identify -* Optional: - * FirmwareRevision - * Manufacturer - * Model - * Name - * SerialNumber - * HardwareRevision - * AccessoryFlags -### AirPurifier -* Required: - * Active - * CurrentAirPurifierState - * TargetAirPurifierState -* Optional: - * Name - * RotationSpeed - * SwingMode - * LockPhysicalControls -### AirQualitySensor -* Required: - * AirQuality -* Optional: - * Name - * OzoneDensity - * NitrogenDioxideDensity - * SulphurDioxideDensity - * PM25Density - * PM10Density - * VOCDensity - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### BatteryService -* Required: - * BatteryLevel - * ChargingState - * StatusLowBattery -* Optional: - * Name -### CarbonDioxideSensor -* Required: - * CarbonDioxideDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery - * CarbonDioxideLevel - * CarbonDioxidePeakLevel -### CarbonMonoxideSensor -* Required: - * CarbonMonoxideDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery - * CarbonMonoxideLevel - * CarbonMonoxidePeakLevel -### ContactSensor -* Required: - * ContactSensorState -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### Door -* Required: - * CurrentPosition - * TargetPosition - * PositionState -* Optional: - * Name - * HoldPosition - * ObstructionDetected -### Doorbell -* Required: - * ProgrammableSwitchEvent -* Optional: - * Name - * Volume - * Brightness -### Fan -* Required: - * Active -* Optional: - * Name - * CurrentFanState - * TargetFanState - * RotationDirection - * RotationSpeed - * SwingMode - * LockPhysicalControls -### Faucet -* Required: - * Active -* Optional: - * StatusFault - * Name -### FilterMaintenance -* Required: - * FilterChangeIndication -* Optional: - * Name - * FilterLifeLevel - * ResetFilterIndication -### GarageDoorOpener -* Required: - * CurrentDoorState - * TargetDoorState - * ObstructionDetected -* Optional: - * LockCurrentState - * LockTargetState - * Name -### HAPProtocolInformation -* Required: - * Version -### HeaterCooler -* Required: - * Active - * CurrentTemperature - * CurrentHeaterCoolerState - * TargetHeaterCoolerState -* Optional: - * Name - * RotationSpeed - * TemperatureDisplayUnits - * SwingMode - * CoolingThresholdTemperature - * HeatingThresholdTemperature - * LockPhysicalControls -### HumidifierDehumidifier -* Required: - * Active - * CurrentRelativeHumidity - * CurrentHumidifierDehumidifierState - * TargetHumidifierDehumidifierState -* Optional: - * Name - * RelativeHumidityDehumidifierThreshold - * RelativeHumidityHumidifierThreshold - * RotationSpeed - * SwingMode - * WaterLevel - * LockPhysicalControls -### HumiditySensor -* Required: - * CurrentRelativeHumidity -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### InputSource -* Optional: - * ConfiguredName - * IsConfigured -* Required: - * Identifier - * CurrentVisibilityState - * TargetVisibilityState -### IrrigationSystem -* Required: - * Active - * ProgramMode - * InUse -* Optional: - * RemainingDuration - * StatusFault -### LeakSensor -* Required: - * LeakDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### LightBulb -* Required: - * On -* Optional: - * Brightness - * Hue - * Name - * Saturation - * ColorTemperature -### LightSensor -* Required: - * CurrentAmbientLightLevel -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### LockMechanism -* Required: - * LockCurrentState - * LockTargetState -* Optional: - * Name -### Microphone -* Required: - * Mute -* Optional: - * Name - * Volume -### MotionSensor -* Required: - * MotionDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### OccupancySensor -* Required: - * OccupancyDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### Outlet -* Required: - * On - * OutletInUse -* Optional: - * Name -### SecuritySystem -* Required: - * SecuritySystemCurrentState - * SecuritySystemTargetState -* Optional: - * Name - * SecuritySystemAlarmType - * StatusFault - * StatusTampered -### ServiceLabel -* Required: - * ServiceLabelNamespace -### Slat -* Required: - * CurrentSlatState - * SlatType -* Optional: - * Name - * SwingMode - * CurrentTiltAngle - * TargetTiltAngle -### SmokeSensor -* Required: - * SmokeDetected -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### Speaker -* Required: - * Mute -* Optional: - * Name - * Volume -### StatelessProgrammableSwitch -* Required: - * ProgrammableSwitchEvent -* Optional: - * Name - * ServiceLabelIndex -### Switch -* Required: - * On -* Optional: - * Name -### Television -* Required: - * Active -* Optional: - * ConfiguredName - * ActiveIdentifier - * RemoteKey - * PowerModeSelection -### TelevisionSpeaker -* Required: - * VolumeControlType - * VolumeSelector -### TemperatureSensor -* Required: - * CurrentTemperature -* Optional: - * Name - * StatusActive - * StatusFault - * StatusTampered - * StatusLowBattery -### Thermostat -* Required: - * CurrentHeatingCoolingState - * TargetHeatingCoolingState - * CurrentTemperature - * TargetTemperature - * TemperatureDisplayUnits -* Optional: - * CoolingThresholdTemperature - * CurrentRelativeHumidity - * HeatingThresholdTemperature - * Name - * TargetRelativeHumidity -### Valve -* Required: - * Active - * InUse - * ValveType -* Optional: - * SetDuration - * RemainingDuration - * IsConfigured - * ServiceLabelIndex - * StatusFault - * Name -### Window -* Required: - * CurrentPosition - * TargetPosition - * PositionState -* Optional: - * Name - * HoldPosition - * ObstructionDetected -### WindowCovering -* Required: - * TargetPosition - * CurrentPosition - * PositionState -* Optional: - * Name - * HoldPosition - * CurrentHorizontalTiltAngle - * TargetHorizontalTiltAngle - * CurrentVerticalTiltAngle - * TargetVerticalTiltAngle - * ObstructionDetected +AccessoryInformation (3E) + REQ:Identify +false 0 1 + + OPT:FirmwareRevision + OPT:Manufacturer + OPT:Model + OPT:Name + OPT:SerialNumber + OPT:HardwareRevision + OPT:AccessoryFlags + +AirPurifier (BB) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + REQ:CurrentAirPurifierState +1 0 2 +INACTIVE +IDLE +PURIFYING + + REQ:TargetAirPurifierState +1 0 1 +MANUAL +AUTO + + OPT:Name + OPT:RotationSpeed + OPT:SwingMode + OPT:LockPhysicalControls + +AirQualitySensor (8D) + REQ:AirQuality +0 0 5 +UNKNOWN +EXCELLENT +GOOD +FAIR +INFERIOR +POOR + + OPT:Name + OPT:OzoneDensity + OPT:NitrogenDioxideDensity + OPT:SulphurDioxideDensity + OPT:PM25Density + OPT:PM10Density + OPT:VOCDensity + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +BatteryService (96) + REQ:BatteryLevel +0 0 100 + + REQ:ChargingState +0 0 2 +NOT_CHARGING +CHARGING +NOT_CHARGEABLE + + REQ:StatusLowBattery +0 0 1 +NOT_LOW_BATTERY +LOW_BATTERY + + OPT:Name + +CarbonDioxideSensor (97) + REQ:CarbonDioxideDetected +0 0 1 +NORMAL +ABNORMAL + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + OPT:CarbonDioxideLevel + OPT:CarbonDioxidePeakLevel + +CarbonMonoxideSensor (7F) + REQ:CarbonMonoxideDetected +0 0 1 +NORMAL +ABNORMAL + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + OPT:CarbonMonoxideLevel + OPT:CarbonMonoxidePeakLevel + +ContactSensor (80) + REQ:ContactSensorState +1 0 1 +DETECTED +NOT_DETECTED + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +Door (81) + REQ:CurrentPosition +0 0 100 + + REQ:TargetPosition +0 0 100 + + REQ:PositionState +2 0 2 +GOING_TO_MINIMUM +GOING_TO_MAXIMUM +STOPPED + + OPT:Name + OPT:HoldPosition + OPT:ObstructionDetected + +Doorbell (121) + REQ:ProgrammableSwitchEvent +0 0 2 +SINGLE_PRESS +DOUBLE_PRESS +LONG_PRESS + + OPT:Name + OPT:Volume + OPT:Brightness + +Fan (B7) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + OPT:Name + OPT:CurrentFanState + OPT:TargetFanState + OPT:RotationDirection + OPT:RotationSpeed + OPT:SwingMode + OPT:LockPhysicalControls + +Faucet (D7) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + OPT:StatusFault + OPT:Name + +FilterMaintenance (BA) + REQ:FilterChangeIndication +0 0 1 +NO_CHANGE_NEEDED +CHANGE_NEEDED + + OPT:Name + OPT:FilterLifeLevel + OPT:ResetFilterIndication + +GarageDoorOpener (41) + REQ:CurrentDoorState +1 0 4 +OPEN +CLOSED +OPENING +CLOSING +STOPPED + + REQ:TargetDoorState +1 0 1 +OPEN +CLOSED + + REQ:ObstructionDetected +false 0 1 + + OPT:LockCurrentState + OPT:LockTargetState + OPT:Name + +HAPProtocolInformation (A2) + REQ:Version + + +HeaterCooler (BC) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + REQ:CurrentTemperature +0 0 100 + + REQ:CurrentHeaterCoolerState +1 0 3 +INACTIVE +IDLE +HEATING +COOLING + + REQ:TargetHeaterCoolerState +0 0 2 +AUTO +HEAT +COOL + + OPT:Name + OPT:RotationSpeed + OPT:TemperatureDisplayUnits + OPT:SwingMode + OPT:CoolingThresholdTemperature + OPT:HeatingThresholdTemperature + OPT:LockPhysicalControls + +HumidifierDehumidifier (BD) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + REQ:CurrentRelativeHumidity +0 0 100 + + REQ:CurrentHumidifierDehumidifierState +1 0 3 +INACTIVE +IDLE +HUMIDIFYING +DEHUMIDIFYING + + REQ:TargetHumidifierDehumidifierState +0 0 2 +AUTO +HUMIDIFY +DEHUMIDIFY + + OPT:Name + OPT:RelativeHumidityDehumidifierThreshold + OPT:RelativeHumidityHumidifierThreshold + OPT:RotationSpeed + OPT:SwingMode + OPT:WaterLevel + OPT:LockPhysicalControls + +HumiditySensor (82) + REQ:CurrentRelativeHumidity +0 0 100 + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +InputSource (D9) + REQ:Identifier +0 0 255 + + OPT:ConfiguredName + OPT:IsConfigured + OPT:CurrentVisibilityState + OPT:TargetVisibilityState + +IrrigationSystem (CF) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + REQ:ProgramMode +0 0 2 +NONE +SCHEDULED +SCHEDULE_OVERRIDEN + + REQ:InUse +0 0 1 +NOT_IN_USE +IN_USE + + OPT:RemainingDuration + OPT:StatusFault + +LeakSensor (83) + REQ:LeakDetected +0 0 1 +NOT_DETECTED +DETECTED + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +LightBulb (43) + REQ:On +false 0 1 + + OPT:Brightness + OPT:Hue + OPT:Name + OPT:Saturation + OPT:ColorTemperature + +LightSensor (84) + REQ:CurrentAmbientLightLevel +1 0.0001 100000 + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +LockMechanism (45) + REQ:LockCurrentState +0 0 3 +UNLOCKED +LOCKED +JAMMED +UNKNOWN + + REQ:LockTargetState +0 0 1 +UNLOCK +LOCK + + OPT:Name + +Microphone (112) + REQ:Mute +false 0 1 +OFF +ON + + OPT:Name + OPT:Volume + +MotionSensor (85) + REQ:MotionDetected +false 0 1 + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +OccupancySensor (86) + REQ:OccupancyDetected +0 0 1 +NOT_DETECTED +DETECTED + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +Outlet (47) + REQ:On +false 0 1 + + REQ:OutletInUse +false 0 1 + + OPT:Name + +SecuritySystem (7E) + REQ:SecuritySystemCurrentState +3 0 4 +ARMED_STAY +ARMED_AWAY +ARMED_NIGHT +DISARMED +ALARM_TRIGGERED + + REQ:SecuritySystemTargetState +3 0 3 +ARM_STAY +ARM_AWAY +ARM_NIGHT +DISARM + + OPT:Name + OPT:SecuritySystemAlarmType + OPT:StatusFault + OPT:StatusTampered + +ServiceLabel (CC) + REQ:ServiceLabelNamespace +1 0 1 +DOTS +NUMERALS + + +Slat (B9) + REQ:CurrentSlatState +0 0 2 +FIXED +JAMMED +SWINGING + + REQ:SlatType +0 0 1 +HORIZONTAL +VERTICAL + + OPT:Name + OPT:SwingMode + OPT:CurrentTiltAngle + OPT:TargetTiltAngle + +SmokeSensor (87) + REQ:SmokeDetected +0 0 1 +NOT_DETECTED +DETECTED + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +Speaker (113) + REQ:Mute +false 0 1 +OFF +ON + + OPT:Name + OPT:Volume + +StatelessProgrammableSwitch (89) + REQ:ProgrammableSwitchEvent +0 0 2 +SINGLE_PRESS +DOUBLE_PRESS +LONG_PRESS + + OPT:Name + OPT:ServiceLabelIndex + +Switch (49) + REQ:On +false 0 1 + + OPT:Name + +Television (D8) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + OPT:ConfiguredName + OPT:ActiveIdentifier + OPT:RemoteKey + OPT:PowerModeSelection + +TelevisionSpeaker (113) + REQ:VolumeControlType +0 0 3 + + REQ:VolumeSelector +0 0 1 + + +TemperatureSensor (8A) + REQ:CurrentTemperature +0 0 100 + + OPT:Name + OPT:StatusActive + OPT:StatusFault + OPT:StatusTampered + OPT:StatusLowBattery + +Thermostat (4A) + REQ:CurrentHeatingCoolingState +0 0 2 +OFF +HEATING +COOLING + + REQ:TargetHeatingCoolingState +0 0 3 +OFF +HEAT +COOL +AUTO + + REQ:CurrentTemperature +0 0 100 + + REQ:TargetTemperature +16 10 38 + + REQ:TemperatureDisplayUnits +0 0 1 +CELSIUS +FAHRENHEIT + + OPT:CoolingThresholdTemperature + OPT:CurrentRelativeHumidity + OPT:HeatingThresholdTemperature + OPT:Name + OPT:TargetRelativeHumidity + +Valve (D0) + REQ:Active +0 0 1 +INACTIVE +ACIVE + + REQ:InUse +0 0 1 +NOT_IN_USE +IN_USE + + REQ:ValveType +0 0 3 + + OPT:SetDuration + OPT:RemainingDuration + OPT:IsConfigured + OPT:ServiceLabelIndex + OPT:StatusFault + OPT:Name + +Window (8B) + REQ:CurrentPosition +0 0 100 + + REQ:TargetPosition +0 0 100 + + REQ:PositionState +2 0 2 +GOING_TO_MINIMUM +GOING_TO_MAXIMUM +STOPPED + + OPT:Name + OPT:HoldPosition + OPT:ObstructionDetected + +WindowCovering (8C) + REQ:TargetPosition +0 0 100 + + REQ:CurrentPosition +0 0 100 + + REQ:PositionState +2 0 2 +GOING_TO_MINIMUM +GOING_TO_MAXIMUM +STOPPED + + OPT:Name + OPT:HoldPosition + OPT:CurrentHorizontalTiltAngle + OPT:TargetHorizontalTiltAngle + OPT:CurrentVerticalTiltAngle + OPT:TargetVerticalTiltAngle + OPT:ObstructionDetected +