Added 'excelexporters.spaceefficiency.export()' method

pull/38/head
YangZhang-GitHub 2021-04-27 17:29:36 +08:00
parent bbf83f67f6
commit d04b8c9d4c
1 changed files with 8 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import config
from datetime import datetime, timedelta, timezone
from core import utilities
from decimal import Decimal
import excelexporters.spaceefficiency
class Reporting:
@ -729,5 +730,11 @@ class Reporting:
"timestamps": parameters_data['timestamps'],
"values": parameters_data['values']
}
# export result to Excel file and then encode the file to base64 string
result['excel_bytes_base64'] = excelexporters.spaceefficiency.export(result,
space['name'],
reporting_start_datetime_local,
reporting_end_datetime_local,
period_type)
resp.body = json.dumps(result)