Skip to content

Add MQTT support and improve localization for Temperature ETA plugin - #126

Merged
Ajimaru merged 1 commit into
devfrom
feat/mqtt-shared-tab
Nov 30, 2026
Merged

Ajimaru merged 1 commit into
devfrom
feat/mqtt-shared-tab

Conversation

@Ajimaru

@Ajimaru Ajimaru commented Nov 30, 2026

Copy link
Copy Markdown
Owner
  • What does this change do?

This pull request introduces a major refactor of the MQTT settings and publishing logic for the TempETA plugin, focusing on improving consistency, usability, and compatibility with Home Assistant. The changes unify the MQTT topic structure, migrate settings to a new format, enhance Home Assistant integration, and update the codebase to use a shared MQTT settings module. The documentation and translation infrastructure are also updated to reflect these improvements.

MQTT Settings and Topic Structure Refactor:

  • Replaces the previous "use appearance name"/"custom identifier" options with a unified "instance name" and "append instance" switch, ensuring unique and predictable MQTT topics across installations. The settings migration preserves backward compatibility and entity IDs. [1] [2] [3] [4]
  • Updates the MQTT publisher initialization and configuration to use the new instance name logic, and ensures proper shutdown handling to mark the instance offline on the broker. [1] [2] [3]
  • Removes legacy code for tracking MQTT identity and synchronizing Home Assistant discovery topics, as this is now handled by the new logic and the shared MQTT module. [1] [2]

Home Assistant and Documentation Improvements:

  • Enhances Home Assistant integration: discovery topics and device availability now reflect the new topic structure and instance naming, and the documentation is updated for clarity and accuracy. [1] [2] [3]
  • Updates the README to document the new MQTT settings, Home Assistant behavior, and topic structure, and clarifies the relationship with the OctoPrint-MQTT plugin. [1] [2] [3]

Shared Code and Asset Management:

  • Switches to using the shared temp_eta-mqtt.js module for the MQTT settings tab, ensuring consistency with related plugins and excluding it from formatting to maintain byte-identical copies. [1] [2]

Translation and Extraction Support:

  • Updates the babel.cfg configuration to extract translation strings from the shared MQTT module, ensuring all status texts are translatable.

Plugin Lifecycle and API Enhancements:

  • Implements the ShutdownPlugin interface to ensure proper cleanup and status updates on shutdown, and exposes improved MQTT status information via the API. [1] [2] [3]

Checklist

  • Public-facing text is in English
  • Tests pass (pytest)
  • Lint/formatting passes (pre-commit run --all-files)
  • Docs updated (if needed)
  • Workflow changes (if any) keep least-privilege permissions: and avoid pull_request_target unless strictly necessary

- Introduced new messages for MQTT-related functionality, including entity announcements and discovery settings.
- Enhanced existing translations for clarity and consistency across various settings.
- Updated the user interface to reflect changes in MQTT configuration options and added new messages for real-time status updates.
- Improved overall localization by adding missing translations and refining existing ones for better user experience.
@Ajimaru Ajimaru self-assigned this Nov 30, 2026
@coderabbitai

coderabbitai Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c5639e0-6368-4131-88ee-54bb45d49596

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@Ajimaru

Ajimaru commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner Author

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 2 critical · 20 high · 10 medium · 1 minor

Alerts:
⚠ 33 issues (≤ 0 issues of at least minor severity)

Results:
33 new issues

Category Results
Compatibility 7 medium
3 high
BestPractice 2 medium
ErrorProne 2 critical
11 high
Performance 1 medium
Security 6 high
CodeStyle 1 minor

View in Codacy

🟢 Metrics 250 complexity · 0 duplication

Metric Results
Complexity 250
Duplication 0

View in Codacy

🔴 Coverage 95.91% diff coverage · -1.07% coverage variation

Metric Results
Coverage variation ❌ -1.07% coverage variation (-1.00%)
Diff coverage ✅ 95.91% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ab2579a) 1500 1434 95.60%
Head commit (684502a) 1847 (+347) 1746 (+312) 94.53% (-1.07%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#126) 489 469 95.91%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@codecov

codecov Bot commented Nov 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.25153% with 33 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
octoprint_temp_eta/mqttcore.py 93.42% 13 Missing and 10 partials ⚠️
octoprint_temp_eta/__init__.py 87.50% 4 Missing and 2 partials ⚠️
octoprint_temp_eta/mqtt_publisher.py 95.60% 3 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Ajimaru
Ajimaru merged commit 81cce60 into dev Nov 30, 2026
20 of 22 checks passed
@Ajimaru
Ajimaru deleted the feat/mqtt-shared-tab branch November 30, 2026 11:27
@Ajimaru Ajimaru added the enhancement New feature or request label Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant