Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fronius-inverter extension #17148

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Olli0103
Copy link

@Olli0103 Olli0103 commented Feb 18, 2025

Description

Screencast

Checklist

- committed
- ...
- adapted the refresh actions
- removed locales from watch
- removed locales
- remove Preferences
- adding screenshots
- intial commit
@raycastbot raycastbot added the new extension Label for PRs with new extensions label Feb 18, 2025
@raycastbot
Copy link
Collaborator

Congratulations on your new Raycast extension! 🚀

Due to our current reduced availability, the initial review may take up to 10-15 business days

Once the PR is approved and merged, the extension will be available on our Store.

@pernielsentikaer pernielsentikaer self-assigned this Feb 18, 2025
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds a comprehensive Fronius Inverter extension for Raycast, providing real-time monitoring of Gen24 inverters through a unified dashboard and menu bar watch functionality.

  • In src/api.ts, move the _fetch variable declaration after the import statement for better code organization
  • In src/watch.tsx, remove unused commented import for InverterInfoResponse, PowerFlowRealtimeDataResponse
  • In src/dashboard.tsx, consider adding error handling for JSON parsing in the data loading functions
  • Consider adding a language preference in package.json to support the localization features mentioned in the README
  • In src/types.ts, ensure StateOfCharge_Relative is marked as optional since it's conditionally accessed in the code

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

11 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR continues to refine the Fronius Inverter extension, focusing on documentation accuracy and feature alignment.

  • Removed localization references from README.md and CHANGELOG.md to match actual implementation
  • Updated auto-refresh documentation in README.md to clarify manual refresh functionality
  • Downgraded @raycast/api to ^1.85.2 and updated React dependencies to ^18.3.1 in package.json
  • Improved code organization in src/api.ts with proper import ordering
  • Removed unused imports in src/watch.tsx for cleaner code

6 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

const _fetch = typeof fetch !== "undefined" ? fetch : require("node-fetch");

export async function fetchInverterInfo(baseUrl: string): Promise<InverterInfoResponse> {
const url = `${baseUrl}/solar_api/v1/GetInverterInfo.cgi`;
Copy link

Choose a reason for hiding this comment

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

logic: Check that baseUrl doesn't end with a trailing slash to prevent double-slash in final URL

Suggested change
const url = `${baseUrl}/solar_api/v1/GetInverterInfo.cgi`;
const url = `${baseUrl.replace(/\/$/, '')}/solar_api/v1/GetInverterInfo.cgi`;

{ label: "PV Power", value: formatPower(systemOverview.P_PV), emoji: "🌞" },
{ label: "Load Power", value: formatPower(systemOverview.P_Load), emoji: "🔌" },
{ label: "Grid Power", value: formatPower(systemOverview.P_Grid), emoji: "⚡" },
{ label: "Battery Power", value: formatPower(systemOverview.P_Akku), emoji: "🔋" },
Copy link

Choose a reason for hiding this comment

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

style: Battery Power and Battery Charge both use the same emoji '🔋', which may be confusing for users. Consider using a different emoji for one of them

<List.Item key={idx} title={`${item.emoji} ${item.label}`} accessories={[{ text: item.value }]} />
))}
</List.Section>
{!inverterItems.length && !systemOverview && !isLoading ? (
Copy link

Choose a reason for hiding this comment

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

style: Empty state check could be simplified to '!isLoading && (!inverterItems.length || !systemOverview)' to show empty state when either data source fails

Suggested change
{!inverterItems.length && !systemOverview && !isLoading ? (
{!isLoading && (!inverterItems.length || !systemOverview) ? (

Comment on lines +136 to +143
{ label: "Total Energy", value: convertWhToKwh(systemOverview.E_Total), emoji: "🔋" },
{ label: "PV Power", value: formatPower(systemOverview.P_PV), emoji: "🌞" },
{ label: "Load Power", value: formatPower(systemOverview.P_Load), emoji: "🔌" },
{ label: "Grid Power", value: formatPower(systemOverview.P_Grid), emoji: "⚡" },
{ label: "Battery Power", value: formatPower(systemOverview.P_Akku), emoji: "🔋" },
systemOverview.BatterySOC !== null
? { label: "Battery Charge", value: formatPercentage(systemOverview.BatterySOC), emoji: "🔋" }
: null,
Copy link

Choose a reason for hiding this comment

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

style: Battery emoji 🔋 is used three times for different metrics - consider using distinct emojis for clarity

Comment on lines +156 to +158
{inverterListItems.map((item, idx) => (
<MenuBarExtra.Item key={idx} title={item.title} subtitle={item.subtitle} />
))}
Copy link

Choose a reason for hiding this comment

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

style: Using array index as key prop may cause issues with list item updates - consider using inv.id

Comment on lines +161 to +163
{systemItems.map((item, idx) => (
<MenuBarExtra.Item key={idx} title={`${item.emoji} ${item.label}`} subtitle={item.value} />
))}
Copy link

Choose a reason for hiding this comment

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

style: Using array index as key prop may cause issues with list item updates - consider using item.label

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new extension Label for PRs with new extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants