Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoTSmartMeter
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kristian.tan
IoTSmartMeter
Commits
100f617f
Commit
100f617f
authored
Nov 12, 2019
by
Kristian Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Added css file"
This reverts commit
cb396c02
.
parent
4aa63d3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
app.py
app.py
+5
-2
main.css
static/main.css
+0
-3
main.html
templates/main.html
+2
-3
No files found.
app.py
View file @
100f617f
...
...
@@ -34,6 +34,8 @@ def main():
def
action
(
change_pin
):
change_pin
=
int
(
change_pin
)
device_name
=
pins
[
change_pin
][
'name'
]
print
(
"Input value before change: "
+
str
(
GPIO
.
input
(
change_pin
)))
# if action == "on":
# GPIO.output(change_pin, GPIO.HIGH)
# message = "Turned " + device_name + " on."
...
...
@@ -45,12 +47,13 @@ def action(change_pin):
message
=
"Turned "
+
device_name
if
GPIO
.
input
(
change_pin
)
==
0
:
message
+=
"
off."
message
+=
"off."
else
:
message
+=
"
on."
message
+=
"on."
for
pin
in
pins
:
pins
[
pin
][
'state'
]
=
GPIO
.
input
(
pin
)
print
(
"Input value after change: "
+
str
(
GPIO
.
input
(
change_pin
)))
template_data
=
{
'message'
:
message
,
...
...
static/main.css
deleted
100644 → 0
View file @
4aa63d3c
body
{
background-color
:
aqua
;
}
\ No newline at end of file
templates/main.html
View file @
100f617f
<!DOCTYPE html>
<head>
<title>
Lighting control
&
Smart meter
</title>
<link
rel=
"stylesheet"
href=
"{{ url_for('static', filename='/main.css') }}"
>
<title>
Current Status
</title>
</head>
<body>
<h1>
Attached device
s
</h1>
<h1>
Device Listing and Statu
s
</h1>
{% for pin in pins %}
<p>
The {{ pins[pin].name }}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment