You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, it would be nice to add the option to control this query parameter. From the documentation:
no_sun
Type: integer flag (0|1)
By default the forecast is filled up to show the time from sunrise to sunset.
This will result in irregular timestamp offsets at the beginning and the end of the day but you have a full daylight forecast cycle. https://api.forecast.solar/...?no_sun=1
This will suppress this logic and starts/ends with the first/last available dataset.
I cloned the repo and added this solution:
@dataclassclassForecastSolar:
"""Main class for handling connections with the Forecast.Solar API."""azimuth: floatdeclination: floatkwp: floatlatitude: floatlongitude: floatapi_key: str|None=Nonedamping: float=0damping_morning: float|None=Nonedamping_evening: float|None=Nonehorizon: str|None=Noneno_sun: bool=True
...
asyncdefestimate(self, actual: float=0) ->Estimate:
"""Get solar production estimations from the Forecast.Solar API. Args: ---- actual: The production for the day in kWh so far. Used to improve the estimation for the current day if an API key is provided. Returns: ------- A Estimate object, with a estimated production forecast. """params= {"time": "iso8601", "damping": str(self.damping), "no_sun": int(self.no_sun)}
ifself.inverterisnotNone:
params["inverter"] =str(self.inverter)
ifself.horizonisnotNone:
params["horizon"] =str(self.horizon)
ifself.damping_morningisnotNoneandself.damping_eveningisnotNone:
params["damping_morning"] =str(self.damping_morning)
params["damping_evening"] =str(self.damping_evening)
ifself.api_keyisnotNone:
params["actual"] =str(actual)
data=awaitself._request(
f"estimate/{self.latitude}/{self.longitude}"f"/{self.declination}/{self.azimuth}/{self.kwp}",
params=params,
)
returnEstimate.from_dict(data)
The text was updated successfully, but these errors were encountered:
Hi, it would be nice to add the option to control this query parameter. From the documentation:
I cloned the repo and added this solution:
The text was updated successfully, but these errors were encountered: