mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Map PasHub RdSAP Summary response to as-surveyed performance values 🟩
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
85482cdf9e
commit
af6c461c93
1 changed files with 12 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
|||
from collections import defaultdict
|
||||
import os
|
||||
from typing import Dict, List, NamedTuple, Optional
|
||||
from typing import Any, Dict, List, NamedTuple, Optional
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
|
|
@ -133,7 +133,17 @@ class PashubClient:
|
|||
return None
|
||||
|
||||
def get_rdsap_summary_by_job_id(self, job_id: str) -> RdSapSummary:
|
||||
raise NotImplementedError
|
||||
logger.info(f"Getting RdSAP Summary for job ID {job_id}")
|
||||
url = f"{self.base}/jobs/{job_id}/rdSapSummary"
|
||||
|
||||
r = self.session.get(url)
|
||||
|
||||
data: Dict[str, Any] = r.json()
|
||||
return RdSapSummary(
|
||||
pre_sap_rating=data.get("preSapRating"),
|
||||
pre_current_co2_emissions=data.get("preCurrentCo2Emissions"),
|
||||
pre_current_energy_consumption=data.get("preCurrentEnergyConsumption"),
|
||||
)
|
||||
|
||||
def _group_into_core_and_other_files(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue