It's ­čÉŹCircuitPython Monday­čÉŹ at Adafruit! Use the code ADATY to get 20% off CircuitPython and 15% off items storewide!
0

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.
Please be positive and constructive with your questions and comments.

Change Min Max in program

by AstroGuy on Sat Oct 16, 2021 2:01 pm

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

AstroGuy
 
Posts: 13
Joined: Mon Dec 15, 2014 1:42 pm

Re: Change Min Max in program

by brubell on Mon Oct 18, 2021 9:38 am

Which library are you working with?

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

brubell
 
Posts: 1557
Joined: Fri Jul 17, 2015 10:33 pm

Re: Change Min Max in program

by AstroGuy on Mon Oct 18, 2021 4:31 pm

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....

AstroGuy
 
Posts: 13
Joined: Mon Dec 15, 2014 1:42 pm

Re: Change Min Max in program

by jwcooper on Mon Oct 18, 2021 4:46 pm

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.

jwcooper
 
Posts: 823
Joined: Tue May 01, 2012 9:08 pm

Re: Change Min Max in program

by AstroGuy on Wed Oct 20, 2021 3:17 pm

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

AstroGuy
 
Posts: 13
Joined: Mon Dec 15, 2014 1:42 pm

Re: Change Min Max in program

by jwcooper on Thu Oct 21, 2021 2:47 pm

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

jwcooper
 
Posts: 823
Joined: Tue May 01, 2012 9:08 pm

Please be positive and constructive with your questions and comments.