From 99186516c5b9629788d5a99c8e208e76c0d2fd5e Mon Sep 17 00:00:00 2001
From: Erika Nesse <erika.nesse@gmail.com>
Date: Wed, 20 Dec 2023 00:57:43 +0000
Subject: [PATCH] Fixed types to make tests pass

Co-authored-by: harry <harryzhu626@users.noreply.github.com>
Co-authored-by: Debajyoti Debnath <debajyotid2@users.noreply.github.com>
Co-authored-by: dwindleduck <dwindleduck@users.noreply.github.com>
Co-authored-by: Alan Pinkert <alanisaac@users.noreply.github.com>
---
 rules-engine/src/rules_engine/engine.py          | 13 ++++++++++---
 rules-engine/src/rules_engine/pydantic_models.py |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/rules-engine/src/rules_engine/engine.py b/rules-engine/src/rules_engine/engine.py
index ddc71bc3..e306f04b 100644
--- a/rules-engine/src/rules_engine/engine.py
+++ b/rules-engine/src/rules_engine/engine.py
@@ -145,9 +145,10 @@ def get_outputs_normalized(
         average_heat_load=average_heat_load,
         maximum_heat_load=maximum_heat_load,
     )
-    #return summary_output  # TODO: add BalancePointGraph
+    # return summary_output  # TODO: add BalancePointGraph
     raise NotImplementedError
 
+
 def date_to_analysis_type(d: date) -> AnalysisType:
     months = {
         1: AnalysisType.INCLUDE,
@@ -197,8 +198,8 @@ def period_hdd(avg_temps: List[float], balance_point: float) -> float:
 
 def get_average_indoor_temperature(
     thermostat_set_point: float,
-    setback_temperature: float,
-    setback_hours_per_day: float,
+    setback_temperature: Optional[float],
+    setback_hours_per_day: Optional[float],
 ) -> float:
     """
     Calculates the average indoor temperature.
@@ -210,6 +211,12 @@ def get_average_indoor_temperature(
         setback_hours_per_day: average # of hours per day the home is at
         setback temp
     """
+    if setback_temperature is None:
+        setback_temperature = thermostat_set_point
+    
+    if setback_hours_per_day is None:
+        setback_hours_per_day = 0
+
     # again, not sure if we should check for valid values here or whether we can
     # assume those kinds of checks will be handled at the point of user entry
     return (
diff --git a/rules-engine/src/rules_engine/pydantic_models.py b/rules-engine/src/rules_engine/pydantic_models.py
index a3177738..3b3199c0 100644
--- a/rules-engine/src/rules_engine/pydantic_models.py
+++ b/rules-engine/src/rules_engine/pydantic_models.py
@@ -46,8 +46,8 @@ class SummaryInput(BaseModel):
     )
     heating_system_efficiency: float = Field(description="Summary!B12")
     thermostat_set_point: float = Field(description="Summary!B17")
-    setback_temperature: float = Field(description="Summary!B18")
-    setback_hours_per_day: float = Field(description="Summary!B19")
+    setback_temperature: Optional[float] = Field(description="Summary!B18")
+    setback_hours_per_day: Optional[float] = Field(description="Summary!B19")
     design_temperature: float = Field(description="TDesign")