make setting conditional by using group

This commit is contained in:
Vincent Elger Zwanenburg
2025-07-11 17:11:44 +01:00
parent b2b8ffb332
commit 62f0e711c9
3 changed files with 15 additions and 7 deletions

View File

@ -117,10 +117,12 @@
<settingConfig type="alphaNumeric" readonly="true" />
</setting>
<setting
propertyKey="@Properties.wifi_lte_execution"
title="@Strings.WifiLteExecution"
>
<settingConfig type="boolean" />
</setting>
<group enableIfTrue="@Properties.cache_config" id="wifiLteExection" title="@Strings.WifiLteExecution" description="@Strings.WifiLteExecutionDescription">
<setting
propertyKey="@Properties.wifi_lte_execution"
title="@Strings.WifiLteExecutionEnable"
>
<settingConfig type="boolean" />
</setting>
</group>
</settings>

View File

@ -70,5 +70,7 @@
<string id="SettingsEnableBatteryLevel">Enable the background service to send the device battery level, location and (if supported) activity data to Home Assistant.</string>
<string id="SettingsBatteryLevelRefreshRate">The refresh rate (in minutes) at which the background service should repeat sending data.</string>
<string id="WebhookId">(Read only) The Webhook ID created by the device for background service updates. You might require this for debugging.</string>
<string id="WifiLteExecution">Allows the app to start without phone connection, and prompt to execute command over Wifi/LTE.</string>
<string id="WifiLteExecution">Wifi/LTE execution mode.</string>
<string id="WifiLteExecutionEnable">Enable executing commands over Wifi/LTE.</string>
<string id="WifiLteExecutionDescription">Allows the app to start without phone connection (when menu is cached), and prompt to execute command over Wifi/LTE.</string>
</strings>

View File

@ -277,6 +277,10 @@ class Settings {
//! @return The state of the toggle.
//
static function getWifiLteExecutionEnabled() as Lang.Boolean {
// Wifi/LTE sync execution on a cached menu
if (!mCacheConfig) {
return false;
}
return mWifiLteExecution;
}