Compare commits

...

2 Commits

Author SHA1 Message Date
19edece5b4 ip_address editable 2019-06-20 09:01:14 -04:00
ac01fbaad4 new devices added save properly 2019-06-20 09:00:15 -04:00
3 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ class RelayDevice:
"""
def __init__(self):
self.id = ""
self.type = ""
self.type = "RelayDevice"
self.description = ""
self.location = ""
self.ip_address = ""
@ -31,10 +31,8 @@ class RelayDevice:
self.sub_devices.append(RelayOutlet())
self.sub_devices.append(RelayOutlet())
self.sub_devices[0].id = 'GPIO0'
self.sub_devices[0].type = 'RelayOutlet'
self.sub_devices[0].gpio = '0'
self.sub_devices[1].id = 'GPIO2'
self.sub_devices[1].type = 'RelayOutlet'
self.sub_devices[1].gpio = '2'
self.update()
@ -96,7 +94,7 @@ class RelayOutlet:
"""
def __init__(self):
self.id = ""
self.type = ""
self.type = "RelayOutlet"
self.description = ""
self.gpio = ""
self.state = False

View File

@ -6,6 +6,7 @@ body {
.font-awesome {
font-family: FontAwesome;
font-style: normal;
}
nav {
@ -48,6 +49,7 @@ nav span:hover {
.ip_address {
font-size: 0.8em;
font-style: italic;
color: darkgray;
margin: 0.2em;
}

View File

@ -21,7 +21,7 @@
<div class="id">{{ device.id }}</div>
<div class="description"><span class="field_value">{{ device.description }}</span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="location"><span class="field_value">{{ device.location }}</span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="ip_address"><i>{{ device.ip_address }}</i></div>
<div class="ip_address"><span class="field_value"><i>{{ device.ip_address }}</i></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="sub_devices">
{% for sub_dev in device.sub_devices %}
<div class="sub_device {{ sub_dev.type }}" id="{{ sub_dev.id }}">
@ -40,7 +40,7 @@
<div class="id"></div>
<div class="description"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="location"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="ip_address"><i></i></div>
<div class="ip_address"><span class="field_value"></span> <span class="edit font-awesome" onclick="edit_field(this.parentElement)">&#xe800;</span></div>
<div class="sub_devices">
<div class="sub_device RelayOutlet" id="">
<div class="id"></div>