Skip to content

Commit a0e8f7f

Browse files
committed
Example04
1 parent 0e6a191 commit a0e8f7f

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

examples/Example04_MultipleAccessories/multiple_accessories.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* This example is a bridge (aka a gateway) which contains multiple accessories.
99
*
10-
* This example includes 5 sensors:
10+
* This example includes 6 sensors:
1111
* 1. Temperature Sensor (HAP section 8.41)
1212
* 2. Humidity Sensor (HAP section 8.20)
1313
* 3. Light Sensor (HAP section 8.24)

examples/Example04_MultipleAccessories/my_accessory.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ void my_accessory_identify(homekit_value_t _value) {
1313
printf("accessory identify\n");
1414
}
1515

16-
/*
17-
* This example includes 5 sensors:
18-
* 1. Temperature Sensor (HAP section 8.41)
19-
* 2. Humidity Sensor (HAP section 8.20)
20-
* 3. Light Sensor (HAP section 8.24)
21-
* 4. Contact Sensor (HAP section 8.9)
22-
* 5. Motion Sensor (HAP section 8.28)
23-
* 6. Occupancy Sensor (HAP section 8.29)
24-
*/
25-
2616
// format: float; min 0, max 100, step 0.1, unit celsius
2717
homekit_characteristic_t cha_temperature = HOMEKIT_CHARACTERISTIC_(CURRENT_TEMPERATURE, 1);
2818

@@ -45,6 +35,9 @@ homekit_accessory_t *accessories[] = {
4535
HOMEKIT_ACCESSORY(.id=1, .category=homekit_accessory_category_bridge, .services=(homekit_service_t*[]) {
4636
// HAP section 8.17:
4737
// For a bridge accessory, only the primary HAP accessory object must contain this(INFORMATION) service.
38+
// But in my test,
39+
// the bridged accessories must contain an INFORMATION service,
40+
// otherwise the HomeKit will reject to pair.
4841
HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t*[]) {
4942
HOMEKIT_CHARACTERISTIC(NAME, "Multiple Sensors"),
5043
HOMEKIT_CHARACTERISTIC(MANUFACTURER, "Arduino HomeKit"),

0 commit comments

Comments
 (0)