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
{{ message }}
Repository navigation
Commit 5686d66
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: skills/python-dashio/SKILL.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
@@ -18,7 +18,7 @@ The reference is [Documentation.md](https://github.com/dashio-connect/python-das
18
18
-**A control is `(type, ID)`.** The layout, the device code and every handler must agree exactly: `Knob("KNB")` in Python is `dashio_send_knob("KNB", ...)` in Zephyr. A control that does nothing in the app is a mismatch first.
19
19
-**Give each control its position when you create it**, with `control_position=dashio.ControlPosition(x, y, width, height)` (ratios of the view, 0 to 1). Assigning `control.control_position` afterwards does nothing, and the app draws unpositioned controls on top of each other.
20
20
-**Raise `cfgRev` whenever the layout changes.** The app fetches the layout again only when the device reports a different cfgRev, otherwise it keeps showing the old one.
21
-
-**`deviceSetup`** (in the `CFG` object) lists the device's connections and the settings the app may change, upper case: `BLE,TCP,MQTT,NAME,WIFI,DASH,RST,FRST,SAF,BBE,APN,GNSS,OTA,CLK,FLMD`. List only what the device code implements; without `WIFI` or `DASH` the app won't offer those settings.
21
+
-**`deviceSetup`** (in the `CFG` object) lists the device's connections and the settings the app may change, upper case: `BLE,TCP,MQTT,NAME,WIFI,DASH,RST,FRST,SAF,BBE,APN,GNSS,OTA,CLK,FLMD`. List only what the device code implements; without `WIFI` or `DASH` the app won't offer those settings.`SAF` (store and forward, for devices that only connect now and then) needs no device code: the app turns it on and off on the Dash server, which holds the app's messages until the device connects and then asks it for STATUS. Firmware can always list it.
22
22
-**Menus and ButtonGroups:**`menu.add_control(c)` takes TextBox, Button, Slider or Selector only; `button_group.add_button(b)`. A Menu with `menu.parent_id = "PROV"` goes in the app's provisioning menu (the device's settings screen). It still needs a `control_position`, and the app only shows the provisioning menu when `deviceSetup` offers `NAME`, `WIFI` or `DASH`.
23
23
-**Column counts:** the app reports 1 column for phones, 2 for fold out phones, 3 for tablets. It gets the layout for its count, else the nearest smaller, else the smallest, so a single 1 column layout works everywhere. For more, create the controls again with that layout's positions and the same IDs, and generate a layout from each set.
24
24
@@ -135,7 +135,7 @@ while True:
135
135
```
136
136
137
137
-**Add every control to the device** (`device.add_control`) and each visible one to its DeviceView. Setting a value attribute (`dial_value`, `knob_value`, `text`, ...) sends it to every connection.
138
-
-**Settings callbacks add their `deviceSetup` options**: `set_name_callback()` adds `NAME`, `set_wifi_callback()``WIFI`, `set_dashio_callback()``DASH`, `set_reset_callback()``RST`. Connections add `TCP` and `MQTT`. With a Python prototype for firmware, set up the same callbacks as the firmware so the exported `deviceSetup` is right.
138
+
-**Settings callbacks add their `deviceSetup` options**: `set_name_callback()` adds `NAME`, `set_wifi_callback()``WIFI`, `set_dashio_callback()``DASH`, `set_reset_callback()``RST`, and `device.store_and_forward = True` adds `SAF`. Connections add `TCP` and `MQTT`. With a Python prototype for firmware, set up the same callbacks as the firmware so the exported `deviceSetup` is right.
139
139
-**cfgRev for a device that builds its layout at startup**: save `device.get_cfg_hash()` with cfgRev (e.g. in an ini file), and when the hash differs, increase cfgRev and set `device.config_revision`. `Examples/greenhouse/greenhouse.py` does this. Work it out after adding connections and callbacks, since they change `deviceSetup`.
140
140
-**Loading layouts:**`device.add_cfg64(cfg64, column_no)`, or `Device(..., cfg_dict={1: phone_cfg64, 3: tablet_cfg64})`. Add the device's own controls first: loading a layout creates controls for IDs the device doesn't have. With no layout loaded, the device sends one generated from its controls (`device.get_generated_cfg_dict()`).
141
141
-**Receive callbacks can reply:** a callback's returned string is sent back to the app.
0 commit comments