Skip to content

Commit

Permalink
Update repsol_api.py
Browse files Browse the repository at this point in the history
Added new logger to contracts function

Deleted attribute that was deleted from Repsol API.
  • Loading branch information
bzzoiro committed Dec 21, 2021
1 parent 5327124 commit 117bdf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/repsolluzygas/repsol_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def get_contracts(self, uid, signature, tstamp):

response = requests.get('https://areacliente.repsolluzygas.com/api/houses', headers=headers, cookies=self.cookies)
data = response.json()
_LOGGER.debug('Contracts Data {}'.format(data))
contracts = {}

data = data[0]
Expand All @@ -93,10 +94,9 @@ def get_contracts(self, uid, signature, tstamp):
info['contract_id'] = contract['code']
info['type'] = contract['contractType']
info['active'] = contract['status'] == 'ACTIVE'
info['product_name'] = contract['commercialName']
contracts['information'].append(info)

_LOGGER.debug('Contracts {}'.format(contracts))
_LOGGER.debug('Contracts Parsed {}'.format(contracts))

return contracts

Expand Down

0 comments on commit 117bdf8

Please sign in to comment.