watchforstock / evohome-client

Python client to access the Evohome web service
Apache License 2.0
88 stars 52 forks source link

Unable to update controlsystem and hotwater settings #6

Closed fullTalgoRythm closed 9 years ago

fullTalgoRythm commented 9 years ago

A couple of minor problems found trying to run the client..

If you're interested a patch for Domoticz is now available supporting this client http://www.domoticz.com/wiki/Evohome

diff --git a/evohomeclient2/controlsystem.py b/evohomeclient2/controlsystem.py
index f8e195b..14b8ecf 100644
--- a/evohomeclient2/controlsystem.py
+++ b/evohomeclient2/controlsystem.py
@@ -1,4 +1,5 @@
 import json
+import requests

 from zone import Zone
 from hotwater import HotWater
@@ -34,7 +35,7 @@ class ControlSystem(EvohomeBase):

     def _set_status(self, mode, until=None):

-        headers = dict(self.headers)
+        headers = dict(self.client.headers)
         headers['Content-Type'] = 'application/json'

         if until is None:
diff --git a/evohomeclient2/hotwater.py b/evohomeclient2/hotwater.py
index b7b60fb..c3c6954 100644
--- a/evohomeclient2/hotwater.py
+++ b/evohomeclient2/hotwater.py
@@ -1,3 +1,4 @@
+import json
 import requests

 from zone import ZoneBase
watchforstock commented 9 years ago

Thanks, have now merged these changes into the core code - thanks for your report!