Aggiunto altre condizioni temporali oltre alla pioggia su check_rain_online
This commit is contained in:
10
piGarden.sh
10
piGarden.sh
@@ -246,12 +246,20 @@ function check_rain_online {
|
|||||||
local weather=`cat /tmp/check_rain_online.json | $JQ -M ".current_observation.weather"`
|
local weather=`cat /tmp/check_rain_online.json | $JQ -M ".current_observation.weather"`
|
||||||
local local_epoch=`cat /tmp/check_rain_online.json | $JQ -M -r ".current_observation.local_epoch"`
|
local local_epoch=`cat /tmp/check_rain_online.json | $JQ -M -r ".current_observation.local_epoch"`
|
||||||
#echo $weather
|
#echo $weather
|
||||||
|
#weather="[Light/Heavy] Drizzle"
|
||||||
if [ "$weather" = "null" ]; then
|
if [ "$weather" = "null" ]; then
|
||||||
log_write "check_rain_online - failed read online data"
|
log_write "check_rain_online - failed read online data"
|
||||||
else
|
else
|
||||||
log_write "check_rain_online - weather=$weather, local_epoch=$local_epoch"
|
log_write "check_rain_online - weather=$weather, local_epoch=$local_epoch"
|
||||||
#if [[ "$weather" == *"Clear"* ]]; then
|
#if [[ "$weather" == *"Clear"* ]]; then
|
||||||
if [[ "$weather" == *"Rain"* ]]; then
|
#if [[ "$weather" == *"Rain"* ]]; then
|
||||||
|
if [[ "$weather" == *"Rain"* ]] ||
|
||||||
|
[[ "$weather" == *"Snow"* ]] ||
|
||||||
|
[[ "$weather" == *"Hail"* ]] ||
|
||||||
|
[[ "$weather" == *"Ice"* ]] ||
|
||||||
|
[[ "$weather" == *"Thunderstorm"* ]] ||
|
||||||
|
[[ "$weather" == *"Drizzle"* ]];
|
||||||
|
then
|
||||||
#echo "ECCOMI!!!!!"
|
#echo "ECCOMI!!!!!"
|
||||||
echo $local_epoch > "$STATUS_DIR/last_rain_online"
|
echo $local_epoch > "$STATUS_DIR/last_rain_online"
|
||||||
return $local_epoch
|
return $local_epoch
|
||||||
|
|||||||
Reference in New Issue
Block a user