소스 검색

weather-darksky: Don't output old forecasts

We can get historical forecast data back. For example, querying for
Toronto today (Sunday) gives Saturday. Skip this.
Will Storey 8 년 전
부모
커밋
d1bc1cb12d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      weather-darksky.tcl

+ 3 - 0
weather-darksky.tcl

@@ -274,6 +274,9 @@ proc ::wds::output_forecast {chan geonames darksky} {
 		if {$count == 5} {
 			break
 		}
+		if {[dict get $forecast time] < [clock seconds]} {
+			continue
+		}
 		if {$output != ""} {
 			append output " "
 		}