Skip to content

Commit

Permalink
Added channels filter to aggr_data api (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisistheplace authored Nov 20, 2024
1 parent d84e373 commit 5ac4a95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fronius_solarweb/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
wait_random_exponential,
stop_after_attempt,
)
from typing import List

from .errors import NotAuthorizedException, NotFoundException

Expand Down Expand Up @@ -188,11 +189,14 @@ async def get_system_flow_data(self, tz: str = "zulu") -> PvSystemFlowData:
return model_data

async def get_system_aggr_data_v2(
self, period: str = "total"
self, period: str = "total", channels: List[str] | None = None
) -> PvSystemAggrDataV2:
_LOGGER.debug("Listing PV system aggregated v2 data")
_url = f"{SW_BASE_URL}/pvsystems/{self.pv_system_id}/aggrdata?period={period}"
if channels is not None:
_url += f"&channel={','.join(channels)}"
r = await self.httpx_client.get(
f"{SW_BASE_URL}/pvsystems/{self.pv_system_id}/aggrdata?period={period}",
_url,
headers=self._common_headers,
)
json_data = await self._check_api_response(r)
Expand Down

0 comments on commit 5ac4a95

Please sign in to comment.