-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove service runtime #42
Comments
@stefano055415 , an API can be provided for that, but we haven't done so, since there wasn't any need for that. What's your use case? |
I have a device that can be used as an outlet or as a switch, and can be configured at runtime, so when I change from switch to outlet, i would like to update the accessory on homekit |
Better to set something in NVS and just reboot and set appropriate services? Even the category identifier can be correctly updated between HAP_CID_SWITCH/HAP_CID_OUTLET then. Or implement accessory as a bridge and add/remove a switch/outlet as a bridged accessory as applicable? |
I tried to save and reboot, but on homekit it doesn't work anymore If I update a service, from switch to outlet and reboot, hap duplicates the services and they are unreachable If I restart without changing the services everything works fine |
@stefano055415 , Can you try calling |
I have try to call hap_update_config_number() but not working |
Ok I found the problem. if I change the service from switch to outlet and reboot it doesn't work. is it possible to implement this fix in the next update? |
@stefano055415 , I will check and add support as appropriate. For the time being, even though they could be cumbersome to use, can you check if |
ok thanks I try to see if so I can solve for the moment. if you want as soon as you are able to introduce this new function, I would be happy to be able to test it |
@stefano055415 , can you apply this next_iid_patch.txt and see if the |
with this patch, everything seems to work. I just made a small change void hap_acc_set_next_iid (hap_acc_t * ha, uint32_t next_iid) every time I make a change (from switch to outlet for example), I increase a value and save it in nvs. accessory = hap_acc_create(&cfg); |
@stefano055415 Changing the API as above would be too use case specific and non deterministic. Setting a fixed value for next_iid would suit even those use cases wherein services may have changed across fw upgrades, but the iid values need to be retained as per HAP requirements. Since value of next_iid after calling |
@stefano055415 , are you working on a commercial HomeKit product? If yes, as indicated in the README, please get in touch with us here to get access to the MFi variant of the SDK. The above tests would pass with that. Moreover, please also get your use case confirmed from Apple. I am not sure if they would allow this runtime service change. |
ok thanks, I proceeded to make the request. |
I have an accessory with N services, is it possible to remove one more at runtime?
The text was updated successfully, but these errors were encountered: