Skip to content

Commit

Permalink
Tidy up old func
Browse files Browse the repository at this point in the history
  • Loading branch information
lwis committed Dec 26, 2024
1 parent 4650ff4 commit dc861ef
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions custom_components/octopus_energy/api_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,27 +880,6 @@ async def async_get_heat_pump_configuration_and_status(self, account_id: str, eu
_LOGGER.warning(f'Failed to connect. Timeout of {self._timeout} exceeded.')
raise TimeoutException()

async def async_get_heat_pump_lifetime_performance(self, euid: str):
"""Get heat pump live performance"""
await self.async_refresh_token()

try:
client = self._create_client_session()
url = f'{self._base_url}/v1/graphql/'
payload = { "query": heat_pump_lifetime_performance.format(euid=euid) }
headers = { "Authorization": f"JWT {self._graphql_token}" }
async with client.post(url, json=payload, headers=headers) as heat_pump_response:
response = await self.__async_read_response__(heat_pump_response, url)

if (response is not None and "data" in response and "octoHeatPumpLifetimePerformance" in response["data"]):
return OctoHeatPumpLifetimePerformance.parse_obj(response["data"]["octoHeatPumpLifetimePerformance"])

return None

except TimeoutError:
_LOGGER.warning(f'Failed to connect. Timeout of {self._timeout} exceeded.')
raise TimeoutException()

async def async_get_heat_pump_time_ranged_performance(self, euid: str, start_at: datetime, end_at: datetime):
"""Get heat pump live performance"""
await self.async_refresh_token()
Expand Down

0 comments on commit dc861ef

Please sign in to comment.