Merge pull request #59 from erickellerek1/patch-1

fixup Client and MQTTClient calls
This commit is contained in:
brentrubell 2018-07-16 13:58:27 -04:00 committed by GitHub
commit 34a8bc0638
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@ Here's a short example of how to send a new value to a feed (creating the feed i
# Import library and create instance of REST client. # Import library and create instance of REST client.
from Adafruit_IO import Client from Adafruit_IO import Client
aio = Client('YOUR ADAFRUIT IO KEY') aio = Client('YOUR ADAFRUIT USER', 'YOUR ADAFRUIT IO KEY')
# Send the value 100 to a feed called 'Foo'. # Send the value 100 to a feed called 'Foo'.
aio.send('Foo', 100) aio.send('Foo', 100)
@ -41,17 +41,20 @@ Then a REST API client can be created with code like:
.. code-block:: python .. code-block:: python
aio = Client('xxxxxxxxxxxx') aio = Client('user', 'xxxxxxxxxxxx')
Where ``'xxxxxxxxxxxx'`` is your Adafruit IO API key. Where ``'xxxxxxxxxxxx'`` is your Adafruit IO API key.
Where ``'user'`` is your Adafruit username.
Alternatively an MQTT client can be created with code like: Alternatively an MQTT client can be created with code like:
.. code-block:: python .. code-block:: python
mqtt = MQTTClient('xxxxxxxxxxxx') mqtt = MQTTClient('user', 'xxxxxxxxxxxx')
Again where ``'xxxxxxxxxxxx'`` is your Adafruit IO API key. Again where ``'xxxxxxxxxxxx'`` is your Adafruit IO API key.
Again where ``'user'`` is your Adafruit username.
Your program can use either or both the REST API client and MQTT client, depending on your needs. Your program can use either or both the REST API client and MQTT client, depending on your needs.