Skip to content
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

Regarding initial value #92

Open
beckmx opened this issue Apr 29, 2021 · 1 comment
Open

Regarding initial value #92

beckmx opened this issue Apr 29, 2021 · 1 comment

Comments

@beckmx
Copy link

beckmx commented Apr 29, 2021

Hello, I was wondering how to set the initial value for the bulb type, I noticed a method:
hap_setinitial_characteristic_bool_value

But when testing, appears a message about not being correctly set:
!!! HomeKit: Wrong default value

and How I created my service and default value:

hapservice_1= hap_add_lightbulb_service(prefs.getString("btn1_string").c_str(),relay_callback_1,(void*)&BUTTON_1);
hap_setinitial_characteristic_bool_value(hapservice_1,HOMEKIT_CHARACTERISTIC_ON,false);
@rauberdaniel
Copy link
Contributor

Try using hap_set_initial_characteristic_bool_value (mind the underscore between set and initial. Looks like there is a bug which falsely rewrites the bool function to an int function instead of the corresponding bool function:

hap_set_initial_characteristic_int_value(homekit_service_characteristic_by_type(s, type), val);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants