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

refactor: Refactor icon state building #232

Closed
AmoebeLabs opened this issue Jun 11, 2023 · 1 comment
Closed

refactor: Refactor icon state building #232

AmoebeLabs opened this issue Jun 11, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request refactoring Code refactoring issues

Comments

@AmoebeLabs
Copy link
Owner

The Problem To Be Solved

Currently, SAK is using CCH to build the icon state, if not known from user input and/or attribute.

But this is not up to date anymore with Home Assistant.

As part of #227, replace CCH functions.

Additional background:

Some of the icons that are displayed are already the wrong icons, as CCH is not up-to-date anymore.

Related Issues (if any)

(Optional): Suggested Solution

Home Assistant now directly fetches the path of the icon, where SAK needs the 'mdi:name'.

This means that all the entity icon builders from HA need to be copied, and modified to return the name of the icon, just as CCH did this.

The list of files to copy, convert to js, rename/append '_name' to the file, and change for icon name fetching/handling, instead of path are (may not be complete):

  • alarm_panel_icon.ts
  • battery_icon.ts
  • binary_sensor_ico.ts
  • cover_icon.ts
  • domain_icon.ts
  • number_icon.ts
  • sensor_icon.ts
  • state_icon_path.ts (will become state_icon_name.js)
  • const.ts

(Optional): Alternative Solutions

@AmoebeLabs AmoebeLabs added enhancement New feature or request refactoring Code refactoring issues labels Jun 11, 2023
@AmoebeLabs AmoebeLabs added this to the Release v2.5.1 milestone Jun 11, 2023
@AmoebeLabs AmoebeLabs changed the title chore: Refactor icon state building feat: Refactor icon state building Jun 11, 2023
@AmoebeLabs AmoebeLabs changed the title feat: Refactor icon state building refactor: Refactor icon state building Jun 11, 2023
@AmoebeLabs AmoebeLabs self-assigned this Jun 11, 2023
@AmoebeLabs
Copy link
Owner Author

Closes due to #227

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Code refactoring issues
Projects
None yet
Development

No branches or pull requests

1 participant