Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: k4cg/Rezeptionistin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 73e7d25a26e3
Choose a base ref
...
head repository: k4cg/Rezeptionistin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d2f61a2205b1
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Sep 21, 2017

  1. fix

    noqqe committed Sep 21, 2017
    Copy the full SHA
    30eb0d1 View commit details
  2. New Door status

    noqqe committed Sep 21, 2017
    Copy the full SHA
    c07e704 View commit details

Commits on Nov 2, 2017

  1. adjust max value of sound

    noqqe committed Nov 2, 2017
    Copy the full SHA
    d2f61a2 View commit details
Showing with 20 additions and 13 deletions.
  1. +10 −8 language.ini
  2. +9 −4 plugins/open.py
  3. +1 −1 plugins/status.py
18 changes: 10 additions & 8 deletions language.ini
Original file line number Diff line number Diff line change
@@ -39,8 +39,9 @@ nickserv_help = Mich beim freenode NickServ authentifizieren.

# open.py - Open Status Plugin
open_help = !offen - Aktuelle Geraete in der K4CG anzeigen lassen
open_str1 = Wahrscheinlich. Momentan sind {d} Geraete in der K4CG
open_str2 = Sorry, sieht nicht so aus als waere jemand in der K4CG
open_str1 = Jawoll! Momentan sind {d} Geraete im Wifi und die Tuer ist {door}.
open_str2 = Vielleicht. Momentan sind {d} Geraete im Wifi und die Tuer ist {door}.
open_str3 = Nope. {d} Geraete im Wifi und die Tuer ist {door}.

# status.py - Open Status Plugin
status_help = !status - Zeigt Uebersicht fuer (fast) alle Sensoren
@@ -76,8 +77,8 @@ light_error = Konnte status.json nicht von der Heimat abholen.

# sound.py
sound_help = !geraeusche - Zeige aktuellen Geraeuschpegel in der K4CG
sound_str1 = Momentane Geraeuschintensitaet: {sound}/3300
sound_str2 = Totale stille in der CG. {sound}/3300
sound_str1 = Momentane Geraeuschintensitaet: {sound}/4095
sound_str2 = Totale stille in der CG. {sound}/4095
sound_error = Konnte status.json nicht von der Heimat abholen.

[en]
@@ -121,8 +122,9 @@ nickserv_help = Authenticate to freenode NickServ.
# open.py - Open Status Plugin
open_help = !open - Current connected devices at K4CG
open_str1 = Probably. Currently there are {d} devices at K4CG
open_str2 = Sorry, it doesn't look like there is anyone at K4CG at the moment
open_str1 = Yep. Currently there are {d} devices in wifi and door is {door}.
open_str2 = Maybe. Currently there are {d} devices and door is {door}.
open_str3 = Nope. {d} devices and door is {door}.
# status.py - Open Status Plugin
status_help = !status - Shows overview for (nearly) all sensors
@@ -159,6 +161,6 @@ licht_help = !licht - Show current UV Light at the hackerspace
# sound.py
sound_help = !geraeusche - Show current noise in the hackerspace
sound_str1 = Current noise: {sound}/3300
sound_str2 = SILENCE in CG. {sound}/3300
sound_str1 = Current noise: {sound}/4095
sound_str2 = SILENCE in CG. {sound}/4095
sound_error = Could not fetch data.
13 changes: 9 additions & 4 deletions plugins/open.py
Original file line number Diff line number Diff line change
@@ -14,9 +14,14 @@ def help_text(self, bot):
def on_msg(self, bot, user_nick, host, channel, message):
if message.startswith("!offen") or message.startswith("!open"):
msg = bot.get_spacestatus_data()
f = msg['online']
wifi = msg['online']
door = str(msg['hservierer']['door'])

if int(f) > 0:
bot.send_message(channel, bot.translate("open_str1").format(d=f), user_nick)
if int(wifi) > 0 and door == 'open':
bot.send_message(channel, bot.translate("open_str1").format(d=wifi,door=door), user_nick)
elif int(wifi) > 0 and door == 'closed':
bot.send_message(channel, bot.translate("open_str2").format(d=wifi,door=door), user_nick)
elif int(wifi) == 0 and door == 'open':
bot.send_message(channel, bot.translate("open_str2").format(d=wifi,door=door), user_nick)
else:
bot.send_message(channel, bot.translate("open_str2").format(d=f), user_nick)
bot.send_message(channel, bot.translate("open_str3").format(d=wifi,door=door), user_nick)
2 changes: 1 addition & 1 deletion plugins/status.py
Original file line number Diff line number Diff line change
@@ -23,4 +23,4 @@ def on_msg(self, bot, user_nick, host, channel, message):
hosts = str(msg['online'])
door = str(msg['hservierer']['door'])

bot.send_message(channel, bot.translate("status_str1").format(noise=noise, temp=temp, light=light, hosts=hosts), user_nick)
bot.send_message(channel, bot.translate("status_str1").format(noise=noise, temp=temp, light=light, hosts=hosts, door=door), user_nick)