Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list index out of range error sporadically appears upon pull #7

Closed
djenk41us opened this issue Apr 2, 2022 · 1 comment
Closed

Comments

@djenk41us
Copy link

I have been using this extension with my WeatherLink Live and Davis Pro account. I have the extension configured and it works, but I get these errors in the weewx.log.

Any idea how to clear these? is it a mapping issue?

2022-04-02 14:22:16 weewx[1] ERROR user.davishealthapi: No valid historical data structure types found in API data. Error is: list index out of range
2022-04-02 14:22:16 weewx[1] ERROR user.davishealthapi: The API data returned was: {'sensors': [{'lsid': 505957, 'data': [], 'sensor_type': 323, 'data_structure_type': 17}, {'lsid': 505956, 'data': [], 'sensor_type': 506, 'data_structure_type': 18}, {'lsid': 506765, 'data': [], 'sensor_type': 46, 'data_structure_type': 11}, {'lsid': 505948, 'data': [], 'sensor_type': 243, 'data_structure_type': 13}, {'lsid': 505947, 'data': [], 'sensor_type': 242, 'data_structure_type': 13}, {'lsid': 505946, 'data': [], 'sensor_type': 504, 'data_structure_type': 15}], 'generated_at': 1648923736, 'station_id': 133822}

@djenk41us
Copy link
Author

Reviewed the code. The decode_historical_json() and decode_current_json() were using a range of 7 values. On Davis systems that have more than 1 device (eg WeatherLinkLive + AirLink), it will provide additional sensor_type items in the JSON Stream.

I corrected this issue by using an iteration over the data stream. That will allow all items in the stream to be evaluated.

please see #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant