Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Added work package config documentation.

### Fixes
* None.
* Fix inconsistency between GQL and python load override assignment.

### Notes
* None.
Expand Down
48 changes: 36 additions & 12 deletions src/zepben/eas/client/eas_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,27 @@ async def async_get_work_package_cost_estimation(self, work_package: WorkPackage
"timePeriod": {
"startTime": config.load_time.start_time.isoformat(),
"endTime": config.load_time.end_time.isoformat(),
"overrides": config.load_time.load_overrides and {
key: value.__dict__
for key, value in config.load_time.load_overrides.items()}
"overrides": config.load_time.load_overrides and [
{
"loadId": key,
"loadWattsOverride": value.load_watts,
"genWattsOverride": value.gen_watts,
"loadVarOverride": value.load_var,
"genVarOverride": value.gen_var,
} for key, value in config.load_time.load_overrides.items()
]
} if isinstance(config.load_time, TimePeriod) else None,
"fixedTime": config.load_time and {
"loadTime": config.load_time.time.isoformat(),
"overrides": config.load_time.load_overrides and {
key: value.__dict__
for key, value in config.load_time.load_overrides.items()}
"overrides": config.load_time.load_overrides and [
{
"loadId": key,
"loadWattsOverride": value.load_watts,
"genWattsOverride": value.gen_watts,
"loadVarOverride": value.load_var,
"genVarOverride": value.gen_var,
} for key, value in config.load_time.load_overrides.items()
]
} if isinstance(config.load_time, FixedTime) else None,
} for config in work_package.syf_config.configs
]
Expand Down Expand Up @@ -441,15 +453,27 @@ async def async_run_hosting_capacity_work_package(self, work_package: WorkPackag
"timePeriod": {
"startTime": config.load_time.start_time.isoformat(),
"endTime": config.load_time.end_time.isoformat(),
"overrides": config.load_time.load_overrides and {
key: value.__dict__
for key, value in config.load_time.load_overrides.items()}
"overrides": config.load_time.load_overrides and [
{
"loadId": key,
"loadWattsOverride": value.load_watts,
"genWattsOverride": value.gen_watts,
"loadVarOverride": value.load_var,
"genVarOverride": value.gen_var,
} for key, value in config.load_time.load_overrides.items()
]
} if isinstance(config.load_time, TimePeriod) else None,
"fixedTime": config.load_time and {
"loadTime": config.load_time.time.isoformat(),
"overrides": config.load_time.load_overrides and {
key: value.__dict__
for key, value in config.load_time.load_overrides.items()}
"overrides": config.load_time.load_overrides and [
{
"loadId": key,
"loadWattsOverride": value.load_watts,
"genWattsOverride": value.gen_watts,
"loadVarOverride": value.load_var,
"genVarOverride": value.gen_var,
} for key, value in config.load_time.load_overrides.items()
]
} if isinstance(config.load_time, FixedTime) else None,
} for config in work_package.syf_config.configs
]
Expand Down