-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
base: main
Are you sure you want to change the base?
Conversation
- committed - ... - adapted the refresh actions - removed locales from watch - removed locales - remove Preferences - adding screenshots - intial commit
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. |
There was a problem hiding this 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 forInverterInfoResponse, 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
, ensureStateOfCharge_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
There was a problem hiding this 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
andCHANGELOG.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 inpackage.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`; |
There was a problem hiding this comment.
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
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: "🔋" }, |
There was a problem hiding this comment.
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 ? ( |
There was a problem hiding this comment.
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
{!inverterItems.length && !systemOverview && !isLoading ? ( | |
{!isLoading && (!inverterItems.length || !systemOverview) ? ( |
{ 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, |
There was a problem hiding this comment.
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
{inverterListItems.map((item, idx) => ( | ||
<MenuBarExtra.Item key={idx} title={item.title} subtitle={item.subtitle} /> | ||
))} |
There was a problem hiding this comment.
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
{systemItems.map((item, idx) => ( | ||
<MenuBarExtra.Item key={idx} title={`${item.emoji} ${item.label}`} subtitle={item.value} /> | ||
))} |
There was a problem hiding this comment.
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>
Description
Screencast
Checklist
npm run build
and tested this distribution build in Raycastassets
folder are used by the extension itselfREADME
are placed outside of themetadata
folder