2 Bug fixes

1. Fixed a bug where templates failed to display in toggle menu items (at least on some devices).
2. Fixed a bug where a menu item requesting to exit on completion appeared to indicate failure when using Wi-Fi or LTE. The fix uses a delay in exiting the application modelled as sufficient for a Venu 2 device, so this might need tweaking for other devices.
This commit is contained in:
Philip Abbey
2025-09-12 14:34:16 +01:00
parent 46e44ada30
commit e284cd2d4a
6 changed files with 47 additions and 27 deletions

View File

@@ -104,7 +104,11 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
if (data == null) {
setSubLabel(null);
} else if(data instanceof Lang.String) {
setSubLabel(data);
// Need to set both labels, you can't just 'setSubLabel(data)' or nothing displays.
setSubLabel({
:enabled => data,
:disabled => data
});
} else if(data instanceof Lang.Number) {
var d = data as Lang.Number;
setSubLabel(d.format("%d"));