Skip to content

Commit e4db445

Browse files
author
James Boulton
committed
Purge IoT Dashboard.
1 parent 2bd1914 commit e4db445

16 files changed

+60
-50
lines changed

Examples/DashIOTest.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import dashio
2-
import signal
3-
import logging
41
import argparse
52
import configparser
6-
import shortuuid
3+
import logging
4+
import signal
75
import time
86

7+
import dashio
8+
import shortuuid
9+
910
SHUTDOWN = False
1011
COUNTER = 0
1112

Examples/RaspberryPi/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ sudo cp ble_set_wifi.service /etc/systemd/system
77
sudo systemctl enable ble_set_wifi.service
88
sudo systemctl start ble_set_wifi.service
99
```
10-

Examples/TestConfigControl.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/python3
22

3-
from dashio.dashdevice import Device
4-
import time
53
import argparse
4+
import logging
65
import signal
6+
import time
7+
78
import dashio
8-
import logging
99

1010

1111
class TestControls:
@@ -109,7 +109,6 @@ def __init__(self):
109109
self.sldr_cntrl.title = "Slider"
110110
self.sldr_cntrl.bar_max = 10
111111
self.sldr_cntrl.slider_enabled = True
112-
self.sldr_cntrl.red_value
113112
device.add_control(self.sldr_cntrl)
114113
self.test_menu.add_control(self.sldr_cntrl)
115114

Examples/TestControls.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/python3
22

3-
import time
4-
import random
53
import argparse
4+
import logging
5+
import random
66
import signal
7+
import time
8+
79
import dashio
8-
import logging
910

1011

1112
class TestControls:

Examples/TestEventLog.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/python3
22

3-
import time
43
import argparse
4+
import logging
55
import signal
6+
import time
7+
68
import dashio
7-
import logging
89

910

1011
class TestEventLog:

Examples/TestGraphs.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/python3
22

3-
import time
3+
import argparse
44
import datetime
5+
import logging
56
import random
6-
import argparse
77
import signal
8+
import time
9+
810
import dashio
9-
import logging
1011

1112

1213
class TestControls:

Examples/TestTCP.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/python3
2-
from dashio.iotcontrol.enums import DialNumberPosition, DialStyle, DirectionStyle, Precision
3-
import time
4-
import random
52
import argparse
6-
import signal
7-
import dashio
83
import logging
94
import platform
5+
import random
6+
import signal
7+
import time
8+
9+
import dashio
10+
from dashio.iotcontrol.enums import (DialNumberPosition, DialStyle,
11+
DirectionStyle, Precision)
1012

1113

1214
class TestControls:

Examples/TestZMQ.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/python3
22

3-
import time
4-
import random
53
import argparse
6-
import signal
7-
import dashio
84
import logging
95
import platform
6+
import random
7+
import signal
8+
import time
9+
10+
import dashio
1011

1112

1213
class TestControls:

Examples/dash_controls_template.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/python3
22

3-
import time
43
import argparse
4+
import logging
55
import signal
6+
import time
7+
68
import dashio
7-
import logging
89

910

1011
class TestControls:

Examples/system_monitor.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/bin/python3
2-
import time
32
import argparse
3+
import configparser
4+
import logging
45
import signal
6+
import time
7+
58
import dashio
69
import psutil
710
import shortuuid
8-
import logging
9-
import configparser
11+
1012

1113
def get_network_rx_tx():
1214
data = psutil.net_io_counters()

Examples/test_alarms.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/python3
22

3-
from dashio.iotcontrol.enums import SoundName
4-
import time
53
import argparse
4+
import logging
65
import signal
6+
import time
7+
78
import dashio
8-
import logging
9+
from dashio.iotcontrol.enums import SoundName
910

1011

1112
class TestControls:

Examples/test_map.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/python3
2-
import time
32
import argparse
43
import signal
4+
import time
5+
56
import dashio
67

78
SHUTDOWN = False

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Dashio-Connect
3+
Copyright (c) 2020 DashIO-Connect
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# dashio
22

3-
[Dashio](http://dashio.io) - a python library to connect and display widgets on the IotDashboard app.
3+
[DashIO](http://dashio.io) - a python library to connect and display widgets on the DashIO app.
44

55
## Getting Started
66

@@ -28,11 +28,11 @@ pip3 install dashio
2828

2929
## Guide
3030

31-
This guide covers the dashio python library. For information on the [IoTDashboard](https://dashio.io/dashboard) phone app please visit the website.
31+
This guide covers the dashio python library. For information on the [DashIO](https://dashio.io/dashboard) phone app please visit the website.
3232

3333
### Basics
3434

35-
So what is dashio? It is a quick effortless way to connect your IoT device to your phone. It allows easy setup of controls such as dials, text boxes, maps, graphs, notifications..., from your device. You can define the look and layout of the controls on your phone from your IoT device. There are three methods to connect to your phone tcp, mqtt, dash, and BLE. What's Dash then? Dash is a mqtt server with extra bits added in to allow you to send notifications, share your devices, and save your settings from your phone via the IoTDashboard app.
35+
So what is dashio? It is a quick effortless way to connect your IoT device to your phone. It allows easy setup of controls such as dials, text boxes, maps, graphs, notifications..., from your device. You can define the look and layout of the controls on your phone from your IoT device. There are three methods to connect to your phone tcp, mqtt, dash, and BLE. What's Dash then? Dash is a mqtt server with extra bits added in to allow you to send notifications, share your devices, and save your settings from your phone via the DashIO app.
3636

3737
Show me some code!
3838

@@ -52,9 +52,9 @@ while True:
5252
time.sleep(5)
5353
```
5454

