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

Material Design Icons support #51

Open
Baldhor opened this issue Oct 4, 2023 · 4 comments
Open

Material Design Icons support #51

Baldhor opened this issue Oct 4, 2023 · 4 comments
Assignees
Labels
expensive enhancement expensive enhancement

Comments

@Baldhor
Copy link
Owner

Baldhor commented Oct 4, 2023

          Maybe make use of the Material Design icons? 

Ronny already uses for his capabilities.
This was added in version 0.2.0 of his app.
This is a diff of version 0.1.9 and 0.2.0
RonnyWinkler/io.home-assistant.community@0.1.9...0.2.0

Originally posted by @RoadXY in #41 (comment)

@Baldhor Baldhor self-assigned this Oct 4, 2023
@Baldhor Baldhor added the enhancement New feature or request label Oct 4, 2023
@Baldhor Baldhor changed the title Maybe make use of the Material Design icons? Material Design Icons support Oct 4, 2023
@Baldhor
Copy link
Owner Author

Baldhor commented Oct 4, 2023

The purpose here is to offer a way for the user to choose an icon from https://pictogrammers.com/library/mdi/ directly from the wizard!

@Baldhor
Copy link
Owner Author

Baldhor commented Oct 11, 2023

So I explorered a little what others did:

1/ Seems MQTT Hub introduced the first implementation to support MDI in a Homey application
Looking at the code, the icon can be set only at creation time, modification is not supported afterward.

2/ io.home-assistant.community took the code from MQTT Hub
But also added icon change support through the repair function.
Meaning you can change the icon afterward.
=> proof if needed that we can change icon "after creation".


The implementation for both is based on Vue.js, but I use Petite Vue.js.

It will require some code rework, but not so much apparently.

The icon file is downloaded and stored in the application file storage.

That's the good way to do it in my opinion.

From user point of view it goes through a search tool inside the Homey interface

Great!

The interface doesn't show all the icons, but only the one selected

Unsure about it

Anyway, it's good enough

The code allows to input directly the url of a specific SVG file

Seems not limited to MDI

I cannot find the interface element, so I'm unsure if it is fully implemented

In my opinion, that's useless anyway (MDI has enough icons available)

If the same icon is used several times, the icon is duplicated, the file is named on the device unique identifier.

This can lead to a lot of space used ...

I need to rework that part. I just cannot accept it ...

The file is deleted when the device is deleted.

What if it fails in the middle ? (the file is never removed ???)

I need to rework that part too, mostly because of previous point :)

I want to allow MDI for capabilities too,

I didn't find anything, and so I don't know if it is possible or not

Need to test it seems, nobody answered me on Slack

@Baldhor
Copy link
Owner Author

Baldhor commented Oct 11, 2023

First estimation of the work load: about 10h (dev) + 5h of support (bugs, wiki, ...).
As for capabilities, probably around 3h for testing if it is possible.

@Baldhor Baldhor added expensive enhancement expensive enhancement and removed enhancement New feature or request labels Oct 12, 2023
@Baldhor
Copy link
Owner Author

Baldhor commented Oct 28, 2023

Ok so here is my idea after thikking about it a little while.

In ESPhome firmaware, you can actually configure an icon at the entity level.
In the ESPhome for Homey app, I consider "native capabilities", not entities.

Reminder: a native capability is "an attribut of an entity"

So the native capabilities will inherite from the icon of the entity.

In Homey, you can set the icon of a device, but I'm unsure about the icon of a capability (only further test will confirm if it is possible).

1. The Wizard will propose for each device:

  • To use the default icon: which I cannot show
  • To choose an icon from the "local library"

And so maybe also for the capabilities, it depends if it is possible or not

2. The Wizard will have a new "Manage your local icon library"

  • It will be marked as red if it contains unused or unavailable icons (see below)
  • It will allows to add, replace or delete an icon
  • It will show the state of the icon (see below), how many times it is used, and it's size

If the user delete an icon used, the device (and/or capability) using it will be back to default

Add and replace will allow: to search an icon in the mdi library, or input an url to a svg file

3. The download of the icons will be asynchronous

So an icon in the local library will have 3 states: downloading, unavailable (error), available

If unavaialable, the user can "try again", replace it, or just delete it


From an user experience point of view:
It's probably better if the user download a new icon before creation of the devices.
But he can edit the device icon later if needed!

I believe, if the user download an icon, he must have the choice to use it right now or later.
Deletion of an icon should not be automatic but a decision of the user!


From implementation point of view:
It makes it much easier to avoid downloading several times the same icon.

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

No branches or pull requests

1 participant