Skip to content

Commit 99913f4

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

18 files changed

+48
-39
lines changed

dashio/iotcontrol/audio_visual_display.py

+2-2
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

+1-1
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

+4-4
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

+1-1
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

+10-10
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

+1-1
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

+1-1
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

+1-1
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

+11-4
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

+1-1
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

dashio/iotcontrol/label.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(
9090
control_position : ControlPosition, optional
9191
The position of the control on a DeviceView, by default None
9292
title_position : TitlePosition, optional
93-
Position of the title when displayed on the iotdashboard app, by default None
93+
Position of the title when displayed on the **Dash** app, by default None
9494
color : Color, optional
9595
Color of the label, by default Color.WHITE
9696
style : LabelStyle, optional

dashio/iotcontrol/menu.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(
100100
control_position : ControlPosition, optional
101101
The position of the control on a DeviceView, by default None
102102
title_position : TitlePosition, optional
103-
Position of the title when displayed on the iotdashboard app, by default None
103+
Position of the title when displayed on the **Dash** app, by default None
104104
text : str, optional
105105
Menu text, by default "A Menu with Text"
106106
icon : Icon, optional

dashio/iotcontrol/ring_buffer.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ def get_latest(self):
4949
"""
5050
if self._full:
5151
# Get the last item in the buffer
52-
indx = self.cur - 1
53-
if indx < 0:
54-
indx = self.max - 1
55-
return self.data[indx]
52+
index = self.cur - 1
53+
if index < 0:
54+
index = self.max - 1
55+
return self.data[index]
5656
return self.data[-1]
5757

5858
def empty(self) -> bool:

dashio/iotcontrol/selector.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def __init__(
4949
control_position : ControlPosition, optional
5050
The position of the control on a DeviceView, by default None
5151
title_position : TitlePosition, optional
52-
Position of the title when displayed on the iotdashboard app, by default None
52+
Position of the title when displayed on the **Dash** app, by default None
5353
column_no : int, optional default is 1. Must be 1..3
5454
The Dash App reports its screen size in columns. column_no allows you to specify which column no to load into.
5555
Each control can store three configs that define how the device looks for Dash apps installed on single column

dashio/iotcontrol/slider.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(
124124
control_position : ControlPosition, optional
125125
The position of the control on a DeviceView, by default None
126126
title_position : TitlePosition, optional
127-
Position of the title when displayed on the iotdashboard app, by default None
127+
Position of the title when displayed on the **Dash** app, by default None
128128
bar_min : float, optional
129129
min bar value, by default 0.0
130130
bar_max : float, optional

dashio/iotcontrol/table.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def __init__(
167167
self._max_columns = columns
168168

169169
def get_state(self):
170-
return "".join([self._send_row(indx, row) for indx, row in enumerate(self._rows)])
170+
return "".join([self._send_row(index, row) for index, row in enumerate(self._rows)])
171171

172172
@classmethod
173173
def from_cfg_dict(cls, cfg_dict: dict, column_no=1):

dashio/iotcontrol/textbox.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def __init__(
125125
control_position : ControlPosition, optional
126126
The position of the control on a DeviceView, by default None
127127
title_position : TitlePosition, optional
128-
Position of the title when displayed on the iotdashboard app, by default None
128+
Position of the title when displayed on the **Dash** app, by default None
129129
text : str, optional
130130
Text for the textbox, by default ""
131131
text_align : TextAlignment, optional

dashio/iotcontrol/time_graph.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def get_line_format(self):
117117
return f"\t{self.name}\t{self.line_type.value}\t{self.color.value}\t{self.axis_side}\n"
118118

119119
def get_line_from_timestamp(self, timestamp: str) -> str:
120-
"""Converts data from timestamp to a string formatted for the iotdashboard app
120+
"""Converts data from timestamp to a string formatted for the **Dash** app
121121
122122
Returns
123123
-------
@@ -162,6 +162,8 @@ def add_data_point(self, data):
162162
raise TypeError("Not a valid data point")
163163

164164
def add_break(self):
165+
"""Add graph break to the line.
166+
"""
165167
self.timestamp = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc)
166168
dp_break = DataPoint("B")
167169
self.data.append(dp_break)
@@ -265,7 +267,7 @@ def __init__(
265267
control_position : ControlPosition, optional
266268
The position of the control on a DeviceView, by default None
267269
title_position : TitlePosition, optional
268-
Position of the title when displayed on the iotdashboard app, by default None
270+
Position of the title when displayed on the **Dash** app, by default None
269271
y_axis_label : str, optional
270272
Label for the Y axis, by default "Y axis"
271273
y_axis_min : float, optional
@@ -395,7 +397,7 @@ def _get_lines_from_timestamp(self, msg):
395397
return state_str
396398

397399
def send_data(self):
398-
"""Sends the latest Data to the iotdashboard app.
400+
"""Sends the latest Data to the **Dash** app.
399401
"""
400402
state_str = ""
401403
for key, line in self.line_dict.items():

0 commit comments

Comments
 (0)