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

Feature: Spoolman Widget #3959

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

Feature: Spoolman Widget #3959

wants to merge 11 commits into from

Conversation

fgeck
Copy link

@fgeck fgeck commented Sep 8, 2024

Proposed change

Adds a Spoolman widget. Each spool will be rendered into a dedicated <Block> showing the filament name and remaining filament in %.

Widget:

image

Spoolman:

image

Closes #3958

Type of change

  • New service widget

Checklist:

@shamoon

This comment was marked as resolved.

@shamoon shamoon closed this Sep 8, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2024
@shamoon shamoon reopened this Nov 20, 2024
@gethomepage gethomepage unlocked this conversation Nov 20, 2024
@shamoon shamoon changed the title Add Spoolman Widget Feature: Spoolman Widget Nov 20, 2024
Copy link
Collaborator

@shamoon shamoon left a comment

Choose a reason for hiding this comment

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

Works great. A couple things, and this needs a re-base.

Screenshot 2024-11-20 at 6 58 32 AM

Comment on lines 7 to 9

Keep track of your inventory of 3D-printer filament spools.
Spoolman is a self-hosted web service designed to help you efficiently manage your 3D printer filament spools and monitor their usage. It acts as a centralized database that seamlessly integrates with popular 3D printing software like OctoPrint and Klipper/Moonraker. When connected, it automatically updates spool weights as printing progresses, giving you real-time insights into filament usage.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Keep track of your inventory of 3D-printer filament spools.
Spoolman is a self-hosted web service designed to help you efficiently manage your 3D printer filament spools and monitor their usage. It acts as a centralized database that seamlessly integrates with popular 3D printing software like OctoPrint and Klipper/Moonraker. When connected, it automatically updates spool weights as printing progresses, giving you real-time insights into filament usage.

if (spoolData.error || spoolData.message) {
return <Container service={service} error={spoolData?.error ?? spoolData} />;
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (spoolData.length === 0) {
return (
<Container service={service}>
<Block label="spoolman.noSpools" />
</Container>
);
}
if (spoolData.length > 4) spoolData = spoolData.slice(0, 4);
  1. I would handle the no spools case (need to add entry to common.json)
  2. We dont allow more than 4 blocks, as noted in the guidelines. So up to you how to handle it, at minimum just slice the 4, or you can change the widget in that case (e.g. show a block with total, some other info, etc)

@gethomepage gethomepage deleted a comment from github-actions bot Nov 20, 2024
@fgeck
Copy link
Author

fgeck commented Nov 21, 2024

started incorporating your feedback yesterday.
Need to test and will push again in the upcoming days.

@fgeck
Copy link
Author

fgeck commented Nov 21, 2024

Finally again ready for review @shamoon

I added an option to filter spools by their id.

Spoolman:

Screenshot 2024-11-21 at 21 15 46

Config:

widget:
          type: spoolman
          url: https://spoolsman.io
          spoolIds:
            - 2
            - 5       # does not exist, but is allowed

Result in homepage:

Screenshot 2024-11-21 at 21 21 18

Ps.:
I hope this will be a squash merge as the commit history of my branch is quite messy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants