Skip to content

Commit

Permalink
fix: remove double bot message
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobLichterfeld committed Mar 16, 2024
1 parent d0212a0 commit 8c208a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

### Bug Fixes

- fix: remove double bot message

## [0.6.1] - 2023-03-15

### New Features
Expand Down
2 changes: 1 addition & 1 deletion src/teslamte_telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def on_connect(client, userdata, flags, reason_code):
def on_message(client, userdata, msg):
""" The callback for when a PUBLISH message is received from the server."""
print(msg.topic+" "+str(msg.payload))

if msg.payload.decode() == "true":
print("A new SW update for your Tesla is available!")
bot.send_message(
Expand All @@ -71,7 +72,6 @@ def on_message(client, userdata, msg):
text="<b>"+"SW Update"+"</b>\n"+"A new SW update for your Tesla is available!",
parse_mode=ParseMode.HTML,
)
bot.send_message(chat_id=chat_id, text=msg.payload.decode("utf-8"), parse_mode=ParseMode.HTML)

def setup_mqtt_client():
""" Setup the MQTT client """
Expand Down

0 comments on commit 8c208a0

Please sign in to comment.