From 97eb70d12d92eb36bbf989437e0196e195c60005 Mon Sep 17 00:00:00 2001 From: Nick Stevens Date: Thu, 18 Sep 2014 14:25:33 -0500 Subject: [PATCH 1/2] Replace device.get_name with device.get_stream_id The README and index.rst call a nonexistant get_name() method on a Device object. The correct call is get_stream_id(). --- README.md | 2 +- docs/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0521767..e9ea70a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ for device in dc.devicecore.list_devices(): # This is done using the device cloud stream functionality for stream in dc.streams.get_streams(): if stream.get_data_type().lower() in ('float', 'double'): - print "%s -> %s" % (stream.get_name(), stream.get_current_value()) + print "%s -> %s" % (stream.get_stream_id(), stream.get_current_value()) ``` For more examples and detailed documentation, be sure to checkout out diff --git a/docs/index.rst b/docs/index.rst index e892d0d..9119adf 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -58,7 +58,7 @@ quick example of what the API looks like:: # This is done using the device cloud stream functionality for stream in dc.streams.get_streams(): if stream.get_data_type().lower() in ('float', 'double'): - print "%s -> %s" % (stream.get_name(), stream.get_current_value()) + print "%s -> %s" % (stream.get_stream_id(), stream.get_current_value()) Indices and tables ================== From a2d3b937d2c0704203c9fb6176ad7e4cc02bf03a Mon Sep 17 00:00:00 2001 From: Nick Stevens Date: Thu, 18 Sep 2014 14:27:00 -0500 Subject: [PATCH 2/2] Rename get_connected() to is_connected() The README and index.rst examples call a non-existant is_connected() method on Device. Rather than blindly changing the docs to match the code, the better solution in this case is to rename get_connected() to is_connected() to match the boolean return type of the method. --- devicecloud/devicecore.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicecloud/devicecore.py b/devicecloud/devicecore.py index 2058454..5ddcd2a 100644 --- a/devicecloud/devicecore.py +++ b/devicecloud/devicecore.py @@ -65,7 +65,7 @@ def get_tags(self, use_cached=True): else: return [] - def get_connected(self, use_cached=True): + def is_connected(self, use_cached=True): """Return True if the device is currrently connect and False if not""" device_json = self.get_device_json(use_cached) return int(device_json.get("dpConnectionStatus")) > 0