Code by Scott שאול בן ישוע
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sha'ul ben Yeshua
raspberrypi.monitor
Commits
39b386a7
Verified
Commit
39b386a7
authored
Nov 16, 2019
by
Sha'ul ben Yeshua
🎗
Browse files
code re-write and removed all ST code
parent
ae3e790b
Pipeline
#227
passed with stage
in 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/Raspberry-Pi-Stats.groovy
View file @
39b386a7
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment