Skip to content

Commit 99913f4

Browse files
author
James Boulton
committed
Spelling and documentation fixes.
1 parent 806ee11 commit 99913f4

18 files changed

Lines changed: 48 additions & 39 deletions

dashio/iotcontrol/audio_visual_display.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(
5151
control_position : ControlPosition, optional
5252
The position of the control on a DeviceView, by default None
5353
title_position : TitlePosition, optional
54-
Position of the title when displayed on the iotdashboard app, by default None
54+
Position of the title when displayed on the **Dash** app, by default None
5555
column_no : int, optional default is 1. Must be 1..3
5656
The Dash App reports its screen size in columns. column_no allows you to specify which column no to load into.
5757
Each control can store three configs that define how the device looks for Dash apps installed on single column
@@ -85,7 +85,7 @@ def from_cfg_dict(cls, cfg_dict: dict, column_no=1):
8585
return tmp_cls
8686

8787
def get_state(self):
88-
"""get_state is called by iotdashboard
88+
"""get_state is called by Device
8989
9090
Returns
9191
-------

dashio/iotcontrol/button.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def from_cfg_dict(cls, cfg_dict: dict, column_no=1):
192192
return tmp_cls
193193

194194
def get_state(self):
195-
"""get_state is called by iotdashboard
195+
"""get_state is called by Device
196196
197197
Returns
198198
-------

dashio/iotcontrol/chart.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __init__(self, name="", line_type=ChartLineType.LINE, color=Color.BLACK, rig
4040
self.axis_side = 'right'
4141

4242
def get_line_data(self):
43-
"""Returns the line data formatted for the iotdashboard app
43+
"""Returns the line data formatted for the **Dash** app
4444
4545
Returns
4646
-------
@@ -133,7 +133,7 @@ class Chart(Control):
133133
"""
134134

135135
def get_state(self):
136-
"""Called by iotdashboard"""
136+
"""Called by Device"""
137137
state_str = ""
138138
for key, line in self.line_dict.items():
139139
state_str += self._control_hdr_str + key + line.get_line_data()
@@ -166,7 +166,7 @@ def __init__(
166166
control_id : str
167167
A unique identifier for this control
168168
title : str, optional
169-
The title for this control will be displayed on the iotdashboard app, by default "A Chart"
169+
The title for this control will be displayed on the **Dash** app, by default "A Chart"
170170
title_position : TitlePosition, optional
171171
The position of the title, by default TitlePosition.BOTTOM
172172
x_axis_label : str, optional
@@ -313,7 +313,7 @@ def add_line(self, line_id: str, gline: ChartLine):
313313
self.line_dict[line_id.translate(BAD_CHARS)] = gline
314314

315315
def send_chart(self):
316-
"""Sends the chart to any connected iotdashboard app.
316+
"""Sends the chart to any connected **Dash** app.
317317
"""
318318
state_str = ""
319319
for key, line in self.line_dict.items():

dashio/iotcontrol/color_picker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def __init__(
9292
control_position : ControlPosition, optional
9393
The position of the control on a DeviceView, by default None
9494
title_position : TitlePosition, optional
95-
Position of the title when displayed on the iotdashboard app, by default None
95+
Position of the title when displayed on the **Dash** app, by default None
9696
picker_style: ColorPickerStyle, optional
9797
The style of color picker to use.
9898
send_only_on_release: Boolean

dashio/iotcontrol/control.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class ControlConfig:
194194
"""Base ControlConfig"""
195195

196196
def get_cfg_json(self) -> str:
197-
"""Returns the CFG str for the control called when the iotdashboard app asks for a CFG
197+
"""Returns the CFG str for the control called when the **Dash** app asks for a CFG
198198
199199
Parameters
200200
----------
@@ -211,7 +211,7 @@ def get_cfg_json(self) -> str:
211211
return cfg_str
212212

213213
def get_cfg64(self) -> dict:
214-
"""Returns the CFG dict for the control called when the iotdashboard app asks for a CFG
214+
"""Returns the CFG dict for the control called when the **Dash** app asks for a CFG
215215
216216
Parameters
217217
----------
@@ -304,11 +304,11 @@ class Control():
304304
"""Base class for controls. """
305305

306306
def get_state(self) -> str:
307-
"""This is called by iotdashboard app. Controls need to implement their own version."""
307+
"""This is called by **Dash** app. Controls need to implement their own version."""
308308
return ""
309309

310310
def get_cfg(self, data) -> list:
311-
"""Returns the CFG str for the control called when the iotdashboard app asks for a CFG
311+
"""Returns the CFG str for the control called when the **Dash** app asks for a CFG
312312
313313
Parameters
314314
----------
@@ -337,7 +337,7 @@ def get_cfg(self, data) -> list:
337337
return cfg_list
338338

339339
def get_cfg64(self, data) -> list:
340-
"""Returns the CFG dict for the control called when the iotdashboard app asks for a CFG
340+
"""Returns the CFG dict for the control called when the **Dash** app asks for a CFG
341341
342342
Parameters
343343
----------
@@ -381,7 +381,7 @@ def add_receive_message_callback(self, callback):
381381
self._message_rx_event += callback
382382

383383
def remove_receive_message_callback(self, callback):
384-
"""Remaove a callback from receive incoming messages to the control."""
384+
"""Remove a callback from receive incoming messages to the control."""
385385
self._message_rx_event -= callback
386386

387387
def add_transmit_message_callback(self, callback):
@@ -392,12 +392,12 @@ def remove_transmit_message_callback(self, callback):
392392
"""Remove a callback for transmitted messages from the control."""
393393
self._message_tx_event -= callback
394394

395-
def __init__(self, cntrl_type: str, control_id: str):
395+
def __init__(self, ctrl_type: str, control_id: str):
396396
"""Control base type - all controls have these characteristics and methods.
397397
398398
Parameters
399399
----------
400-
cntrl_type : str
400+
ctrl_type : str
401401
The type of control to implement
402402
control_id : str
403403
An unique control identity string. The control identity string must be a unique string for each control per device
@@ -412,15 +412,15 @@ def __init__(self, cntrl_type: str, control_id: str):
412412
self._is_active = False
413413

414414
self._cfg_max_no_columns = 3
415-
self.cntrl_type = cntrl_type.translate(BAD_CHARS)
415+
self.ctrl_type = ctrl_type.translate(BAD_CHARS)
416416
self.control_id = control_id.translate(BAD_CHARS)
417417
if not self.control_id:
418418
raise ValueError('control_id cannot be an empty string')
419419
self._message_rx_event = Event()
420420
self._message_tx_event = Event()
421421
# This may break things but makes all controls able to be setup from tasks.
422422
self._message_rx_event += self._message_tx_event
423-
self._control_hdr_str = f"\t{{device_id}}\t{self.cntrl_type}\t{self.control_id}\t"
423+
self._control_hdr_str = f"\t{{device_id}}\t{self.ctrl_type}\t{self.control_id}\t"
424424

425425
def del_config(self, column_no=1):
426426
"""Deletes all the columnar config layout entries"""

dashio/iotcontrol/device_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def from_dict(cls, cfg_dict: dict):
114114

115115
class DeviceView(Control):
116116
"""A DeviceView provides a control that describes appearance and style of the group of controls
117-
that are displayed on this DeviceView by the iotdashboard app.
117+
that are displayed on this DeviceView by the **Dash** app.
118118
119119
Attributes
120120
----------

dashio/iotcontrol/dial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(
132132
control_position : ControlPosition, optional
133133
The position of the control on a DeviceView, by default None
134134
title_position : TitlePosition, optional
135-
Position of the title when displayed on the iotdashboard app, by default None
135+
Position of the title when displayed on the **Dash** app, by default None
136136
dial_min : float, optional
137137
Minimum dial position, by default 0.0
138138
dial_max : float, optional

dashio/iotcontrol/direction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __init__(
110110
control_position : ControlPosition, optional
111111
The position of the control on a DeviceView, by default None
112112
title_position : TitlePosition, optional
113-
Position of the title when displayed on the iotdashboard app, by default None
113+
Position of the title when displayed on the **Dash** app, by default None
114114
style : DirectionStyle, optional
115115
The Direction style to display, by default DirectionStyle.DEG
116116
pointer_color : Color, optional

dashio/iotcontrol/event_log.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __init__(self, lines: str, color=Color.WHITE):
4242
4343
lines : str max 25 lines long. Each line is separated by '\n'
4444
color : Color, optional
45-
The color to display this data point on the iotdashboard app, by default Color.WHITE
45+
The color to display this data point on the **Dash** app, by default Color.WHITE
4646
"""
4747
self.color = color
4848
self.timestamp = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc)
@@ -99,7 +99,7 @@ def __init__(
9999
control_id : str
100100
A unique identifier for this control
101101
title : str, optional
102-
The title for this control will be displayed on the iotdashboard app, by default "An Event Log"
102+
The title for this control will be displayed on the **Dash** app, by default "An Event Log"
103103
title_position : TitlePosition, optional
104104
The position of the title, by default TitlePosition.BOTTOM
105105
control_position : ControlPosition, optional
@@ -160,7 +160,7 @@ def _get_log_from_timestamp(self, msg):
160160
return data_str
161161

162162
def add_event_data(self, data: EventData):
163-
"""Add a data point to the log and send it to any connected iotdashboard app
163+
"""Add a data point to the log and send it to any connected **Dash** app
164164
165165
Parameters
166166
----------
@@ -172,10 +172,17 @@ def add_event_data(self, data: EventData):
172172
self.state_str = self._control_hdr_str + str(data)
173173

174174
def send_event(self, event: EventData):
175+
"""Send event.
176+
177+
Parameters
178+
----------
179+
event : EventData
180+
The data to send
181+
"""
175182
self.state_str = self._control_hdr_str + str(event)
176183

177184
def send_latest_data(self):
178-
"""Send the latest log entry to any connected iotdashboard app.
185+
"""Send the latest log entry to any connected **Dash** app.
179186
"""
180187
if self.log:
181188
self.state_str = self._control_hdr_str + str(self.log.get_latest())

dashio/iotcontrol/knob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(
124124
control_id : str
125125
A unique identifier for this control
126126
title : str, optional
127-
The title for this control will be displayed on the iotdashboard app, by default "A Knob"
127+
The title for this control will be displayed on the **Dash** app, by default "A Knob"
128128
title_position : TitlePosition, optional
129129
The position of the title, by default TitlePosition.BOTTOM
130130
knob_style : KnobStyle, optional

0 commit comments

Comments
 (0)