Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hauptbahnhof
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
stustanet
hauptbahnhof
Commits
ed78085e
Commit
ed78085e
authored
6 years ago
by
Johannes Walcher
Browse files
Options
Downloads
Patches
Plain Diff
minor fixes for deployment
parent
c78bdd21
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hackerman/hackerman.py
+23
-22
23 additions, 22 deletions
hackerman/hackerman.py
rupprecht/rupprecht.py
+6
-6
6 additions, 6 deletions
rupprecht/rupprecht.py
systemd/hauptbahnhof-module@.service
+1
-1
1 addition, 1 deletion
systemd/hauptbahnhof-module@.service
with
30 additions
and
29 deletions
hackerman/hackerman.py
+
23
−
22
View file @
ed78085e
...
@@ -27,28 +27,29 @@ class Hackerman:
...
@@ -27,28 +27,29 @@ class Hackerman:
"""
"""
del
client
del
client
try
:
try
:
if
'
haspa
'
in
message
:
if
message
[
'
haspa
'
]
in
[
'
open
'
,
'
offen
'
,
'
auf
'
]:
if
message
[
'
haspa
'
]
in
[
'
open
'
,
'
offen
'
,
'
auf
'
]:
await
self
.
hbf
.
publish
(
'
/haspa/power
'
,
{
await
self
.
hbf
.
publish
(
'
/haspa/power
'
,
{
'
table
'
:
1023
,
'
table
'
:
1023
,
'
fan
'
:
1023
,
'
fan
'
:
1023
,
'
ledstrip
'
:
400
,
'
ledstrip
'
:
400
,
})
})
await
self
.
hbf
.
publish
(
'
/haspa/music/control
'
,
{
await
self
.
hbf
.
publish
(
'
/haspa/music/control
'
,
{
'
play
'
:
True
'
play
'
:
True
})
})
elif
message
[
'
haspa
'
]
in
[
'
close
'
,
'
zu
'
,
'
closed
'
]:
elif
message
[
'
haspa
'
]
in
[
'
close
'
,
'
zu
'
,
'
closed
'
]:
await
self
.
hbf
.
publish
(
'
/haspa/power
'
,
{
await
self
.
hbf
.
publish
(
'
/haspa/power
'
,
{
'
table
'
:
0
,
'
table
'
:
0
,
'
fan
'
:
0
,
'
fan
'
:
0
,
'
ledstrip
'
:
0
,
'
ledstrip
'
:
0
,
'
alarm
'
:
0
,
'
alarm
'
:
0
,
})
})
await
self
.
hbf
.
publish
(
'
/haspa/music/control
'
,
{
await
self
.
hbf
.
publish
(
'
/haspa/music/control
'
,
{
'
play
'
:
False
'
play
'
:
False
})
})
else
:
print
(
"
Haspa state undetermined:
"
,
message
[
'
haspa
'
])
except
KeyError
:
except
KeyError
:
raise
# because - fuck you sender! i will die now, silently.
print
(
"
/haspa/status message malformed:
"
,
message
)
async
def
command_action
(
self
,
client
,
message
,
_
):
async
def
command_action
(
self
,
client
,
message
,
_
):
"""
Handle actions like alarm or party
"""
"""
Handle actions like alarm or party
"""
...
@@ -68,7 +69,7 @@ class Hackerman:
...
@@ -68,7 +69,7 @@ class Hackerman:
delay
=
0.05
delay
=
0.05
sounds
=
[
sounds
=
[
(
'
56
'
,
3.5
),
# führer
#
('56', 3.5), # führer
(
'
97
'
,
4.7
),
# sonnenschein
(
'
97
'
,
4.7
),
# sonnenschein
(
'
63
'
,
5
),
#epische musik
(
'
63
'
,
5
),
#epische musik
(
'
110
'
,
3.7
),
#dota
(
'
110
'
,
3.7
),
#dota
...
...
This diff is collapsed.
Click to expand it.
rupprecht/rupprecht.py
+
6
−
6
View file @
ed78085e
...
@@ -58,21 +58,21 @@ class Rupprecht:
...
@@ -58,21 +58,21 @@ class Rupprecht:
for
devid
,
value
in
msg
.
items
():
for
devid
,
value
in
msg
.
items
():
try
:
try
:
if
value
==
0
:
if
value
==
0
:
self
.
imposed_ids
[
devid
].
off
()
await
self
.
imposed_ids
[
devid
].
off
()
elif
value
==
1023
:
elif
value
==
1023
:
self
.
imposed_ids
[
devid
].
on
()
await
self
.
imposed_ids
[
devid
].
on
()
except
KeyError
:
except
KeyError
:
pass
pass
async
def
button_message
(
self
,
msg
):
async
def
button_message
(
self
,
msg
):
if
msg
[
'
open
'
]
and
not
self
.
space_is_open
:
if
msg
[
'
open
'
]
and
not
self
.
space_is_open
:
self
.
space_is_open
=
True
self
.
space_is_open
=
True
await
self
.
hbf
.
publish
(
'
/haspa/status
'
,
json
.
dumps
(
{
'
haspa
'
:
'
open
'
})
)
await
self
.
hbf
.
publish
(
'
/haspa/status
'
,
{
'
haspa
'
:
'
open
'
})
self
.
rupprecht
.
text
(
"
Status:
Open
"
)
self
.
rupprecht
.
text
(
"
Status:Open
... StuStaNet.e.V....
"
)
elif
not
msg
[
'
open
'
]
and
self
.
space_is_open
:
elif
not
msg
[
'
open
'
]
and
self
.
space_is_open
:
self
.
space_is_open
=
False
self
.
space_is_open
=
False
await
self
.
hbf
.
publish
(
'
/haspa/status
'
,
json
.
dumps
(
{
'
haspa
'
:
'
closed
'
})
)
await
self
.
hbf
.
publish
(
'
/haspa/status
'
,
{
'
haspa
'
:
'
closed
'
})
self
.
rupprecht
.
text
(
"
Status:
Closed
"
)
self
.
rupprecht
.
text
(
"
Status:Closed
... StuStaNet.e.V....
"
)
class
RupprechtInterface
:
class
RupprechtInterface
:
class
SerialProtocol
(
asyncio
.
Protocol
):
class
SerialProtocol
(
asyncio
.
Protocol
):
...
...
This diff is collapsed.
Click to expand it.
systemd/hauptbahnhof-module@.service
+
1
−
1
View file @
ed78085e
...
@@ -5,7 +5,7 @@ Before=hauptbahnhof.service
...
@@ -5,7 +5,7 @@ Before=hauptbahnhof.service
[Service]
[Service]
Type
=
simple
Type
=
simple
User
=
johannes
User
=
hauptbahnhof
WorkingDirectory
=
/usr/local/bin/hauptbahnhof
WorkingDirectory
=
/usr/local/bin/hauptbahnhof
ExecStart
=
/usr/local/bin/hauptbahnhof/venv/bin/python3 -m %i
ExecStart
=
/usr/local/bin/hauptbahnhof/venv/bin/python3 -m %i
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment