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
433 patch sensor #773
433 patch sensor #773
Conversation
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
…corator, especially arg_loader was misleading Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…or, for when we only have an AuthModelMixin ID. Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good!
I have one concern about formalizing what attributes are excluded in the PartialSchema and how. If we get that straight (by changes or discussion), this can be merged.
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
…oved docs Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think this is already fine, with one caveat:
As a frontend dev, I might want to get the sensor ID back from fetch_one and patch (in order to build valid API URLs for the sensor for the next action on it). I don't think that's highly critical, so it could also go into a follow-up ticket.
The GenericAssetSchema has this line, maybe adding this to the SensroSchema would accomplish this:
id = ma.auto_field()
If that works superwell, we could include it here, otherwise make a follow-up issue.
Signed-off-by: GustaafL <guus@seita.nl>
I've added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the ID now returned in fetch_one and /or patch?
All responses that return the sensor include the id. So will also need to fix the docstrings. |
Signed-off-by: GustaafL <guus@seita.nl>
* feat(sensor): adds delete sensor endpoint Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): updated api changelog Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): updated api changelog whitespace Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): updated api changelog missing / Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): update changelog Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): update changelog typo Signed-off-by: GustaafL <guus@seita.nl> * docs(sensor): update changelog missing space Signed-off-by: GustaafL <guus@seita.nl> * tests(sensor): check for float instead of exact value Signed-off-by: GustaafL <guus@seita.nl> --------- Signed-off-by: GustaafL <guus@seita.nl> Signed-off-by: GustaafL <41048720+GustaafL@users.noreply.github.com>
Description
Adds an API endpoint to PATCH a sensor
Look & Feel
endpoint
sensors/<id>
json:
{
"name": "POWER",
}
response:
{
"name": "POWER",
"event_resolution": "PT1H",
"unit": "kWh",
"generic_asset_id": 1,
}
Related Items
Relates to issue #433
Mention if this PR closes an Issue or Project.