Heating and Ventilation Control
/HvcPV
Keine Erläuterungen gefunden.
import requests class HvcPV: def __init__( self, url="http://192.168.178.123/status.html" ): self.url = url self.user = "root" self.pwd = "root" def Read( self ): response = requests.get(self.url, auth=(self.user, self.pwd)) response = requests.get(self.url) if response.ok: for line in response.text.splitlines(): if line.strip().startswith("var webdata_now_p"): value = line.split("=")[-1].strip().strip(";").strip("\"") return float(value) else: return -1 if __name__ == "__main__": PV = HvcPV() P = PV.Read() if P>=0: print( P,"W" ) else: print( "Reading Solar Power failed!" )
python
php
Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.