Browse Source

adding weather max min temperature display

Zheng 4 years ago
parent
commit
ff3a199e35

+ 4 - 4
oboo-clock-cards/src/oboo-runtime/js/yahooWeather.js

@@ -54,9 +54,9 @@ function getYahooWeather (location, tempUnit, distanceUnit) {
 	        		value: jsonResult.main.humidity
 	        	},
 	        	{
-	        		type: 'pressure',
-	        		unit: 'hPa',
-	        		value: jsonResult.main.pressure
+	        		type: 'temp-hi-lo',
+	        		unit: convertTemp(jsonResult.main.temp_min, tempUnit) + tempUnit[0],
+	        		value: convertTemp(jsonResult.main.temp_max, tempUnit)
 	        	}
 	        ]
 	    }
@@ -66,4 +66,4 @@ function getYahooWeather (location, tempUnit, distanceUnit) {
 	else {
 		return null;
 	}
-}
+}

BIN
oboo-clock-cards/src/weather-card/img/bin/img_temp-hi-lo.bin


BIN
oboo-clock-cards/src/weather-card/img/png/temp-hi-lo.png


+ 61 - 0
oboo-clock-cards/src/weather-card/img/svg/old/temp-hi-lo.svg

@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 60 60" style="enable-background:new 0 0 60 60;" xml:space="preserve">
+<style type="text/css">
+	.st0{fill:#D8D8D8;}
+	.st1{fill:#F3E8D7;}
+	.st2{fill:#FC4E51;}
+	.st3{fill:#0D6E9A;}
+	.st4{fill:#E5394B;}
+	.st5{fill:#FFFFFF;}
+</style>
+<g>
+	<path class="st0" d="M17.7,47.3c0,7,5.7,12.7,12.7,12.7s12.7-5.7,12.7-12.7c0-4.3-2.1-8.1-5.4-10.4V7.3c0-4-3.3-7.3-7.3-7.3
+		c-4,0-7.3,3.3-7.3,7.3V37C19.8,39.2,17.7,43,17.7,47.3z"/>
+	<path class="st1" d="M21.6,47.1c0-3.7,2.3-6.9,5.7-8.2V7.3c0-1.7,1.4-3.1,3.1-3.1c1.7,0,3.1,1.4,3.1,3.1v31.6
+		c3.4,1.3,5.7,4.5,5.7,8.2c0,4.8-3.9,8.8-8.8,8.8S21.6,51.9,21.6,47.1z"/>
+	<path class="st2" d="M27.3,12.9v26c-3.4,1.3-5.7,4.5-5.7,8.2c0,4.8,3.9,8.8,8.8,8.8s8.8-3.9,8.8-8.8c0-3.7-2.3-6.9-5.7-8.2v-26
+		H27.3z"/>
+	<g>
+		<path class="st3" d="M12.1,20.2c0-0.5,0.4-0.9,0.9-0.9h5.3c0.5,0,0.9,0.4,0.9,0.9s-0.4,0.9-0.9,0.9H13
+			C12.5,21.1,12.1,20.7,12.1,20.2z"/>
+		<path class="st3" d="M15,12.9c0-0.5,0.4-0.9,0.9-0.9h2.4c0.5,0,0.9,0.4,0.9,0.9s-0.4,0.9-0.9,0.9h-2.4C15.4,13.8,15,13.4,15,12.9z
+			"/>
+		<path class="st3" d="M14.1,5.5c0-0.5,0.4-0.9,0.9-0.9h3.2c0.5,0,0.9,0.4,0.9,0.9s-0.4,0.9-0.9,0.9H15C14.5,6.4,14.1,6,14.1,5.5z"
+			/>
+		<path class="st3" d="M14.1,34.9c0-0.5,0.4-0.9,0.9-0.9h3.2c0.5,0,0.9,0.4,0.9,0.9c0,0.5-0.4,0.9-0.9,0.9H15
+			C14.5,35.8,14.1,35.4,14.1,34.9z"/>
+		<path class="st3" d="M15,27.6c0-0.5,0.4-0.9,0.9-0.9h2.4c0.5,0,0.9,0.4,0.9,0.9s-0.4,0.9-0.9,0.9h-2.4C15.4,28.5,15,28.1,15,27.6z
+			"/>
+	</g>
+	<path class="st4" d="M21.6,47.1c0,4.8,3.9,8.8,8.8,8.8c1.4,0,2.6-0.3,3.8-0.9c-2.9-1.4-5-4.4-5-7.9c0-6.2,4.2-8.2,4.2-8.2v-26h-6.1
+		v26C23.9,40.2,21.6,43.4,21.6,47.1z"/>
+	<g>
+		<g>
+			<path class="st5" d="M41,4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51.1,37.2z M51.1,35.9c0.3,0,0.6-0.1,0.8-0.2c0.2-0.2,0.4-0.4,0.6-0.6
+				c0.2-0.3,0.3-0.5,0.3-0.9c0.1-0.3,0.1-0.6,0.1-1c0-0.3,0-0.7-0.1-1c-0.1-0.3-0.2-0.6-0.3-0.9s-0.3-0.5-0.6-0.6
+				c-0.2-0.2-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.2-0.4,0.4-0.6,0.6s-0.3,0.5-0.3,0.9c-0.1,0.3-0.1,0.7-0.1,1
+				c0,0.3,0,0.7,0.1,1c0.1,0.3,0.2,0.6,0.3,0.9c0.2,0.3,0.3,0.5,0.6,0.6C50.5,35.8,50.8,35.9,51.1,35.9z"/>
+		</g>
+	</g>
+</g>
+</svg>

+ 1 - 0
oboo-clock-cards/src/weather-card/weather.js

@@ -63,6 +63,7 @@ var weatherImg = {
     'wind-speed': 'wind-sign',
     'humidity': 'humidity',
     'pressure': 'pressure',
+    'temp-hi-lo': 'temp-hi-lo',
 
     separator: "line",
 }