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

Implement GenericAsset crud #247

Closed
nhoening opened this issue Nov 27, 2021 · 8 comments · Fixed by #290
Closed

Implement GenericAsset crud #247

nhoening opened this issue Nov 27, 2021 · 8 comments · Fixed by #290

Comments

@nhoening
Copy link
Contributor

nhoening commented Nov 27, 2021

Results:

  • The dashboard shows the user's generic assets (which all refer to an old-style asset).
  • The pop-up showing the latest data of course only shows one sensor right now, not sure which to choose if there are more. Maybe a simple heuristic.
  • Generic assets can be edited and created, just like the old-style assets (not sure what to do about attributes, maybe ignore for now).

For this, we'll copy the old asset API and Crud. The new one should use modern authorization logic (we'll add ACLs to the GenericAsset class). The old API and Crud are noted for deprecation.

@nhoening nhoening created this issue from a note in Support Sensor and Asset diversity (To do) Nov 27, 2021
@Flix6x
Copy link
Contributor

Flix6x commented Nov 27, 2021

Attaching some of my thoughts:

  • Replicating CRUD functionality in our new data model means we should do this for both GenericAssets and Sensors.
  • I think we can, if needed, limit the fields we allow users to change, at least until we have completed the move to the new data model. But before we start the work, we should make a list of UI editable properties of GenericAssets and Sensors.
  • The list of GenericAssets may also include ones that have no corresponding old Asset.
  • A plot with the latest state doesn't make sense for the GenericAsset crud page. It makes sense for the Sensor crud page.

@nhoening
Copy link
Contributor Author

I wouldn't advise we do both generic assets and sensors in the same PR. My thought was generic assets can go first because the dashboard should show them. Maybe you have a better reason to start with sensors.

The latest measurement I was referring to is part of that dashboard.

@Flix6x
Copy link
Contributor

Flix6x commented Nov 27, 2021 via email

@nhoening
Copy link
Contributor Author

I chose the map as a user-facing goal, because every PR should have one to work towards, if possible. For this PR that is possible, for your recent PRs it was of course more difficult.
Happy to hear if there is a better one, e.g. for the Sensor case.

@nhoening
Copy link
Contributor Author

The list of GenericAssets may also include ones that have no corresponding old Asset

I agree, I believe that old and new assets are mirrored pretty well, so I thought I only offer editing new assets. I don't plan to carry edits back to the old style assets.

@nhoening
Copy link
Contributor Author

Finding and even summing over power sensors sounds like a good idea to me.
We can in the future work towards an Asset model which identifies a primary sensor, but we can do so if we need it.

@nhoening
Copy link
Contributor Author

nhoening commented Nov 28, 2021

Actually, I now see that I can split the asset work in two PRs - replacing the dashboard and writing a new CRUD:

IMG_20211128_161100.jpg

I believe I'd like to start with the dashboard work, I believe it's simpler.

I can also keep the old dashboard+queries around, but I'm not sure what for.

So I'd update the left stack, and write a new right stack.

@Flix6x
Copy link
Contributor

Flix6x commented Nov 28, 2021

That sounds good to me. Would you consider splitting this into two smaller PRs then?

@nhoening nhoening moved this from To do to In progress in Support Sensor and Asset diversity Dec 16, 2021
@nhoening nhoening moved this from In progress to Review in progress in Support Sensor and Asset diversity Jan 4, 2022
@Flix6x Flix6x moved this from Review in progress to Reviewer approved in Support Sensor and Asset diversity Jan 4, 2022
@Flix6x Flix6x linked a pull request Jan 6, 2022 that will close this issue
4 tasks
@Flix6x Flix6x closed this as completed Jan 6, 2022
Support Sensor and Asset diversity automation moved this from Reviewer approved to Done Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants