Skip to content

Merge#28

Merged
gensyn merged 20 commits into
copilot/fix-home-assistant-crash-issuefrom
main
Jul 6, 2026
Merged

Merge#28
gensyn merged 20 commits into
copilot/fix-home-assistant-crash-issuefrom
main

Conversation

@gensyn

@gensyn gensyn commented Jul 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

Dav1d-Fn and others added 20 commits May 14, 2026 00:38
Extends the existing image customization (previously only available in
state filters) to the main Show Icon action settings. A custom image
overrides the icon, color, scale and opacity when set. The other fields
are disabled when an image is active to make the relationship clear.
Also hardens settings initialization to fill in missing keys from
defaults, preventing KeyErrors on actions with incomplete saved state.
Instead of a separate image field, the icon field now accepts both MDI
icon names and file paths. If the entered value is a valid MDI icon it
is rendered as before, otherwise it is treated as an image/GIF path.
Scale works for both. The filter customizations follow the same
logic.
Add custom image/GIF option to icon state customizations
Stabilize CI test suite after merged `show_icon`/`BaseCore` behavior changes
Removed GitHub badge and support section from README.
Yet another try to fix the crashes
Copilot AI review requested due to automatic review settings July 6, 2026 05:59
@gensyn gensyn merged commit ed7ca0d into copilot/fix-home-assistant-crash-issue Jul 6, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the “Show Icon” action to support browsing/selecting local image/GIF files (in addition to MDI icons) and introduces a settings version field with a migration hook executed during BaseCore.on_ready().

Changes:

  • Add “Browse…” file pickers to the Show Icon action UI and customization window, plus localization strings and README updates for image support.
  • Adjust icon rendering logic so non-MDI values (e.g., image paths) bypass color/opacity handling.
  • Introduce a settings version field with a migration entrypoint invoked on action readiness.

Reviewed changes

Copilot reviewed 16 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
actions/show_icon/icon_window.py Adds browse button + icon-change handling; adjusts validation and UI sensitivity.
actions/show_icon/icon_action.py Adds browse button to action config UI; disables color/opacity when not an MDI icon.
actions/show_icon/icon_helper.py Changes icon resolution to support non-MDI values (e.g., file paths).
actions/show_icon/icon_const.py Adds new i18n label keys for browse/image/not-supported messaging.
actions/cores/base_core/migrate.py Adds initial migration scaffold for settings versioning.
actions/cores/base_core/base_core.py Calls migration on ready; keeps combo items alive while clearing.
actions/cores/base_core/base_settings.py Adds default version to base settings.
actions/const.py Introduces SETTING_VERSION_NUMBER.
locales/en_US.json Adds new “Browse…”, “Image:”, and “Only supported for icons” strings.
locales/de_DE.json Adds German equivalents for new strings.
README.md Documents image/GIF support and adds support section.
test/actions/show_icon/test_icon_window.py Updates init expectations and icon validation test.
test/actions/show_icon/test_icon_action.py Updates tests for new browse button and icon detection logic.
test/actions/cores/base_core/test_base_core_on_ready.py Asserts migration is invoked during on_ready().
test/actions/cores/base_core/test_base_core_on_change_domain.py Mocks get_n_items() for new keep-alive logic.
.github/FUNDING.yml Adds Ko-fi funding configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 30 to +35
name, color, scale, opacity = _get_icon_settings(state, settings)

if name not in MDI_ICONS:
# color and opacity only have an effect on icons
return name, scale

Comment on lines +108 to +111
icon_value = self.settings.get_icon()
has_icon = bool(icon_value) and icon_value in icon_helper.MDI_ICONS
not_supported = self.lm.get(icon_const.LABEL_ICON_ONLY_SUPPORTED_FOR_ICONS) if not has_icon else icon_const.EMPTY_STRING

Comment on lines +156 to +158
if self.check_icon.get_active() and not self.icon.get_text():
self.icon.add_css_class(icon_const.ERROR)
return
Comment on lines +182 to +186
def _on_icon_changed(self, *_) -> None:
icon_value = self.icon.get_text()
has_icon = bool(icon_value) and icon_value in icon_helper.MDI_ICONS
for widget in [self.check_color, self.color, self.check_opacity, self.opacity, self.opacity_entry]:
widget.set_sensitive(has_icon)
Comment thread locales/en_US.json
Comment on lines +31 to +33
"actions.home_assistant.icon.browse.label": "Browse...",
"actions.home_assistant.icon.image.label": "Image:",
"actions.home_assistant.icon.only_supported_for_icons.label": "Only supported for icons",
Comment on lines +1 to +15
from HomeAssistantPlugin.actions import const
from HomeAssistantPlugin.actions.cores.customization_core import customization_const
from HomeAssistantPlugin.actions.show_icon import icon_const
from HomeAssistantPlugin.actions.show_icon.icon_settings import ShowIconSettings


def migrate_settings(action) -> None:
settings = action.get_settings()

if settings.get(const.SETTING_VERSION) is not None:
return

migrate_v0_v1(action)

def migrate_v0_v1(action) -> None:
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.

4 participants