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

Feature/revised asset groups #1017

Merged
merged 6 commits into from
Mar 25, 2024
Merged

Feature/revised asset groups #1017

merged 6 commits into from
Mar 25, 2024

Conversation

Flix6x
Copy link
Contributor

@Flix6x Flix6x commented Mar 21, 2024

Description

Allow custom asset groups to swallow default asset groups based on asset type. This is useful for plugins to e.g. override the default asset groups.

Look & Feel

Before:

image

After:

image

How to test

Example flexmeasures.cfg entry:

FLEXMEASURES_ASSET_TYPE_GROUPS = {
    "projects": ["smartbuilding.simulation"],
    "scenarios": ["smartbuilding.scenario"],
    "sites": ["smartbuilding.site"],
    "renewables": ["solar", "wind", "smartbuilding.PV"],
    "buildings": ["building", "smartbuilding.building"],
    "batteries": ["battery", "smartbuilding.battery"],
    "charge points": ["one-way_evse", "two-way_evse", "smartbuilding.chargepoint"],
}

Note that the Tariffs group is shown in both images, but not defined here in the config, nor is it swallowed by one of the custom groups. It is coming from the asset type tariff (asset types are shown pluralized and capitalized when shown as a group on the dashboard).

Further Improvements

It would be nice to be able to assign default icons to asset types, for example, using Font Awesome strings, in the database table for asset types. But this would be a larger project, also involving UI work.

Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Signed-off-by: F.N. Claessen <felix@seita.nl>
Copy link
Contributor

@victorgarcia98 victorgarcia98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! No more infinite scrolling to the right on the main page.

Note: I also try it out locally and works for me.

flexmeasures/ui/utils/view_utils.py Show resolved Hide resolved
flexmeasures/ui/utils/view_utils.py Outdated Show resolved Hide resolved
Signed-off-by: F.N. Claessen <felix@seita.nl>
@Flix6x Flix6x added this to the 0.20 milestone Mar 25, 2024
Flix6x and others added 2 commits March 25, 2024 11:42
@Flix6x Flix6x merged commit 95fac5c into main Mar 25, 2024
3 checks passed
@Flix6x Flix6x deleted the feature/revised-asset-groups branch March 25, 2024 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants