Skip to content

Commit d459372

Browse files
author
James Boulton
committed
Update Map docs.
1 parent 863df32 commit d459372

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

Documents/Documentation.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ button1.send_button(ButtonState.OFF, Icon.DOWN, "Going Down")
140140
* *control_id : str*. A unique identity string. The identity string must be a unique string for each ButtonGroup per device.
141141
* *title : str*. A short title for the button group.
142142
* *title_position : TitlePosition*. Can be TitlePosition.BOTTOM, TitlePosition.TOP, TitlePosition.OFF.
143+
* *text : str : The text that appears on the Button.
143144
* *button_enabled : boolean*. True allows the app to send button events. False disables button pushes.
144145
* *style : ButtonStyle*. Can be ButtonStyle.BASIC, ButtonStyle.HIGHLIGHT.
145146
* *off_color : Color*. Set the off color.
@@ -151,7 +152,7 @@ button1.send_button(ButtonState.OFF, Icon.DOWN, "Going Down")
151152

152153
When these attributes are set the button control will transmit the new value to connected **Dash** apps.
153154

154-
* *text : str*. The text that appears on the ButtonGroup.
155+
* *text : str*. The text that appears on the Button.
155156
* *icon_name : Icon*. Set the icon for the button.
156157
* *btn_state : ButtonState.* Set the state of the button.
157158

@@ -442,6 +443,20 @@ Multiple IoT devices can be shown on a single Map.
442443

443444
<img src="https://raw.githubusercontent.com/dashio-connect/python-dashio/master/Documents/Map.jpeg" width="200"/>
444445

446+
#### Map Config Attributes
447+
448+
* *control_id : str.* An unique control identity string. The control identity string must be a unique string for each control per device.
449+
* *title : str, optional.* Title of the control, by default "A Label".
450+
* *control_position : ControlPosition, optional.* The position of the control on a DeviceView, by default None
451+
* *title_position : TitlePosition, optional.* Position of the title when displayed on the **Dash** app, by default None.
452+
* *column_no : int.* Optional default is 1. Must be 1..3. The Dash App reports its screen size in columns. column_no allows you to specify which column no to load into. Each control can store three configs that define how the device looks for Dash apps installed on single column phones or 2 column fold out phones or 3 column tablets.
453+
454+
#### Map Methods
455+
456+
* *from_cfg_dict(cls, cfg_dict: dict):* Instantiate a Map as defined from the dictionary. [See Helper Functions](#helper-functions) for tools to use the CFG64 txt generated by exporting a layout from the **Dash** app.
457+
* *add_location_to_track(self, location: MapLocation, track_id: str)* Adds a location to a track and sends it.
458+
* *send_location(self, location: MapLocation, track_id: str = "")* Sends a location.
459+
445460
### Menu
446461

447462
A Menu control is used to present a popup table of user adjustable controls and is ideal for presenting a list of IoT device setup parameters. The Menu does not receive messages directly, but presents a list of other controls (sub-controls) that send and receive messages of their own.

dashio/iotcontrol/button.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@ class Button(Control):
8888
An unique control identity string. The control identity string must be a unique string for each control per device
8989
title: str
9090
A short title for the button group
91-
text : str
92-
The text that appears on the ButtonGroup
9391
title_position : TitlePosition
9492
Can be TitlePosition.BOTTOM, TitlePosition.TOP, TitlePosition.OFF
9593
button_enabled : boolean
9694
True allows the app to send button events. False disables button pushes
97-
stype : ButtonStyle
95+
style : ButtonStyle
9896
The style of the button. Options are ButtonStyle.BASIC, ButtonStyle.HIGHLIGHT
9997
icon_name : Icon
10098
Set the icon for the button
10199
off_color : Color
102100
Set the off color
103101
on_color : Color
104102
Set the on color
103+
text : str
104+
The text that appears on the Button.
105105
control_position : ControlPosition
106106
Set the size and position of the button on a DeviceView.
107107
column_no : int, optional default is 1. Must be 1..3

dashio/iotcontrol/map.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
SOFTWARE.
2323
"""
2424
import datetime
25-
from dateutil import parser
2625
import json
26+
from dateutil import parser
2727

2828
from ..constants import BAD_CHARS
2929
from .control import Control, ControlPosition, ControlConfig, _get_title_position
@@ -164,7 +164,7 @@ def __init__(
164164
control_position : ControlPosition, optional
165165
The position of the control on a DeviceView, by default None
166166
title_position : TitlePosition, optional
167-
Position of the title when displayed on the iotdashboard app, by default None
167+
Position of the title when displayed on the **Dash** app, by default None
168168
column_no : int, optional default is 1. Must be 1..3
169169
The Dash App reports its screen size in columns. column_no allows you to specify which column no to load into.
170170
Each control can store three configs that define how the device looks for Dash apps installed on single column

0 commit comments

Comments
 (0)