split models and db from init

Move models into their own file
Move db functions into their own file
Update tests
This commit is contained in:
Brian Martin 2019-06-19 09:29:45 -04:00
parent 76528d1500
commit 58b3567887
11 changed files with 1064 additions and 981 deletions

View file

@ -103,17 +103,19 @@ class MQTTHelperBot:
)
elif str(message.topic).split("/")[1] == "atr":
# Broadcast message received on atr
helperbotlog.debug(
"Received Broadcast - Topic: {} - Message: {}".format(
message.topic, str(message.data.decode("utf-8"))
)
)
if str(message.topic).split("/")[2] == "errors":
boterrorlog.error(
"Received Error - Topic: {} - Message: {}".format(
message.topic, str(message.data.decode("utf-8"))
)
)
else:
helperbotlog.debug(
"Received Broadcast - Topic: {} - Message: {}".format(
message.topic, str(message.data.decode("utf-8"))
)
)
else:
helperbotlog.debug(
"Received Message - Topic: {} - Message: {}".format(