You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/config/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The Garmin SDK’s _Properties_ are stored externally from the app and persist a
14
14
15
15
---
16
16
17
-
## Structure and Usage
17
+
## Key Concepts
18
18
19
19
All devices inherit default values from `BaseConfig` and `GlanceBaseConfig`, which define all configuration values used in the _Widget_ and _Glance_, respectively.
20
20
@@ -24,7 +24,7 @@ Additional base classes can be introduced for specific device families. For exam
24
24
25
25
---
26
26
27
-
## Key Files and Directories
27
+
## Folder Structure
28
28
29
29
-`base/`:
30
30
Contains `BaseConfig` and `GlanceBaseConfig`, which define the baseline values for all devices.
Copy file name to clipboardExpand all lines: source/main/data/README.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,20 @@ Implements the data layer of the application.
4
4
5
5
---
6
6
7
-
## Subfolder Structure
7
+
## Folder Structure
8
8
9
9
### Subfolder `communications/`
10
10
11
11
Responsibel for keeping the data layer in sync with the openHAB server.
12
12
13
13
For more details, see the folder’s [README](communications/README.md).
14
14
15
-
---
16
-
17
15
### Subfolder `sitemap/`
18
16
19
17
This folder defines the data model for parsing and representing sitemap content from openHAB. The classes defined in sitemap feed the data to be displayed to the user interface.
20
18
21
19
For more details, see the folder’s [README](sitemap/README.md).
22
20
23
-
---
24
-
25
21
### Subfolder `storage/`
26
22
27
23
Handles reading from and writing to persistent storage.
Copy file name to clipboardExpand all lines: source/main/data/communications/README.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,16 +6,40 @@ This folder contains the connection management logic, HTTP request handling and
6
6
7
7
---
8
8
9
-
## Subfolder Structure
9
+
## Key Concepts
10
+
11
+
### Connection Mode
12
+
13
+
The app supports two connection modes: Bluetooth Low Energy (BLE) via the paired phone and direct Wi-Fi.
14
+
15
+
The BLE connection is effectively always on and allows regular polling of the sitemap, including state updates. In contrast, using Wi-Fi requires entering a dedicated Garmin sync mode. During this process, native Garmin system views are shown to indicate sync progress and completion.
16
+
17
+
Because of this limitation, no item states are displayed while operating in Wi-Fi mode. Commands can still be sent, but they are executed within the sync workflow. A manual sitemap refresh can also be triggered from the settings menu, though this updates only the sitemap structure and does not display live states.
18
+
19
+
The decision not to display states in Wi-Fi mode is intentional. State accuracy is critical, and showing potentially outdated or inconsistent information would be misleading. In particular, after sending a command there is no reliable way to predict possible side effects on related items. For example, switching on a light could affect a nearby group item. Without real-time updates, the UI might display inconsistent states. In such cases, it is preferable to show no state at all rather than an incorrect one.
20
+
21
+
See also the user manual’s [Network Access](https://next.openhab.org/docs/apps/garmin/#network-access) section for a user-facing explanation of this behavior.
22
+
23
+
### Sitemap Updates
24
+
25
+
Connect IQ does not support subscribing to sitemap updates from openHAB. Therefore, the app periodically polls the complete sitemap via a web request and rebuilds the menu structure based on the response.
26
+
27
+
The polling interval can be configured by the user in the app settings.
28
+
29
+
### Commands
30
+
31
+
Commands are sent using a dedicated command web request. This request is triggered by the menu items representing the corresponding sitemap elements.
32
+
33
+
---
34
+
35
+
## Folder Structure
10
36
11
37
### Subfolder `connection/`
12
38
13
39
Contains the `ConnectionManager`, which tracks the currently available connection type (BLE vs. Wi-Fi) and manages transitions between normal, degraded (Wi-Fi), and offline modes.
14
40
15
41
For more details on connection behavior, see the [Network Access](https://next.openhab.org/docs/apps/garmin/#network-access) section of the user manual.
16
42
17
-
---
18
-
19
43
### Subfolder `sync-delegates/`
20
44
21
45
Implements Wi-Fi-based synchronization used when no BLE connection is available.
@@ -35,7 +59,7 @@ Implements communication with the openHAB server using the Connect IQ SDK’s `T
35
59
36
60
These requests are used for both BLE communication and Wi-Fi mode. In addition to sending and receiving data, this layer is responsible for processing server responses—for example, initializing a new sitemap and forwarding it to the user interface.
37
61
38
-
#### Subfolders
62
+
#### Folder Structure
39
63
40
64
-**`web-requests/base/`**
41
65
Contains `BaseRequest`, the abstract base class for all HTTP requests.
Copy file name to clipboardExpand all lines: source/main/data/sitemap/README.md
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,31 @@ See the user manual for details: [User Manual – Sitemap Setup](https://next.op
8
8
9
9
---
10
10
11
-
## Subfolder Structure
11
+
## Key Concepts
12
+
13
+
The sitemap data structure represents a single sitemap response received from openHAB. It is therefore inherently transient and exists only until the next response is received from the server, at which point it is fully replaced.
14
+
15
+
As a general rule, the sitemap data structure is not modified after it has been created. Instead, it reflects exactly the state provided by the server.
16
+
17
+
There is one exception to this rule. When a command is sent successfully, the UI immediately reflects the expected new state without waiting for the next server response. This behavior is controlled by the corresponding menu items, which update the sitemap data structure locally to match the anticipated state. We refer to this as an internal update.
18
+
19
+
---
20
+
21
+
## Folder Structure
12
22
13
23
### Subfolder `base/`
14
24
15
25
Contains `SitemapElement.mc`, the abstract base class for all sitemap elements.
16
26
17
27
It defines shared properties and common parsing logic used by all concrete sitemap element types.
18
28
19
-
---
20
-
21
29
### Subfolder `json/`
22
30
23
31
The Connect IQ API delivers JSON data as a dictionary.
24
32
`JsonObjectAdapter` provides type-safe accessors for retrieving objects, arrays, strings, numbers, and booleans from the JSON structure.
25
33
26
34
This layer isolates JSON handling details from the higher-level sitemap model.
27
35
28
-
---
29
-
30
36
### Subfolder `pages/`
31
37
32
38
Contains classes representing the **content** of container-type sitemap elements (e.g., frames or groups).
@@ -35,15 +41,13 @@ These classes model the internal structure and child elements of a container. Th
35
41
36
42
To keep the UI responsive and avoid limitations such as the Watchdog timeout for long-running code and stack size restrictions caused by recursive processing, pages are processed asynchronously and non-recursively. The work is split into small tasks that are executed by the task queue implementation.
37
43
38
-
---
39
-
40
44
### Subfolder `widgets/`
41
45
42
46
Contains `SitemapElement` subclasses representing concrete sitemap widgets, such as switches, sliders, text labels, and container elements.
43
47
44
48
For container-type elements (e.g., frames or groups), the widget class describes the container itself and links to the corresponding implementation in `pages/` to represent its content.
45
49
46
-
#### Subfolders
50
+
#### Folder Structure
47
51
48
52
-**`base/`**
49
53
Contains `SitemapWidget`, the base class for all widget-type elements.
Contains components responsible for fallback behavior, such as error handling and the loading view.
28
28
29
29
These classes are used when normal feature rendering cannot proceed (e.g., due to communication failures or missing data). They ensure that the application remains robust and provides meaningful feedback to the user.
30
30
31
31
For more details, see the folder’s [README](fallbacks/README.md).
32
32
33
-
---
34
-
35
-
## Subfolder `features/`
33
+
### Subfolder `features/`
36
34
37
35
Implements the main user-facing features of the application.
38
36
@@ -44,19 +42,15 @@ The current feature categories are:
44
42
45
43
For more details, see the folder’s [README](features/README.md).
46
44
47
-
---
48
-
49
-
## Subfolder `shared/`
45
+
### Subfolder `shared/`
50
46
51
47
Contains reusable UI components that are used across multiple features.
52
48
53
49
These classes represent visible UI elements or composable building blocks that can be rendered in different contexts.
54
50
55
51
For more details, see the folder’s [README](shared/README.md).
56
52
57
-
---
58
-
59
-
## Subfolder `ui-infrastructure/`
53
+
### Subfolder `ui-infrastructure/`
60
54
61
55
Contains central, stateful runtime facilities that support the user interface.
Copy file name to clipboardExpand all lines: source/main/user-interface/features/README.md
+7-50Lines changed: 7 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,64 +30,21 @@ The _Settings_ menu is also implemented using `CustomMenu`.
30
30
31
31
---
32
32
33
-
## Subfolder `glance/`
33
+
## Folder Structure
34
34
35
-
Implements the Glance feature.
36
-
37
-
`GlanceSitemapView` provides a compact view that reads the sitemap label from persistent storage and displays it in the glance carousel.
38
-
39
-
When the app is launched in glance mode, `OHApp.getGlanceView()` acts as the entry point and prepares the corresponding view.
35
+
### Subfolder `glance/`
40
36
41
-
### Memory Constraints
42
-
43
-
When running as a glance, available memory is very limited. Connect IQ supports scoped classes and resources for this purpose. Classes required in glance mode must be annotated with `(:glance)`, and only the strictly necessary classes should be included in this scope.
37
+
Implements the Glance feature.
44
38
45
-
---
39
+
For detailed information, see the folder’s [README](glance/README.md).
46
40
47
-
## Subfolder `settings-menu/`
41
+
###Subfolder `settings/`
48
42
49
43
Implements the _Settings_ feature.
50
44
51
-
Currently provides the following information and actions:
52
-
53
-
- App version
54
-
- openHAB server URL
55
-
- Current connection mode (Phone/BLE, Wi-Fi, Offline)
56
-
- Timestamp of the last sitemap update
57
-
- Manual sitemap update over Wi-Fi
58
-
59
-
Because Wi-Fi mode does not automatically poll for structural sitemap changes, updates must be triggered manually when operating without a BLE connection.
60
-
See [No Polling of Sitemap Changes and States](https://next.openhab.org/docs/apps/garmin/#no-polling-of-sitemap-changes-and-states) in the user manual for details and screenshots.
61
-
62
-
### Platform-Specific Behavior
63
-
64
-
-**Button-based devices**
65
-
The _Settings_ menu appears as a parallel menu to the homepage. It is accessed by scrolling beyond the title or footer of the _Homepage_ menu, mimicking the system settings access pattern on devices such as the Fenix 7 Pro or Epix 2 Pro.
66
-
67
-
-**Touch-based devices**
68
-
Due to more limited gesture support, the _Settings_ menu is implemented as a regular menu item within the _Homepage_.
69
-
70
-
Device-specific behavior is defined in the `monkey.jungle` build file. Exclusion annotations (also used in input delegates) ensure that the correct implementation is compiled per device.
71
-
72
-
### Subfolders
73
-
74
-
#### Subfolder `manager/`
75
-
76
-
Contains `SettingsMenuManager`, which controls the lifecycle and presentation of the settings menu.
77
-
78
-
It maintains singleton instances of the menu and its input delegate, tracks whether the menu is currently visible, and coordinates transitions between the homepage and the settings view. It also determines focus behavior based on slide direction and input type, and manages pushing and popping the view on the `ViewStack`.
79
-
80
-
#### Subfolder `menu/`
81
-
82
-
Contains the `SettingsMenu` implementation based on `BaseMenu`, along with the corresponding input delegates for handling user interaction.
83
-
84
-
#### Subfolder `menu-items/`
85
-
86
-
Contains the individual menu items displayed within the _Settings_ menu.
87
-
88
-
---
45
+
For detailed information, see the folder’s [README](settings/README.md).
89
46
90
-
## Subfolder `sitemap/`
47
+
###Subfolder `sitemap/`
91
48
92
49
Implements the core UI for displaying and interacting with openHAB sitemap content.
0 commit comments