animated gif - DaveL17/indigo-scripts GitHub Wiki

The animated gif script is used to generate a graphic that will display rotating text image. The script accomplishes this by starting with a base image that looks something like this (you can use effectively any image you like):

Blank Bar Graphic

It then takes the target text and creates a series of frames in turn...

Frame 1
Frame 2
Frame 3
Frame 4

...and assembles them into an animated gif with a delay between each frame.

Animated Bar Graphic

Using the Script

The script as presented is an example and will need to be updated for your particular needs. There are lots of ways that you can customize it, but these few things are of particular importance:

  • working folder
    The script default is the static image folder for Indigo 7. You should be able to use this out of the box or change it to any folder that Indigo can see.
    work_fldr = "/Library/Application\ Support/Perceptive\ Automation/Indigo\ 7/IndigoWebServer/images/controls/static/"

  • text list
    This is the most important bit. Change this list to include the sources for the text that you want for your graphic. It can be device states, variable values, etc. The sources must be strings, ints or floats (there may be other things that work, but these three types have been tested to work.) This sample text:

text_list = ["Upstairs Thermostat: 70°", 
             "Downstairs Thermostat: 68°", 
             "Outside Temperature: 68°", 
             "Up Time: 7 days, 12:38 [20:45]", 
             1.23]
             

Would look something like:

text_list = [indigo.devices[123456].states["temp"], 
             indigo.variables[123456].value, 
             "Foo"]
             
  • output command parameters
    • delay 300
      a positive value in hundredths of a second.
    • size 200x27
      the size of the base image (horizontal, vertical)
    • font arial
      the font used for the text
    • fill black
      the fill color for the text
    • pointsize 12
      the size of the text
    • annotate +10+17
      annotate adds the text, and the position of the text is controlled by (horizontal, vertical)
⚠️ **GitHub.com Fallback** ⚠️