diff --git a/src/flexmeasures_client/client.py b/src/flexmeasures_client/client.py index 83ebaf9b..675ad7a6 100644 --- a/src/flexmeasures_client/client.py +++ b/src/flexmeasures_client/client.py @@ -297,6 +297,26 @@ async def get_versions(self): return version_info + async def get_asset_types(self) -> list: + """ + Get the asset types currently supported by FlexMeasures server. + + Returns: + list[dict]: List of asset type objects, e.g., + [{"id": 1, "name": "solar", "description": "solar panel(s)"}] + """ + response, status = await self.request( + uri="assets/types", + method="GET", + ) + check_for_status(status, 200) + if not isinstance(response, list): + raise ContentTypeError( + f"Expected a list of asset types, but got {type(response)}", + ) + + return response + async def post_sensor_data( self, sensor_id: int,