File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1515CLIENT_TIMEOUT_SECONDS = 300 # 5 Minutes
1616
1717# Import from sibling modules
18- from .config import AlpacaConfig , get_current_time
18+ from .config import AlpacaConfig , get_current_time , ALL_CLOUD_CONDITIONS
1919# Assuming detect.py is in the root path or installed as a package
2020from detect import CloudDetector , Config as DetectConfig , HADiscoveryManager
2121
@@ -230,6 +230,14 @@ def _run_single_detection(self, initial: bool = False):
230230 result = self .cloud_detector .detect (return_image = True )
231231 result ['timestamp' ] = get_current_time (self .alpaca_config .timezone )
232232
233+ # FIX: Normalize class name case to match configuration (Title Case preference)
234+ # This handles cases where detection returns "mostly cloudy" but config expects "Mostly Cloudy"
235+ raw_class = result .get ('class_name' , '' )
236+ for known_cond in ALL_CLOUD_CONDITIONS :
237+ if known_cond .lower () == raw_class .lower ():
238+ result ['class_name' ] = known_cond
239+ break
240+
233241 # OPTIMIZATION: Convert to bytes immediately and drop the PIL Object
234242 image_bytes = None
235243 if 'image' in result :
You can’t perform that action at this time.
0 commit comments