flexmeasures.ui.utils.view_utils
Utilities for views
Functions
- flexmeasures.ui.utils.view_utils.asset_icon_name(asset_type_name: str) str
Icon name for this asset type.
This can be used for UI html templates made with Jinja. ui.__init__ makes this function available as the filter “asset_icon”.
- For example:
<i class={{ asset_type.name | asset_icon }}></i>
- becomes (for a battery):
<i class=”icon-battery”></i>
- flexmeasures.ui.utils.view_utils.clear_session()
- flexmeasures.ui.utils.view_utils.get_git_description() tuple[str, int, str]
Get information about the SCM (git) state if possible (if a .git directory exists).
Returns the latest git version (tag) as a string, the number of commits since then as an int and the current commit hash as string.
- flexmeasures.ui.utils.view_utils.render_flexmeasures_template(html_filename: str, **variables)
Render template and add all expected template variables, plus the ones given as **variables.