Forum Replies Created

Viewing 2 posts - 126 through 127 (of 127 total)
  • Author
    Posts
  • in reply to: Bug in weather_level_adj.py plugin #34749

    ShawnHarte
    Participant

    You could just use any variant of a safe float/int function for example:

    
    def safe_float(s,d):
    
      try:
    
        return float(s)
    
      except:
    
        return d

     

    Then just replace any instance of float in your script with safe_float(data, defaultfloat value)

     

     

     


    ShawnHarte
    Participant

    off topic – but relevant for sgruby – you posted your api key, you may want to regenerate it on weather underground, otherwise it may be used and put you over your limits.

Viewing 2 posts - 126 through 127 (of 127 total)