jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Change production retrieval #20

Closed gtdiehl closed 4 years ago

gtdiehl commented 4 years ago

Since there are two different Envoy-S models, one that has only inverters and one with inverters and CTs (eim). The production method should retrieve watts from the inverters as all Envoy-S will have inverters.

jesserizzo commented 4 years ago

@gtdiehl Do I need to put a new build with your two PRs up in PyPi?

jesserizzo commented 4 years ago

Also, just remembering why I went with the eim numbers in the first place. They update second by second, the inverter numbers update much less often (15 minutes I think). Would it be too much trouble to try production = raw_json["production"][1]["wNow"] and if that doesn't exist fall back to production = raw_json["production"][0]["wNow"]

gtdiehl commented 4 years ago

@jesserizzo I can work on this one a bit more. Maybe try and fall back if the oeim wNow not available to the inverter wNow. Can you build a new library for PyPi without this change for now, just the other change for the exception message?

jesserizzo commented 4 years ago

@gtdiehl Ok, that's up at PyPi, version 0.11.0

gtdiehl commented 4 years ago

This seemed to me the quickest and cleanest way to get wNow information from the inverter section if the eim section is not available. Closes #14