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

Support easy sorting according to next collection #36

Closed
i-C-o-d-e-r opened this issue Mar 22, 2021 · 6 comments
Closed

Support easy sorting according to next collection #36

i-C-o-d-e-r opened this issue Mar 22, 2021 · 6 comments

Comments

@i-C-o-d-e-r
Copy link

i-C-o-d-e-r commented Mar 22, 2021

Hi,

first things first: Thanks for this nice integration. Works perfectly!

I created dedicated entities per waste type and show them in the entities card. However I would like to sort the entities according to the next collection. So the waste type that is about to be collected next should be displayed first and so on.

I could use a markdown card or even better auto-entities, which natively supports sorting. However if the state of the dedicated entity is "in 12 days", it is difficult or impossible to support sorting.

I could create a template sensor for each entity where I add a attribute "daysTo", but this is....painful. It would make more sense, if you would also support an attribute_template for the sensor or just add the numeric property "daysTo" to the attributes by default.

I hope my point is clear. I am sure a lot of people would love to sort the entities.

Thanks in advance

@mampfes
Copy link
Owner

mampfes commented Mar 23, 2021

Hi, I think I got your point :-)

Adding an attribute to support sorting of entities in the UI sounds reasonable and feasible. I didn't add it be default so far, because this would pollute the "more-info" window. I would add an option to the configuration which appends a daysTo attribute.

I'm not sure if an attribute_template is a good idea, because this would add a lot of complexity if you want to support arbitrary informations, like list of upcoming events, etc.

Currently I work on another feature (calendar). I would look into your request after I have finished this feature.

Regards

@i-C-o-d-e-r
Copy link
Author

Thanks! Looking forward to try it out.

@mampfes
Copy link
Owner

mampfes commented Apr 1, 2021

Please check version 1.2.0. You now have to ability add an attribute daysTo to the entity state if you add add_days_to: True to the sensor configuration of your waste type specific sensor.

Please let me know if this works for you.

@i-C-o-d-e-r
Copy link
Author

It works perfectly! Thank you very much for this lightning fast implementation of my feature request. I appreciate it.

@martin3000
Copy link
Contributor

martin3000 commented Nov 3, 2021

why is the "daysTo" attribute not standard (default)? is there any disadvantage in having it?

@mampfes
Copy link
Owner

mampfes commented Nov 3, 2021

daysTo has been added later. And as I didn't want to change the existing configurations it is an optional attribute.

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

No branches or pull requests

3 participants