55-
This is about the fewest lines of code to get talking to the app. There is a lot happening under the hood to make this work. After the import we create a device with three attributes. These attributes describe the device to the app and allow you to distinguish one of your devices from another. The next two lines create a TCP connection and then add the device to the connection. The connection will be created with the default setting of port 5000 and will also advertise the service using zeroconf, also known as bonjour. This allows IoTDashboard to find your device. After that we create a dial add it to the device and then every five seconds send a randomly generated dial value to the IoTDashboard app.
55+
This is about the fewest lines of code to get talking to the app. There is a lot happening under the hood to make this work. After the import we create a device with three attributes. These attributes describe the device to the app and allow you to distinguish one of your devices from another. The next two lines create a TCP connection and then add the device to the connection. The connection will be created with the default setting of port 5000 and will also advertise the service using zeroconf, also known as bonjour. This allows the DashIO app to find your device. After that we create a dial add it to the device and then every five seconds send a randomly generated dial value to the DashIO app.
5656

57-
This device is discoverable by the app. It would be nice to have IoTDashboard automagically setup a new DeviceView and place your control on the new DeviceView. To do that we need to add a few more lines of code:
57+
This device is discoverable by the app. It would be nice to have the DashIO app automagically setup a new DeviceView and place your control on the new DeviceView. To do that we need to add a few more lines of code:
5858

5959
```python
6060
import dashio
@@ -78,7 +78,7 @@ while True:
7878

7979
First we altered the instantiation of a Dial by including a control_position. This allows us to place the control at a set location. The added lines instantiated a DeviceView control, which we than added the dial control. Finally we added the dv to the device.
8080

81-
The next piece of the puzzle to consider is how do we get data from the IoTDashboard app? Lets add a Knob and connect it to the Dial:
81+
The next piece of the puzzle to consider is how do we get data from the DashIO app? Lets add a Knob and connect it to the Dial:
8282

8383
```python
8484
import dashio
@@ -107,12 +107,12 @@ while True:
107107
time.sleep(5)
108108
```
109109

110-
First we added a function that sets the dial value. Next we added a Knob control and set our new function to be called when it receives data from the IoTDashboard app.
111-
We also add it to the DeviceView and to the device. Now when the knob in IoTDashoard is moved the dial is set to the same value.
110+
First we added a function that sets the dial value. Next we added a Knob control and set our new function to be called when it receives data from the DashIO app.
111+
We also add it to the DeviceView and to the device. Now when the knob in the DashIO app is moved the dial is set to the same value.
112112

113113
### Controls
114114

115-
Controls are objects that represent actions and widgets in the IoTDashboard application. Controls that are displayed have a ```dashio.ControlPosition``` that is composed of four size and position variables: x_position_ratio, y_position_ratio, width_ratio, height_ratio. The first two are position ratios that place the top left corner of the widget on the DeviceView. The last two are ratios that govern the size of the widget. The ratios are propertional to the size of the screen with the full size of the screen representing 1.0.
115+
Controls are objects that represent actions and widgets in the DashIO application. Controls that are displayed have a ```dashio.ControlPosition``` that is composed of four size and position variables: x_position_ratio, y_position_ratio, width_ratio, height_ratio. The first two are position ratios that place the top left corner of the widget on the DeviceView. The last two are ratios that govern the size of the widget. The ratios are propertional to the size of the screen with the full size of the screen representing 1.0.
116116

117117
#### Alarm
118118

@@ -121,7 +121,7 @@ alarm = dashio.Alarm("alarm1_ID", description="An alarming alarm", sound_name=So
121121
alarm.send("Alarm Header", "Alarm Body")
122122
```
123123

124-
An alarm sends a notification throught the dashio mqtt server to registered phones. The ability to send alarms to specific phones, and the notification sound can be configured through the IoTDasboard app. Alarms are only available if you have an account registered on the dashio server and you send the the alarm through a dash connection.
124+
An alarm sends a notification throught the dashio mqtt server to registered phones. The ability to send alarms to specific phones, and the notification sound can be configured through the DashIO app. Alarms are only available if you have an account registered on the dashio server and you send the the alarm through a dash connection.
125125

126126
#### Button
127127

dashio/bleconnection.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
SOFTWARE.
2020
"""
21+
import json
2122
import logging
2223
import threading
2324
import time
24-
import json
25+
import uuid
26+
2527
import dbus
2628
import dbus.exceptions
2729
import dbus.mainloop.glib
2830
import dbus.service
29-
3031
import shortuuid
31-
import uuid
3232
import zmq
3333
from gi.repository import GLib
3434

dashio/tcpconnection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TCP():
1616
def get_state(self) -> str:
1717
return ""
1818

19-
def get_cfg(self, num_columns):
19+
def get_cfg(self, _):
2020
cfg_str = "\tCFG\t" + self.msg_type + "\t" + json.dumps(self._cfg) + "\n"
2121
return cfg_str
2222

0 commit comments

Comments
 (0)