mirror of
				https://github.com/Akkudoktor-EOS/EOS.git
				synced 2025-10-30 22:36:21 +00:00 
			
		
		
		
	* temperature, relativehumidity_2m, windspeed_10m can be null * prettify pv_forecast_input_1.json (and add null value)
This commit is contained in:
		| @@ -3331,7 +3331,14 @@ | ||||
|         "properties": { | ||||
|           "temperature": { | ||||
|             "items": { | ||||
|               "type": "number" | ||||
|               "anyOf": [ | ||||
|                 { | ||||
|                   "type": "number" | ||||
|                 }, | ||||
|                 { | ||||
|                   "type": "null" | ||||
|                 } | ||||
|               ] | ||||
|             }, | ||||
|             "type": "array", | ||||
|             "title": "Temperature" | ||||
| @@ -3462,7 +3469,14 @@ | ||||
|             "anyOf": [ | ||||
|               { | ||||
|                 "items": { | ||||
|                   "type": "number" | ||||
|                   "anyOf": [ | ||||
|                     { | ||||
|                       "type": "number" | ||||
|                     }, | ||||
|                     { | ||||
|                       "type": "null" | ||||
|                     } | ||||
|                   ] | ||||
|                 }, | ||||
|                 "type": "array" | ||||
|               }, | ||||
|   | ||||
| @@ -32,7 +32,7 @@ class OptimizationParameters(BaseModel): | ||||
|     inverter: InverterParameters = InverterParameters() | ||||
|     eauto: Optional[ElectricVehicleParameters] | ||||
|     dishwasher: Optional[HomeApplianceParameters] = None | ||||
|     temperature_forecast: Optional[list[float]] = Field( | ||||
|     temperature_forecast: Optional[list[Optional[float]]] = Field( | ||||
|         default=None, | ||||
|         description="An array of floats representing the temperature forecast in degrees Celsius for different time intervals.", | ||||
|     ) | ||||
|   | ||||
| @@ -109,9 +109,9 @@ class AkkudoktorForecastValue(PydanticBaseModel): | ||||
|     power: float | ||||
|     sunTilt: float | ||||
|     sunAzimuth: float | ||||
|     temperature: float | ||||
|     relativehumidity_2m: float | ||||
|     windspeed_10m: float | ||||
|     temperature: Optional[float] | ||||
|     relativehumidity_2m: Optional[float] | ||||
|     windspeed_10m: Optional[float] | ||||
|  | ||||
|  | ||||
| class AkkudoktorForecast(PydanticBaseModel): | ||||
|   | ||||
| @@ -407,7 +407,7 @@ def fastapi_gesamtlast_simple(year_energy: float) -> list[float]: | ||||
|  | ||||
|  | ||||
| class ForecastResponse(PydanticBaseModel): | ||||
|     temperature: list[float] | ||||
|     temperature: list[Optional[float]] | ||||
|     pvpower: list[float] | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -88,7 +88,7 @@ class VisualizationReport(ConfigMixin): | ||||
|     def create_line_chart( | ||||
|         self, | ||||
|         start_hour: Optional[int], | ||||
|         y_list: list[Union[np.ndarray, list[float]]], | ||||
|         y_list: list[Union[np.ndarray, list[Optional[float]], list[float]]], | ||||
|         title: str, | ||||
|         xlabel: str, | ||||
|         ylabel: str, | ||||
|   | ||||
| @@ -293,10 +293,9 @@ def test_timezone_behaviour( | ||||
|     forecast_temps = provider.key_to_series( | ||||
|         "pvforecastakkudoktor_temp_air", other_start_datetime, other_end_datetime | ||||
|     ) | ||||
|     assert len(forecast_temps) == 24 | ||||
|     assert forecast_temps.iloc[0] == 7.0 | ||||
|     assert forecast_temps.iloc[1] == 6.5 | ||||
|     assert forecast_temps.iloc[2] == 6.0 | ||||
|     assert len(forecast_temps) == 23  # 24-1, first temperature is null | ||||
|     assert forecast_temps.iloc[0] == 6.5 | ||||
|     assert forecast_temps.iloc[1] == 6.0 | ||||
|  | ||||
|     # Test fetching AC power forecast | ||||
|     other_end_datetime = other_start_datetime + to_duration("48 hours") | ||||
|   | ||||
							
								
								
									
										11663
									
								
								tests/testdata/pv_forecast_input_1.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										11663
									
								
								tests/testdata/pv_forecast_input_1.json
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user