grafana / iot-sitewise-datasource

IoT Sitewise
Apache License 2.0
19 stars 9 forks source link

feat: support composite model properties #279

Closed tracy-french closed 4 months ago

tracy-french commented 6 months ago

What this PR does / why we need it: This change enables the visualization of component properties. Instead of utilizing the list of asset properties contained within DescribeAsset, ListAssetProperties is utilized. See https://github.com/grafana/iot-sitewise-datasource/issues/269.

tracy-french commented 4 months ago

@sarahzinger Thank you for reviewing! I'll follow-up on your requested changes shortly. :)

To answer your question, you should not see the asset properties of child assets. You should only see the properties of the selected asset(s), which is the same as the current behavior. The big difference is now the user can see component properties associated with the selected asset. Components are a new type of asset model which allows sharing of asset properties across asset models. A car asset model can have an engine component with a temperature asset property. The engine component can have a piston component with a pressure asset property. The engine component could be associated with a boat asset model as well. Both the boat and the car have temperature and pressure asset properties.

With the current implementation, we use DescribeAsset, which does not include the list of asset properties coming from associated components. Calling DescribeAsset would not show the temperature or pressure asset properties for both the boat and the car. ListAssetProperties does include these additional component asset properties.

sarahzinger commented 4 months ago

Ahh ok thanks for clarifying that @tracy-french sorry for the misunderstanding! Your explanation makes a lot of sense thanks for walking it through! I was able to make a test asset with component models attached and see their properties! Looks great. When you're done making changes to this pr you can click the re-request review button on the top right hand side of this pr and it will ping me to take another look. Happy to merge once the little renames are done, unless @iwysiu has any other thoughts. Thanks!