Open xd94402002 opened 6 months ago
As the topic above, Im struggling how to name it. I figure out how to union the switch but can't name it seperate.
This is part of my accessory code
homekit_characteristic_t cha_auto_change_on = HOMEKITCHARACTERISTIC(ON, true); homekit_characteristic_t cha_auto_change_on_name = HOMEKITCHARACTERISTIC(NAME, "Auto change");
homekit_characteristic_t all_swing = HOMEKITCHARACTERISTIC(ON, true); homekit_characteristic_t all_swing_name = HOMEKITCHARACTERISTIC(NAME, "SWING");
homekit_characteristic_t function_name = HOMEKITCHARACTERISTIC(NAME, "Function");
//=============================
HOMEKIT_ACCESSORY(.id=8, .category=homekit_accessory_category_switch, .services=(homekit_service_t[]) { HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t[]) { HOMEKIT_CHARACTERISTIC(IDENTIFY, my_accessory_identify), &function_name, NULL }), HOMEKIT_SERVICE(SWITCH, .primary=true, .characteristics=(homekit_characteristic_t[]) { &cha_auto_change_on, &cha_auto_change_on_name, NULL }), HOMEKIT_SERVICE(SWITCH, .primary=false, .characteristics=(homekit_characteristic_t[]) { &all_swing, &all_swing_name, NULL }), NULL }),
As the topic above, Im struggling how to name it. I figure out how to union the switch but can't name it seperate.
This is part of my accessory code
homekit_characteristic_t cha_auto_change_on = HOMEKITCHARACTERISTIC(ON, true); homekit_characteristic_t cha_auto_change_on_name = HOMEKITCHARACTERISTIC(NAME, "Auto change");
homekit_characteristic_t all_swing = HOMEKITCHARACTERISTIC(ON, true); homekit_characteristic_t all_swing_name = HOMEKITCHARACTERISTIC(NAME, "SWING");
homekit_characteristic_t function_name = HOMEKITCHARACTERISTIC(NAME, "Function");
//=============================
HOMEKIT_ACCESSORY(.id=8, .category=homekit_accessory_category_switch, .services=(homekit_service_t[]) { HOMEKIT_SERVICE(ACCESSORY_INFORMATION, .characteristics=(homekit_characteristic_t[]) { HOMEKIT_CHARACTERISTIC(IDENTIFY, my_accessory_identify), &function_name, NULL }), HOMEKIT_SERVICE(SWITCH, .primary=true, .characteristics=(homekit_characteristic_t[]) { &cha_auto_change_on, &cha_auto_change_on_name, NULL }), HOMEKIT_SERVICE(SWITCH, .primary=false, .characteristics=(homekit_characteristic_t[]) { &all_swing, &all_swing_name, NULL }), NULL }),