UPDATE
This commit is contained in:
@@ -41,16 +41,6 @@ def _normalize_to_ideal_score(value: float | None, minimum: float, ideal: float,
|
||||
|
||||
|
||||
def _resolve_profile(context: dict[str, Any]) -> tuple[dict[str, dict[str, float]], str]:
|
||||
location = context.get("location")
|
||||
if location is not None:
|
||||
location_profile = getattr(location, "ideal_sensor_profile", None) or {}
|
||||
if location_profile:
|
||||
merged = {
|
||||
metric: {**DEFAULT_IDEAL_SENSOR_PROFILE.get(metric, {}), **location_profile.get(metric, {})}
|
||||
for metric in set(DEFAULT_IDEAL_SENSOR_PROFILE) | set(location_profile)
|
||||
}
|
||||
return merged, "location"
|
||||
|
||||
plants = context.get("plants", [])
|
||||
for plant in plants:
|
||||
plant_profile = getattr(plant, "health_profile", None) or {}
|
||||
|
||||
Reference in New Issue
Block a user