Limit Combinations of energy source and unit in heating emission entry
Opened this issue · 2 comments
codingfabi commented
When trying to add a heating emission entry, the backend fails with the following error message:
No conversion data is available for this fuel type. Provide consumption in a different unit.
This is the request I'm sending:
{
"timestamp": "2021-04-01",
"consumption": 4000,
"fuelType": "Electricity",
"building": "205",
"groupShare": 2,
"unit": "kwH"
}
I tried a few different fuel types, the result is the same for all. I assume that this is a co2-calculator error @redfrexx?
codingfabi commented
I realized that the backend also logs the following command to the console output of the container:
0 oil l
1 liquid_gas kg
2 coal kg
3 pellet kg
4 woodchips kg
5 gas m^3
So as far as I can tell, not all combinations of source and unit are working. @redfrexx is there a list of what is working with what so we can adjust the forms.
codingfabi commented
It would be ideal if the backend returned a data structure like this:
[
{
"type" : "gas",
"units": "m^3"
},
{
"type" : "oil",
"units": ["m^3", "l"]
}
]