diff --git a/allsky_influxdb/allsky_influxdb.py b/allsky_influxdb/allsky_influxdb.py index 237d019..4117162 100755 --- a/allsky_influxdb/allsky_influxdb.py +++ b/allsky_influxdb/allsky_influxdb.py @@ -143,7 +143,7 @@ def createJSONData(values): if var.startswith("AS_") or var.startswith("ALLSKY_"): if var in vars: try: - fields[var] = s.float(s.getEnvironmentVariable(var)) + fields[var] = s.asfloat(s.getEnvironmentVariable(var)) except: pass diff --git a/allsky_sqm/allsky_sqm.py b/allsky_sqm/allsky_sqm.py index f905f62..0f38322 100755 --- a/allsky_sqm/allsky_sqm.py +++ b/allsky_sqm/allsky_sqm.py @@ -91,7 +91,7 @@ def addInternals(ALLOWED_NAMES): for internal in internals: val = s.getEnvironmentVariable(internal) key = internal.replace('AS_', '') - ALLOWED_NAMES[key] = s.float(val) + ALLOWED_NAMES[key] = s.asfloat(val) return ALLOWED_NAMES @@ -173,10 +173,10 @@ def sqm(params, event): if debug: s.writeDebugImage(metaData["module"], "cropped-image.png", croppedImage) - maxExposure_s = s.float(s.getSetting("nightmaxautoexposure")) / 1000 - exposure_s = s.float(s.getEnvironmentVariable("AS_EXPOSURE_US")) / 1000 / 1000 - maxGain = s.float(s.getSetting("nightmaxautogain")) - gain = s.float(s.getEnvironmentVariable("AS_GAIN")) + maxExposure_s = s.asfloat(s.getSetting("nightmaxautoexposure")) / 1000 + exposure_s = s.asfloat(s.getEnvironmentVariable("AS_EXPOSURE_US")) / 1000 / 1000 + maxGain = s.asfloat(s.getSetting("nightmaxautogain")) + gain = s.asfloat(s.getEnvironmentVariable("AS_GAIN")) sqmAvg = cv2.mean(src=croppedImage)[0] weightedSqmAvg = (((maxExposure_s - exposure_s) / 10) + 1) * (sqmAvg * (((maxGain - gain) / 10) + 1))