Skip to content

Feat: basic asset type support#1663

Merged
nhoening merged 6 commits intomainfrom
feat/basic-asset-type-support
Aug 27, 2025
Merged

Feat: basic asset type support#1663
nhoening merged 6 commits intomainfrom
feat/basic-asset-type-support

Conversation

@nhoening
Copy link
Contributor

@nhoening nhoening commented Aug 13, 2025

Description

  • Hosts, devs and also users need asset type IDs to do their work, but we don't let them look them up (only way to see them is the new-asset form in the UI).
  • New installations should get default asset types, but how to add them is not clear enough.

Closes #1637

  • Added new API endpoint GET /assets/types
  • Improved documentation for hosts & devs - they should use flexmeasures add inital-structure, which is where default types are being created.
  • Fixed a small bug in that CLI command
  • Added changelog item in documentation/changelog.rst
  • API changelog entry, too

How to test

Run pytest -x

I added a fm-client function which uses the new endpoint, see FlexMeasures/flexmeasures-client#136.

Use this script to test:

import asyncio

from flexmeasures_client import FlexMeasuresClient

usr = "xxx"
pwd = "xxx"

async def main():
    client = FlexMeasuresClient(email=usr, password=pwd)

    print("Getting asset types ...")
    asset_types = await client.get_asset_types()
    print(f"Got {len(asset_types)} asset types:")
    print(asset_types)

    await client.close()


asyncio.run(main())

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…e more than one source with the same name and type (e.g. with different version)

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@read-the-docs-community
Copy link

read-the-docs-community bot commented Aug 13, 2025

Documentation build overview

📚 flexmeasures | 🛠️ Build #29345558 | 📁 Comparing 372a502 against latest (81d507f)


🔍 Preview build

Show files changed (11 files in total): 📝 11 modified | ➕ 0 added | ➖ 0 deleted
File Status
changelog.html 📝 modified
genindex.html 📝 modified
http-routingtable.html 📝 modified
_autosummary/flexmeasures.api.v3_0.assets.html 📝 modified
_autosummary/flexmeasures.api.v3_0.health.html 📝 modified
api/change_log.html 📝 modified
api/v3_0.html 📝 modified
concepts/data-model.html 📝 modified
dev/setup-and-guidelines.html 📝 modified
host/data.html 📝 modified
host/installation.html 📝 modified

@nhoening nhoening requested a review from VladIftime August 16, 2025 11:22
Copy link
Contributor

@VladIftime VladIftime left a comment

Choose a reason for hiding this comment

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

Looks good, and the comments are understandable and easy to follow!

Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
@nhoening nhoening merged commit 45264e4 into main Aug 27, 2025
10 checks passed
@nhoening nhoening deleted the feat/basic-asset-type-support branch August 27, 2025 19:25
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.

Explain & support asset types better

3 participants