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

code re-write and removed all ST code

parent ae3e790b
Pipeline #227 passed with stage
in 2 seconds
......@@ -96,6 +96,7 @@ metadata {
attribute "DriverAuthor", "string"
attribute "DriverStatus", "string"
attribute "LastRefresh", "string"
attribute "LastUpdate", "string"
attribute "osName", "string"
attribute "online", "string"
}
......@@ -137,7 +138,6 @@ def updated() {
log.info "Refresh set to polling only"
}
if (debugOutput) runIn(1800,logsOff)
state.LastRefresh = new Date().format("YYYY/MM/dd \n HH:mm:ss", location.timeZone)
version()
updateDataValue("ip", ip)
......@@ -176,6 +176,7 @@ try {
logDebug "response data: ${resp.data}"
sendEvent(name: "online", value: "Online")
if (json.containsKey("cpuTemperature")) {
if (getTemperatureScale() == "C") {
sendEvent(name: "temperature", value: json.cpuTemperature)
......@@ -220,6 +221,16 @@ try {
if (json.containsKey("osName")) {
sendEvent(name: "osName", value: json.osName)
}
if (locale == "UK") {
if (debugOutput) log.info "Get last UK Date DD/MM/YYYY"
state.LastUpdate = new Date().format("d/MM/YYYY \n HH:mm:ss", location.timeZone)
sendEvent(name: "LastLastUpdate", value: state.LastLastUpdate, descriptionText: "Last update performed")
}
if (locale == "US") {
if (debugOutput) log.info "Get last US Date MM/DD/YYYY"
state.LastUpdate = new Date().format("MM/d/YYYY \n HH:mm:ss", location.timeZone)
sendEvent(name: "LastUpdate", value: state.LastUpdate, descriptionText: "Last update performed")
}
} // End try
} catch (e) {
......
Markdown is supported
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