Skip to content

1.1.5#213

Open
jneilliii wants to merge 16 commits intomasterfrom
rc
Open

1.1.5#213
jneilliii wants to merge 16 commits intomasterfrom
rc

Conversation

@jneilliii
Copy link
Copy Markdown
Owner

@jneilliii jneilliii marked this pull request as ready for review September 1, 2025 04:29
@jneilliii jneilliii marked this pull request as draft September 1, 2025 04:36
@jneilliii jneilliii marked this pull request as ready for review September 1, 2025 06:06
@jneilliii jneilliii requested a review from Copilot September 1, 2025 06:10

This comment was marked as outdated.

jneilliii and others added 2 commits September 1, 2025 02:29
@jneilliii jneilliii requested a review from Copilot September 1, 2025 06:37

This comment was marked as outdated.

jneilliii and others added 4 commits September 1, 2025 02:39
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jneilliii jneilliii requested a review from Copilot September 1, 2025 06:43

This comment was marked as outdated.

Repository owner deleted a comment from Copilot AI Sep 1, 2025
jneilliii and others added 2 commits September 1, 2025 02:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jneilliii jneilliii requested a review from Copilot September 1, 2025 06:51

This comment was marked as outdated.

@jneilliii jneilliii requested a review from Copilot September 1, 2025 07:03
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR bumps the plugin version to 1.1.5 and implements several key enhancements to the Tasmota plugin's graphing functionality.

  • Updates plotly.js to version 3.1.0 for improved graph rendering
  • Adds visual feedback during API requests with a spinning indicator on the Update button
  • Implements theme support for graphs to match OctoPrint's UI themes
  • Restructures graphing to use separate subplots for different data types
  • Adds API protection callback for compatibility with newer OctoPrint versions

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

File Description
setup.py Version bump from 1.1.4 to 1.1.5
tasmota_tab.jinja2 Adds spinner icon and processing state to Update button
tasmota.js Major refactor of graph layout with theme support and subplot organization
init.py Adds is_api_protected method for OctoPrint compatibility

Comment on lines +385 to +386
}).fail(function(){
self.processing_api_request(false);
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fail callback should handle errors more gracefully. Consider logging the error or providing user feedback about the failed request.

Suggested change
}).fail(function(){
self.processing_api_request(false);
}).fail(function(jqXHR, textStatus, errorThrown){
self.processing_api_request(false);
console.error("Failed to fetch energy data:", textStatus, errorThrown, jqXHR);
alert("Failed to fetch energy data. Please check your connection or try again later.");

Copilot uses AI. Check for mistakes.
traces.push(trace_cost);
break;
default:
console.log('unknown energy data column ' + data.energy_data[i])
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log statement will output the entire array instead of the column index. It should be console.log('unknown energy data column ' + j) to show the problematic column index.

Copilot uses AI. Check for mistakes.
trace['yaxis'] = (data.energy_data.length > 0) ? 'y6' : 'y2';
break;
default:
console.log('unknown sensor data column ' + data.sensor_data[i])
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This console.log statement will output the entire array instead of the column index. It should be console.log('unknown sensor data column ' + j) to show the problematic column index.

Suggested change
console.log('unknown sensor data column ' + data.sensor_data[i])
console.log('unknown sensor data column ' + j)

Copilot uses AI. Check for mistakes.
Comment on lines +237 to +240
var inherited_bg_color = self.getInheritedBackgroundColor(document.getElementById('tab_plugin_tasmota'));
var background_color = (inherited_bg_color == 'rgba(0, 0, 0, 0)') ? '#FFFFFF' : inherited_bg_color;
var color_val = $('#tab_plugin_tasmota').css('color');
var foreground_color = (!color_val || color_val === 'inherit' || color_val === 'transparent') ? '#000000' : color_val;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The theme color detection logic is duplicated and could be extracted into a separate function for better maintainability and reusability.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants