[PR #3] [MERGED] [Junie]: feat: implement daily reconnection strategy with persistence #3

Closed
opened 2025-10-27 18:52:54 +01:00 by OMGeeky · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OMGeeky/homecontrol.esp-sensors/pull/3
Author: @jetbrains-junie[bot]
Created: 6/7/2025
Status: Merged
Merged: 6/7/2025
Merged by: @OMGeeky

Base: mainHead: jetbrains-junie/issue-2-run-75eae3ea-54e4-40a5-bf5b-51361fd684d8


📝 Commits (10+)

  • 1a241e4 refactor: clean up imports in MQTT modules and tests
  • cd7673f feat: implement daily reconnection strategy with persistence
  • e713dde feat: add improvement tasks document for ESP Sensors project
  • 95d54c5 feat: add task to fix socket timeout error in ESP32MQTTClient
  • 1c65e13 fix: resolve socket timeout error in ESP32MQTTClient and update task status
  • 6b8ec73 fix: ensure topic and message are hashable in callback by converting to bytes
  • 7eea051 feat: add configuration for Black code formatter in config.toml
  • e666f7b fix: improve MQTT client connection and publishing error handling
  • 3c72b4f Update src/esp_sensors/mqtt.py
  • e3f3cf0 fix: comment out connection loss assumption in MQTT publish and subscribe methods

📊 Changes

9 files changed (+383 additions, -122 deletions)

View changed files

.junie/config.toml (+21 -0)
📝 docs/mqtt_implementation.md (+59 -1)
docs/tasks.md (+113 -0)
📝 src/esp_sensors/config.py (+15 -2)
📝 src/esp_sensors/mqtt.py (+119 -70)
📝 src/esp_sensors/mqtt_client.py (+6 -8)
📝 src/main.py (+44 -30)
📝 tests/test_mqtt.py (+3 -2)
📝 tests/test_mqtt_client.py (+3 -9)

📄 Description

📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains Early Access Preview

It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them.
We’d love your feedback — join our Discord to share bugs, ideas: here.

📊 Junie Summary

The reconnection strategy was implemented to ensure at least four connection attempts per day while conserving battery life through state persistence in a configuration file.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OMGeeky/homecontrol.esp-sensors/pull/3 **Author:** [@jetbrains-junie[bot]](https://github.com/apps/jetbrains-junie) **Created:** 6/7/2025 **Status:** ✅ Merged **Merged:** 6/7/2025 **Merged by:** [@OMGeeky](https://github.com/OMGeeky) **Base:** `main` ← **Head:** `jetbrains-junie/issue-2-run-75eae3ea-54e4-40a5-bf5b-51361fd684d8` --- ### 📝 Commits (10+) - [`1a241e4`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/1a241e47442a67fa1794a3aaea0bb670eff3cee6) refactor: clean up imports in MQTT modules and tests - [`cd7673f`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/cd7673f78a20f3c7a4bc3c0468eea8575f4ed47f) feat: implement daily reconnection strategy with persistence - [`e713dde`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/e713ddefb7fdc4ca83b7e3aad4f094dffbc0922c) feat: add improvement tasks document for ESP Sensors project - [`95d54c5`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/95d54c5e39c16c47fb90c98e521f5065b772eb21) feat: add task to fix socket timeout error in ESP32MQTTClient - [`1c65e13`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/1c65e13903f7dd314446f1e44f21f8c70ca52b8a) fix: resolve socket timeout error in ESP32MQTTClient and update task status - [`6b8ec73`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/6b8ec730c3d1ee11dd80bbef6eebb21121231bbd) fix: ensure topic and message are hashable in callback by converting to bytes - [`7eea051`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/7eea051d3a3c77ad8c201857ddef92189c4a9138) feat: add configuration for Black code formatter in config.toml - [`e666f7b`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/e666f7b8c82bf864a97887800707db7e2419898c) fix: improve MQTT client connection and publishing error handling - [`3c72b4f`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/3c72b4f39d822455d8c06429dbb72a28c5e7a183) Update src/esp_sensors/mqtt.py - [`e3f3cf0`](https://github.com/OMGeeky/homecontrol.esp-sensors/commit/e3f3cf070d51bc52a14965aecdbdca8c2e45d711) fix: comment out connection loss assumption in MQTT publish and subscribe methods ### 📊 Changes **9 files changed** (+383 additions, -122 deletions) <details> <summary>View changed files</summary> ➕ `.junie/config.toml` (+21 -0) 📝 `docs/mqtt_implementation.md` (+59 -1) ➕ `docs/tasks.md` (+113 -0) 📝 `src/esp_sensors/config.py` (+15 -2) 📝 `src/esp_sensors/mqtt.py` (+119 -70) 📝 `src/esp_sensors/mqtt_client.py` (+6 -8) 📝 `src/main.py` (+44 -30) 📝 `tests/test_mqtt.py` (+3 -2) 📝 `tests/test_mqtt_client.py` (+3 -9) </details> ### 📄 Description ## 📌 Hey! This PR was made for you with Junie, the coding agent by JetBrains **Early Access Preview** It's still learning, developing, and might make mistakes. Please make sure you review the changes before you accept them. We’d love your feedback — join our Discord to share bugs, ideas: [here](https://jb.gg/junie/github). - 🔗 **Issue:** #2 - ⚙️ **Trigger:** Issue - 🏷 **Title:** Battery drain when MQTT-Broker is not reachable ### 📊 Junie Summary The reconnection strategy was implemented to ensure at least four connection attempts per day while conserving battery life through state persistence in a configuration file. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OMGeeky added the
pull-request
label 2025-10-27 18:52:54 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OMGeeky/homecontrol.esp-sensors#3
No description provided.