Skip to content

Commit

Permalink
Fix for locale
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-developer committed Dec 21, 2023
1 parent 7174b5f commit 61191ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion allsky_influxdb/allsky_influxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions allsky_sqm/allsky_sqm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 61191ce

Please sign in to comment.