From a3d8a3543dabdbce4d9f4dcb962062aeb37dc08c Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 30 Jun 2021 19:42:27 +0200 Subject: [PATCH] patches --- bot/commands/status.py | 14 +++++++------- clock/hardware/sensors.py | 2 +- launcher.py | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/bot/commands/status.py b/bot/commands/status.py index 44e2875..2f2780e 100644 --- a/bot/commands/status.py +++ b/bot/commands/status.py @@ -55,20 +55,20 @@ class Status(BotFunc): message += "Status: Running 🟢\n" message += "Uptime: `" + delta[:delta.rfind(".")] + "`\n" - message += "Reboots: `" + str(self.persistence["global"]["reboots"]) + "`\n" + # message += "Reboots: `" + str(self.persistence["global"]["reboots"]) + "`\n" message += "IP (public): `" + ip + "`\n" message += "IP (private): `" + str(local_ips) + "`\n" u = str(self.get_ngrok_url()) message += "URL: [" + u + "](" + u + ")\n" - tot_r = np.array(self.persistence["bot"]["receive_activity"]["count"]).sum() - message += "Total messages read: `" + str(tot_r) + "`\n" + tot_r = self.db.chats.select().where(self.db.chats.read == True).count() + message += "Total messages read: `{}`\n".format(tot_r) - tot_s = np.array(self.persistence["bot"]["send_activity"]["count"]).sum() - message += "Total messages sent: `" + str(tot_s) + "`\n" + tot_s = self.db.chats.select().where(self.db.chats.send == True).count() + message += "Total messages sent: `{}`\n".format(tot_s) - tot_e = np.array(self.persistence["bot"]["execute_activity"]["count"]).sum() - message += "Commands executed `" + str(tot_e) + "`\n" + tot_e = self.db.chats.select().where(self.db.chats.execute == True).count() + message += "Total commands executed: `{}`\n".format(tot_e) if update.message: update.message.reply_text(message, reply_markup=reply_markup, parse_mode=ParseMode.MARKDOWN) diff --git a/clock/hardware/sensors.py b/clock/hardware/sensors.py index 2c53616..5a0a46a 100644 --- a/clock/hardware/sensors.py +++ b/clock/hardware/sensors.py @@ -59,7 +59,7 @@ class HumidityModule(SensorModule): Returns: humidity""" def __init__(self): super().__init__() - self.device = self.device = dht11 + self.device = dht11 def readout(self): try: diff --git a/launcher.py b/launcher.py index 0ba730a..fe3f6b2 100644 --- a/launcher.py +++ b/launcher.py @@ -1,3 +1,5 @@ +import logging + from persistence import p_io, p_out