Open mmackh opened 2 years ago
Ok, I'm a little further along now. Only one device, but it's a working switch in this case.
init_hap_storage(pair_file_name);
hap_setbase_accessorytype(homekit_accessory_category_door_lock);
hap_initbase_accessory_service("host","company", productID.c_str(),"AP", "1.0");
const char *serviceName = "Access Control";
hapservice = hap_add_switch_service(serviceName, lockCallback, NULL);
lockCharacteristic = homekit_service_characteristic_by_type(hapservice, HOMEKIT_CHARACTERISTIC_ON);
hap_init_homekit_server();
Hi, Lock control is not implemented (ported) to my library. if you want to see lock as accessory on the apple you have to implement the same function (like for switch) , but using service : HOMEKIT_SERVICE_LOCK_MANAGEMENT characteristic: /** Defines a number of additional settings, rules and information on a lock mechanism inside of a accessory.
Required Characteristics:
VERSION
Optional Characteristics:
Thank you for the fast response. I'm not yet sure on how to add a custom accessory type - everything is a macro so when starting off with a template like for the switch:
NEW_HOMEKIT_SERVICE(SWITCH, .primary = true,.characteristics=(homekit_characteristic_t*[]) {
NEW_HOMEKIT_CHARACTERISTIC(NAME, szname),
NEW_HOMEKIT_CHARACTERISTIC(
ON, true,
.callback=HOMEKIT_CHARACTERISTIC_CALLBACK(
cb, .context=context
),
),
NULL
});
I'm not able to get it to compile. Is there a function / method I'm missing somewhere to create custom services (incl. characteristics)?
Ok, i will do that, but later , now do not have a time and energy (I'm from Kiev) You can send me your file and changes i will try to compile regards
Has anyone managed to add a door lock service? Here's my attempt - but I do have an error. It also results in adding two devices.