Reset sensor data to None on communication failures#2
Conversation
Co-authored-by: yutaka551 <1833002+yutaka551@users.noreply.github.com>
Co-authored-by: yutaka551 <1833002+yutaka551@users.noreply.github.com>
|
@copilot コンフリクト直して |
There was a problem hiding this comment.
Pull request overview
This PR improves error handling in the LYWSD03MMC sensor plugin by ensuring sensor data is explicitly reset to None when any communication or data acquisition failure occurs, preventing stale values from being displayed as current data.
Changes:
- Added
_reset_sensor_data()helper method to centralize the logic for resetting sensor values toNone - Updated all exception handlers in
_read_sensor()to call the reset method, ensuring failures clear stale data
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
コンフリクトを解決しました。ベースブランチ (copilot/add-lywsd03mmc-data-to-plotly) のプラグイン名変更 (octoprint_lywsd03mmc → octoprint_plotly_graph_lywsd03mmc) に対してリベースを完了しました。 変更内容:
ただし、履歴が分岐しているため、force pushが必要です。手動でforce pushしていただくか、もしくはこちらで再度pushを試みることができます。 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot あなたがforce pushして。 |
…ctions - Changed plugin_identifier from "lywsd03mmc" to "plotly_graph_lywsd03mmc" for clearer purpose indication - Changed plugin_package from "octoprint_lywsd03mmc" to "octoprint_plotly_graph_lywsd03mmc" - Renamed package folder accordingly - Updated all template data-bind references to use new plugin identifier - Renamed template file to match new identifier - Updated MANIFEST.in with new package name - Updated __init__.py plugin name and update information key - Added explicit PlotlyTempGraph installation instructions to README.md Co-authored-by: yutaka551 <1833002+yutaka551@users.noreply.github.com>
Task: Reset sensor data to None on communication failure
_read_sensormethodoctoprint_plotly_graph_lywsd03mmc)_reset_sensor_data()helper method to centralize reset logicSummary
Successfully resolved the merge conflict. The base branch renamed the plugin from
octoprint_lywsd03mmctooctoprint_plotly_graph_lywsd03mmc. All sensor data reset changes have been reapplied to the renamed directory structure.Changes Made
_reset_sensor_data()helper method - Centralized the logic for resetting sensor data toNone_reset_sensor_data()when sensor connection fails_reset_sensor_data()when reading sensor data fails_reset_sensor_data()when the lywsd03mmc library is not installedOriginal prompt
This pull request was created from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.