mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-10-31 23:48:13 +00:00
Reworked numericMenuItem to be able to display a different conten in the sublabel than jus a number.
This commit is contained in:
@@ -629,6 +629,10 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
if (item instanceof HomeAssistantToggleMenuItem) {
|
||||
(item as HomeAssistantToggleMenuItem).updateToggleState(data[i.toString() + "t"]);
|
||||
}
|
||||
if (item instanceof HomeAssistantNumericMenuItem) {
|
||||
// (item as HomeAssistantNumericMenuItem).updateNumericState("22");
|
||||
(item as HomeAssistantNumericMenuItem).updateNumericState(data[i.toString() + "n"].toString());
|
||||
}
|
||||
}
|
||||
if (Settings.getMenuCheck() && Settings.getCacheConfig() && !mIsCacheChecked) {
|
||||
// We are caching the menu configuration, so let's fetch it and check if its been updated.
|
||||
@@ -723,6 +727,11 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
"template" => (item as HomeAssistantToggleMenuItem).getToggleTemplate()
|
||||
});
|
||||
}
|
||||
if (item instanceof HomeAssistantNumericMenuItem) {
|
||||
mTemplates.put(i.toString() + "n", {
|
||||
"template" => (item as HomeAssistantNumericMenuItem).getNumericTemplate()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// https://developers.home-assistant.io/docs/api/native-app-integration/sending-data/#render-templates
|
||||
|
||||
Reference in New Issue
Block a user