Fixes bool to int

This commit is contained in:
iranl
2024-03-15 19:50:44 +01:00
parent 40808229a3
commit 620fde05ca
4 changed files with 52 additions and 44 deletions

View File

@@ -164,37 +164,45 @@ bool initPreferences()
preferences->putBool(preference_keypad_info_enabled, false);
}
uint32_t aclPrefs[17];
switch(preferences->getInt(preference_access_level))
{
case 0:
preferences->putBool(preference_keypad_control_enabled, true);
preferences->putBool(preference_admin_enabled, true);
{
preferences->putBool(preference_keypad_control_enabled, true);
preferences->putBool(preference_admin_enabled, true);
aclPrefs = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
break;
uint32_t aclPrefs[17] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
break;
}
case 1:
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
{
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
aclPrefs = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0};
break;
uint32_t aclPrefs[17] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0};
preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
break;
}
case 2:
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
{
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
aclPrefs = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
break;
uint32_t aclPrefs[17] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
break;
}
case 3:
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
{
preferences->putBool(preference_keypad_control_enabled, false);
preferences->putBool(preference_admin_enabled, false);
aclPrefs = {1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0};
break;
}
preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
uint32_t aclPrefs[17] = {1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0};
preferences->putBytes(preference_acl, (byte*)(&aclPrefs), sizeof(aclPrefs));
break;
}
}
}
preferences->putInt(preference_config_version, atof(NUKI_HUB_VERSION) * 100);