bzzoiro / repsolluzygas

Sensor for Home Assistant - Retrieve costs from Repsol Luz y Gas
MIT License
14 stars 8 forks source link

Version 1.1. Error in python if you don't have any invoice. #12

Open cbolumar opened 2 years ago

cbolumar commented 2 years ago

I changed to Redsol this month and don't have any invoice. Last version don't support this case , the python program broke with '0 out of index' and the installation dont progress. After modify the python progran to remove last invoice logic all is working great.

Next month ,i wil recover the v1,1 code.

Thanks for this integration Regards

bzzoiro commented 2 years ago

Thanks for the report!

Right now I formatted the pc and I need to reinstall and configure everything necessary to code / develop (virtual machine with hassio, samba, etc). After that I will try to launch version 2.0 Beta, that includes new sensors

El dom, 16 ene 2022 a las 1:27, cbolumar @.***>) escribió:

I changed to Redsol this month and don't have any invoice. Last version don't support this case , the python program broke with '0 out of index' and the installation dont progress. After modify the python progran to remove last invoice logic all is working great.

Next month ,i wil recover the v1,1 code.

Thanks for this integration Regards

— Reply to this email directly, view it on GitHub https://github.com/bzzoiro/repsolluzygas/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACFV7VC6ZBKDTNXOPRPWL6TUWIGGVANCNFSM5MBTFB2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Adriano Almeida

NeoPolus commented 2 years ago

Same problem here. No invoices yet (I just joined Repsol), so it fails when loading the invoice info (it doesn't check if there is any invoice):

│Mar  7 08:20:52  hass[18806]:   File "/home/homeassistant/.homeassistant/custom_components/repsolluzygas/repsol_api.py", line 183, in update 
│Mar  7 08:20:52  hass[18806]:     data['last_invoice_amount'] = invoices[0]['amount']                                                                                                                                                 
│Mar  7 08:20:52  hass[18806]: IndexError: list index out of range