Skip to content

fix: support alpha-enabled multi-color filament hex values - #852

Open
nozzle-1 wants to merge 1 commit into
Disane87:devfrom
nozzle-1:fix/support-alpha-enabled-multi-color-filament
Open

nozzle-1 wants to merge 1 commit into
Disane87:devfrom
nozzle-1:fix/support-alpha-enabled-multi-color-filament

Conversation

@nozzle-1

Copy link
Copy Markdown

🎯 Description

Fixes a bug in filament entity picture generation when Spoolman returns multi-color hex values with an alpha channel, for example FF6A13FF.

Previously, multi-color values were only handled correctly when each hex color was 6 characters long. As a result, some valid multi-color filaments could fail to render their entity picture correctly when 8-character hex values were present.

This change keeps the multi-color values intact so Home Assistant can generate the filament picture without rejecting alpha-enabled colors.

🔗 Related Issue

No related issue.

This change is needed because some Spoolman setups return 8-character hex colors for multi-color filaments, which caused broken image generation in the integration.

🎨 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🧹 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test update
  • 🔧 Configuration change
  • 🎨 UI/UX improvement

🧪 Testing

  • I have tested this code locally
  • I have added/updated unit tests that prove my fix/feature works
  • All existing tests pass locally
  • I have tested this in Home Assistant

Test Environment

  • Home Assistant version: 2026.2.3
  • Python version: 3.13.3
  • Integration version: 1.24.0
  • Spoolman version: 0.23.1

Test Scenarios

  1. Configure a filament with multi_color_hexes containing standard 6-character values.
  2. Configure a filament with multi_color_hexes containing 8-character values with alpha, such as FF6A13FF.
  3. Confirm that the filament entity picture is generated correctly in both cases and no error is raised.

📸 Screenshots/Videos

Not applicable.

✅ Checklist

  • 📖 My code follows the project's coding style
  • 🔍 I have performed a self-review of my code
  • 💬 I have commented my code, particularly in hard-to-understand areas
  • 📚 I have updated the documentation (README, CONTRIBUTING, etc.) if needed
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✅ New and existing unit tests pass locally with my changes
  • 🌿 I am merging into the dev branch (not main)
  • 📝 My commits follow the Conventional Commits specification
  • 🔄 I have updated the integration version in manifest.json if needed
  • 🌍 I have updated translations if I changed user-facing strings

📋 Commit Message Format

Example commit message used for this change:

  • fix: support alpha-enabled multi-color filament hex values

🚀 Migration Notes

Not applicable.

📝 Additional Notes

This is a focused bug fix and does not change the public configuration or entity model.

🙏 Acknowledgments

Thanks to the maintainers for reviewing.

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label May 25, 2026
@github-actions

Copy link
Copy Markdown

💡 Tip: Link this PR to an issue!

We noticed this PR doesn't link to any issue. Linking helps us:

  • Track which issues are being worked on
  • Automatically close issues when PRs are merged
  • Keep our project organized

How to link:
Add one of these keywords to your PR description:

  • Fixes #123 - Closes issue when merged
  • Closes #123 - Closes issue when merged
  • Resolves #123 - Closes issue when merged
  • Related to #123 - Just references (doesn't close)

No related issue?
That's okay! But consider:

  • Checking if an issue already exists for this change
  • Creating an issue first to discuss the approach
  • Adding a clear explanation of why this change is needed

Thanks for contributing! 🙌

@github-actions github-actions Bot added area: sensors Related to sensor entities size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 25, 2026
@dosubot dosubot Bot added bug Something isn't working Home Assistant Stuff that is related to home assistant and the integration of services labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sensors Related to sensor entities bug Something isn't working Home Assistant Stuff that is related to home assistant and the integration of services size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant