Code by Scott שאול בן ישוע
Verified Commit 646a6696 authored by Sha'ul ben Yeshua's avatar Sha'ul ben Yeshua 🎗
Browse files

fixede utf8 encoding

parent ded24ece
...@@ -60,7 +60,7 @@ metadata { ...@@ -60,7 +60,7 @@ metadata {
attribute "WeewxUptime", "string" attribute "WeewxUptime", "string"
attribute "WeewxLocation", "string" attribute "WeewxLocation", "string"
attribute "Refresh-Weewx", "string" attribute "Refresh-Weewx", "string"
attribute "WeatherDisplay", "string" attribute "WeatherDisplay", "string"
// Units // Units
attribute "distanceUnit", "string" attribute "distanceUnit", "string"
...@@ -105,7 +105,7 @@ metadata { ...@@ -105,7 +105,7 @@ metadata {
input "pressureUnit", "enum", title: "Pressure Unit", required:true, defaultValue: "INHg", options: ["INHg", "MBAR"] input "pressureUnit", "enum", title: "Pressure Unit", required:true, defaultValue: "INHg", options: ["INHg", "MBAR"]
input "rainUnit", "enum", title: "Rain Unit", required:true, defaultValue: "IN", options: ["IN", "MM"] input "rainUnit", "enum", title: "Rain Unit", required:true, defaultValue: "IN", options: ["IN", "MM"]
input "speedUnit", "enum", title: "Distance & Speed Unit", required:true, defaultValue: "Miles (MPH)", options: ["Miles (MPH)", "Kilometers (KPH)"] input "speedUnit", "enum", title: "Distance & Speed Unit", required:true, defaultValue: "Miles (MPH)", options: ["Miles (MPH)", "Kilometers (KPH)"]
input "temperatureUnit", "enum", title: "Temperature Unit", required:true, defaultValue: "Fahrenheit (F)", options: ["Fahrenheit (F)", "Celsius (C)"] input "temperatureUnit", "enum", title: "Temperature Unit", required:true, defaultValue: "Fahrenheit (°F)", options: ["Fahrenheit (°F)", "Celsius (°C)"]
input "decimalUnit", "enum", title: "Max Decimal Places", required:true, defaultValue: "2", options: ["1", "2", "3", "4", "5"] input "decimalUnit", "enum", title: "Max Decimal Places", required:true, defaultValue: "2", options: ["1", "2", "3", "4", "5"]
} }
...@@ -181,7 +181,7 @@ def updated() { ...@@ -181,7 +181,7 @@ def updated() {
units() units()
PollStation() PollStation()
def pollIntervalCmd = (settings?.pollInterval ?: "3 Hours").replace(" ", "") def pollIntervalCmd = (settings?.pollInterval ?: "3 Hours").replace(" ", "")
if(pollInterval == "Manual Poll Only"){LOGINFO( "MANUAL POLLING ONLY")} if(pollInterval == "Manual Poll Only"){/*LOGINFO( "MANUAL POLLING ONLY")*/}
else{ "runEvery${pollIntervalCmd}"(pollSchedule)} else{ "runEvery${pollIntervalCmd}"(pollSchedule)}
} }
...@@ -297,12 +297,12 @@ def PollStation() ...@@ -297,12 +297,12 @@ def PollStation()
if (dewpointRaw1.contains("F")) { if (dewpointRaw1.contains("F")) {
dewpointRaw1 = dewpointRaw1.replace(fcode, "") dewpointRaw1 = dewpointRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.Dewpoint = dewpointRaw1 state.Dewpoint = dewpointRaw1
LOGINFO("Dewpoint Input = F - Output = F -- No conversion required") LOGINFO("Dewpoint Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def dewpoint1 = convertFtoC(dewpointRaw1) def dewpoint1 = convertFtoC(dewpointRaw1)
state.Dewpoint = dewpoint1 state.Dewpoint = dewpoint1
...@@ -313,12 +313,12 @@ def PollStation() ...@@ -313,12 +313,12 @@ def PollStation()
if (dewpointRaw1.contains("C")) { if (dewpointRaw1.contains("C")) {
dewpointRaw1 = dewpointRaw1.replace(ccode, "") dewpointRaw1 = dewpointRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def dewpoint1 = convertCtoF(dewpointRaw1) def dewpoint1 = convertCtoF(dewpointRaw1)
state.Dewpoint = dewpoint1 state.Dewpoint = dewpoint1
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.Dewpoint = dewpointRaw1 state.Dewpoint = dewpointRaw1
LOGINFO("Dewpoint Input = C - Output = C -- No conversion required" ) LOGINFO("Dewpoint Input = C - Output = C -- No conversion required" )
...@@ -453,13 +453,13 @@ def PollStation() ...@@ -453,13 +453,13 @@ def PollStation()
if (insideTemperatureRaw1.contains("F")) { if (insideTemperatureRaw1.contains("F")) {
insideTemperatureRaw1 = insideTemperatureRaw1.replace(fcode, "") insideTemperatureRaw1 = insideTemperatureRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.InsideTemp = insideTemperatureRaw1 state.InsideTemp = insideTemperatureRaw1
LOGINFO("InsideTemperature Input = F - Output = F -- No conversion required") LOGINFO("InsideTemperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def insideTemp1 = convertFtoC(insideTemperatureRaw1) def insideTemp1 = convertFtoC(insideTemperatureRaw1)
state.InsideTemp = insideTemp1 state.InsideTemp = insideTemp1
...@@ -471,12 +471,12 @@ def PollStation() ...@@ -471,12 +471,12 @@ def PollStation()
if (insideTemperatureRaw1.contains("C")) { if (insideTemperatureRaw1.contains("C")) {
insideTemperatureRaw1 = insideTemperatureRaw1.replace(ccode, "") insideTemperatureRaw1 = insideTemperatureRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def insideTemp1 = convertCtoF(insideTemperatureRaw1) def insideTemp1 = convertCtoF(insideTemperatureRaw1)
state.InsideTemp = insideTemp1 state.InsideTemp = insideTemp1
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.InsideTemp = insideTemperatureRaw1 state.InsideTemp = insideTemperatureRaw1
LOGINFO( "InsideTemperature Input = C - Output = C --No conversion required") LOGINFO( "InsideTemperature Input = C - Output = C --No conversion required")
...@@ -572,13 +572,13 @@ def PollStation() ...@@ -572,13 +572,13 @@ def PollStation()
if (temperatureRaw1.contains("F")) { if (temperatureRaw1.contains("F")) {
temperatureRaw1 = temperatureRaw1.replace(fcode, "") temperatureRaw1 = temperatureRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.Temperature = temperatureRaw1 state.Temperature = temperatureRaw1
LOGINFO("Temperature Input = F - Output = F -- No conversion required") LOGINFO("Temperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def temp1 = convertFtoC(temperatureRaw1) def temp1 = convertFtoC(temperatureRaw1)
state.Temperature = temp1 state.Temperature = temp1
...@@ -590,12 +590,12 @@ def PollStation() ...@@ -590,12 +590,12 @@ def PollStation()
if (temperatureRaw1.contains("C")) { if (temperatureRaw1.contains("C")) {
temperatureRaw1 = temperatureRaw1.replace(ccode, "") temperatureRaw1 = temperatureRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def temp1 = convertCtoF(temperatureRaw1) def temp1 = convertCtoF(temperatureRaw1)
state.Temperature = temp1 state.Temperature = temp1
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.Temperature = temperatureRaw1 state.Temperature = temperatureRaw1
LOGINFO("Temperature Input = C - Output = C --No conversion required") LOGINFO("Temperature Input = C - Output = C --No conversion required")
...@@ -614,13 +614,13 @@ def PollStation() ...@@ -614,13 +614,13 @@ def PollStation()
if (tempMinRaw1.contains("F")) { if (tempMinRaw1.contains("F")) {
tempMinRaw1 = tempMinRaw1.replace(fcode, "") tempMinRaw1 = tempMinRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.MinTemperature = tempMinRaw1 state.MinTemperature = tempMinRaw1
LOGINFO("Min Temperature Input = F - Output = F -- No conversion required") LOGINFO("Min Temperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def tempMin = convertFtoC(tempMinRaw1) def tempMin = convertFtoC(tempMinRaw1)
state.MinTemperature = tempMin state.MinTemperature = tempMin
...@@ -632,12 +632,12 @@ def PollStation() ...@@ -632,12 +632,12 @@ def PollStation()
if (tempMinRaw1.contains("C")) { if (tempMinRaw1.contains("C")) {
tempMinRaw1 = tempMinRaw1.replace(ccode, "") tempMinRaw1 = tempMinRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def tempMin = convertCtoF(tempMinRaw1) def tempMin = convertCtoF(tempMinRaw1)
state.MinTemperature = tempMin state.MinTemperature = tempMin
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.MinTemperature = tempMinRaw1 state.MinTemperature = tempMinRaw1
LOGINFO("Min Temperature Input = C - Output = C --No conversion required") LOGINFO("Min Temperature Input = C - Output = C --No conversion required")
...@@ -656,13 +656,13 @@ def PollStation() ...@@ -656,13 +656,13 @@ def PollStation()
if (tempMaxRaw1.contains("F")) { if (tempMaxRaw1.contains("F")) {
tempMaxRaw1 = tempMaxRaw1.replace(fcode, "") tempMaxRaw1 = tempMaxRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.MaxTemperature = tempMaxRaw1 state.MaxTemperature = tempMaxRaw1
LOGINFO("Max Temperature Input = F - Output = F -- No conversion required") LOGINFO("Max Temperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def tempMax = convertFtoC(tempMaxRaw1) def tempMax = convertFtoC(tempMaxRaw1)
state.MaxTemperature = tempMax state.MaxTemperature = tempMax
...@@ -674,12 +674,12 @@ def PollStation() ...@@ -674,12 +674,12 @@ def PollStation()
if (tempMaxRaw1.contains("C")) { if (tempMaxRaw1.contains("C")) {
tempMaxRaw1 = tempMaxRaw1.replace(ccode, "") tempMaxRaw1 = tempMaxRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def tempMax = convertCtoF(tempMaxRaw1) def tempMax = convertCtoF(tempMaxRaw1)
state.MaxTemperature = tempMax state.MaxTemperature = tempMax
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.MaxTemperature = tempMaxRaw1 state.MaxTemperature = tempMaxRaw1
LOGINFO("Max Temperature Input = C - Output = C --No conversion required") LOGINFO("Max Temperature Input = C - Output = C --No conversion required")
...@@ -697,13 +697,13 @@ def PollStation() ...@@ -697,13 +697,13 @@ def PollStation()
if (tempMinInRaw1.contains("F")) { if (tempMinInRaw1.contains("F")) {
tempMinInRaw1 = tempMinInRaw1.replace(fcode, "") tempMinInRaw1 = tempMinInRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.MinInsideTemperature = tempMinInRaw1 state.MinInsideTemperature = tempMinInRaw1
LOGINFO("Min Temperature Input = F - Output = F -- No conversion required") LOGINFO("Min Temperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def tempMinIn = convertFtoC(tempMinInRaw1) def tempMinIn = convertFtoC(tempMinInRaw1)
state.MinInsideTemperature = tempMinIn state.MinInsideTemperature = tempMinIn
...@@ -715,12 +715,12 @@ def PollStation() ...@@ -715,12 +715,12 @@ def PollStation()
if (tempMinInRaw1.contains("C")) { if (tempMinInRaw1.contains("C")) {
tempMinInRaw1 = tempMinInRaw1.replace(ccode, "") tempMinInRaw1 = tempMinInRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def tempMinIn = convertCtoF(tempMinInRaw1) def tempMinIn = convertCtoF(tempMinInRaw1)
state.MinInsideTemperature = tempMinIn state.MinInsideTemperature = tempMinIn
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.MinInsideTemperature = tempMinInRaw1 state.MinInsideTemperature = tempMinInRaw1
LOGINFO("Min Temperature Input = C - Output = C --No conversion required") LOGINFO("Min Temperature Input = C - Output = C --No conversion required")
...@@ -739,13 +739,13 @@ def PollStation() ...@@ -739,13 +739,13 @@ def PollStation()
if (tempMaxInRaw1.contains("F")) { if (tempMaxInRaw1.contains("F")) {
tempMaxInRaw1 = tempMaxInRaw1.replace(fcode, "") tempMaxInRaw1 = tempMaxInRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.MaxInsideTemperature = tempMaxInRaw1 state.MaxInsideTemperature = tempMaxInRaw1
LOGINFO("Max Temperature Input = F - Output = F -- No conversion required") LOGINFO("Max Temperature Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def tempMaxIn = convertFtoC(tempMaxInRaw1) def tempMaxIn = convertFtoC(tempMaxInRaw1)
state.MaxInsideTemperature = tempMaxIn state.MaxInsideTemperature = tempMaxIn
...@@ -757,12 +757,12 @@ def PollStation() ...@@ -757,12 +757,12 @@ def PollStation()
if (tempMaxInRaw1.contains("C")) { if (tempMaxInRaw1.contains("C")) {
tempMaxInRaw1 = tempMaxInRaw1.replace(ccode, "") tempMaxInRaw1 = tempMaxInRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def tempMaxIn = convertCtoF(tempMaxInRaw1) def tempMaxIn = convertCtoF(tempMaxInRaw1)
state.MaxInsideTemperature = tempMaxIn state.MaxInsideTemperature = tempMaxIn
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.MaxInsideTemperature = tempMaxInRaw1 state.MaxInsideTemperature = tempMaxInRaw1
LOGINFO("Max Temperature Input = C - Output = C --No conversion required") LOGINFO("Max Temperature Input = C - Output = C --No conversion required")
...@@ -821,13 +821,13 @@ def PollStation() ...@@ -821,13 +821,13 @@ def PollStation()
if (windChillRaw1.contains("F")) { if (windChillRaw1.contains("F")) {
windChillRaw1 = windChillRaw1.replace(fcode, "") windChillRaw1 = windChillRaw1.replace(fcode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
state.FeelsLike = windChillRaw1 state.FeelsLike = windChillRaw1
LOGINFO( "FeelsLike Input = F - Output = F -- No conversion required") LOGINFO( "FeelsLike Input = F - Output = F -- No conversion required")
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
def feelslike1 = convertFtoC(windChillRaw1) def feelslike1 = convertFtoC(windChillRaw1)
state.FeelsLike = feelslike1 state.FeelsLike = feelslike1
...@@ -839,12 +839,12 @@ def PollStation() ...@@ -839,12 +839,12 @@ def PollStation()
if (windChillRaw1.contains("C")) { if (windChillRaw1.contains("C")) {
windChillRaw1 = windChillRaw1.replace(ccode, "") windChillRaw1 = windChillRaw1.replace(ccode, "")
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
state.TU = '°F' state.TU = '°F'
def feelslike1 = convertCtoF(windChillRaw1) def feelslike1 = convertCtoF(windChillRaw1)
state.FeelsLike = feelslike1 state.FeelsLike = feelslike1
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
state.TU = '°C' state.TU = '°C'
state.FeelsLike = windChillRaw1 state.FeelsLike = windChillRaw1
LOGINFO( "FeelsLike Input = C - Output = C --No conversion required") LOGINFO( "FeelsLike Input = C - Output = C --No conversion required")
...@@ -1179,10 +1179,10 @@ def tempColour(){ ...@@ -1179,10 +1179,10 @@ def tempColour(){
if(tempColour1 == true){ if(tempColour1 == true){
state.temperature = state.Temperature.toDouble() state.temperature = state.Temperature.toDouble()
state.feelslike = state.FeelsLike.toDouble() state.feelslike = state.FeelsLike.toDouble()
if(temperatureUnit == "Fahrenheit (F)"){ if(temperatureUnit == "Fahrenheit (°F)"){
} }
if(temperatureUnit == "Celsius (C)"){ if(temperatureUnit == "Celsius (°C)"){
if(state.temperature < 0){state.fc = 046AF4} if(state.temperature < 0){state.fc = 046AF4}
if(state.feelslike < 0){state.fc = 046AF4} if(state.feelslike < 0){state.fc = 046AF4}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment