Change Min Max in program

Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Locked
User avatar
AstroGuy
 
Posts: 14
Joined: Mon Dec 15, 2014 1:42 pm

Change Min Max in program

Post by AstroGuy »

I would like to change the min and max settings of a feed on the fly (from within the program) using inputted data....

User avatar
brubell
Learn User Page
 
Posts: 2010
Joined: Fri Jul 17, 2015 10:33 pm

Re: Change Min Max in program

Post by brubell »

Which library are you working with?

What do you mean by "min and max settings of a feed"

User avatar
AstroGuy
 
Posts: 14
Joined: Mon Dec 15, 2014 1:42 pm

Re: Change Min Max in program

Post by AstroGuy »

this is not a library it is the IOT....I have a gauge as one feed that has a min of 0 and a max of 400...can I change that in my python code or do I need to change the gauge online every time I run my project....

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

Re: Change Min Max in program

Post by jwcooper »

You can edit blocks via the api. In that situation, you could programmatically update the min/max values of the gauge block.

Here is the documentation:
https://io.adafruit.com/api/docs/?shell#replace-a-block

One note, the "dashboard_id" in the api call should be the 'key'. We'll have to update that. For now, you can get the key by using the last value in the url when viewing your dashboard, or by getting the key from the dashboards API.

User avatar
AstroGuy
 
Posts: 14
Joined: Mon Dec 15, 2014 1:42 pm

Re: Change Min Max in program

Post by AstroGuy »

Thanks, but API docs mean nothing to me...I need examples in python but the examples in the api doc are useless.

User avatar
jwcooper
 
Posts: 1004
Joined: Tue May 01, 2012 9:08 pm

Re: Change Min Max in program

Post by jwcooper »

I don't believe our python clients support modifying blocks programmatically as this isn't a common use case.

We do accept pull requests, and you can find our python libraries below if you'd like to contribute this feature:
https://github.com/adafruit/Adafruit_Ci ... AdafruitIO
https://github.com/adafruit/Adafruit_IO_Python

Locked
Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.

Return to “Internet of Things: Adafruit IO and Wippersnapper”