We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Add this patch to set your structure as away or not.
diff --git a/nest.py b/nest.py index 7fcf863..01de92d 100755 --- a/nest.py +++ b/nest.py @@ -17,6 +17,7 @@
+import time import urllib import urllib2 import sys @@ -131,6 +132,7 @@ class Nest:
def set_fan(self, state): data = '{"fan_mode":"' + str(state) + '"}'
print data req = urllib2.Request(self.transport_url + "/v2/put/device." + self.serial, data, {"user-agent":"Nest/1.1.0.10 CFNetwork/548.0.4",
@@ -141,6 +143,24 @@ class Nest:
print res
def set_away(self, state):
time_since_epoch = time.time()
# time_since_epoch = 1345299535
if (state == "away"):
data = '{"away_timestamp":' + str(time_since_epoch) + ',"away":true,"away_setter":0}'
else:
data = '{"away_timestamp":' + str(time_since_epoch) + ',"away":false,"away_setter":0}'
print data
req = urllib2.Request(self.transport_url + "/v2/put/structure." + self.structure_id,
data,
{"user-agent":"Nest/1.1.0.10 CFNetwork/548.0.4",
"Authorization":"Basic " + self.access_token,
"X-nl-protocol-version": "1"})
res = urllib2.urlopen(req).read()
def create_parser(): parser = OptionParser(usage="nest [options] command [command_options] [command_args]", description="Commands: fan temp", @@ -161,7 +181,6 @@ def create_parser(): parser.add_option("-i", "--index", dest="index", default=0, type="int", help="optional, specify index number of nest to talk to")
The text was updated successfully, but these errors were encountered:
I also added changes to a fork. https://github.com/RandyLevensalor/pynest.git
Sorry, something went wrong.
No branches or pull requests
Add this patch to set your structure as away or not.
diff --git a/nest.py b/nest.py
index 7fcf863..01de92d 100755
--- a/nest.py
+++ b/nest.py
@@ -17,6 +17,7 @@
Chris Burris's Siri Nest Proxy was very helpful to learn the nest's
authentication and some bits of the protocol.
+import time
import urllib
import urllib2
import sys
@@ -131,6 +132,7 @@ class Nest:
diff --git a/nest.py b/nest.py
index 7fcf863..01de92d 100755
--- a/nest.py
+++ b/nest.py
@@ -17,6 +17,7 @@
Chris Burris's Siri Nest Proxy was very helpful to learn the nest's
authentication and some bits of the protocol.
+import time
import urllib
import urllib2
import sys
@@ -131,6 +132,7 @@ class Nest:
@@ -141,6 +143,24 @@ class Nest:
def set_away(self, state):
def create_parser():
parser = OptionParser(usage="nest [options] command [command_options] [command_args]",
description="Commands: fan temp",
@@ -161,7 +181,6 @@ def create_parser():
parser.add_option("-i", "--index", dest="index", default=0, type="int",
help="optional, specify index number of nest to talk to")
The text was updated successfully, but these errors were encountered: