Skip to content

Commit

Permalink
style: fix pylint finding
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobLichterfeld committed Mar 20, 2024
1 parent b669483 commit 9fe5612
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/teslamte_telegram_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def setup_mqtt_client():
host = get_env_variable(MQTT_BROKER_HOST, MQTT_BROKER_HOST_DEFAULT)
port = get_env_variable(MQTT_BROKER_PORT, MQTT_BROKER_PORT_DEFAULT)
if not port.isnumeric() or int(port) < 1:
logging.error("Error: Please set the environment variable %s to a valid number and try again.", MQTT_BROKER_PORT)
logging.error("Error: Please set the environment variable %s to a valid number and try again.",
MQTT_BROKER_PORT)
sys.exit(1)
logging.info("Connect to MQTT broker at %s:%s", host, port)
client.connect(host, port, MQTT_BROKER_KEEPALIVE)
Expand All @@ -145,7 +146,8 @@ def setup_telegram_bot():
bot = Bot(get_env_variable(TELEGRAM_BOT_API_KEY))
chat_id = get_env_variable(TELEGRAM_BOT_CHAT_ID)
if not chat_id.isnumeric() or int(chat_id) < 1:
logging.error("Error: Please set the environment variable %s to a valid number and try again.", TELEGRAM_BOT_CHAT_ID)
logging.error("Error: Please set the environment variable %s to a valid number and try again.",
TELEGRAM_BOT_CHAT_ID)
sys.exit(1)

logging.info("Connected to Telegram bot successfully.")
Expand Down

0 comments on commit 9fe5612

Please sign in to comment.