Skip to content

Commit f49b4d1

Browse files
authored
修复极端天气警告没数据的问题
#14
1 parent 3c96463 commit f49b4d1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

custom_components/colorfulclouds/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ async def _async_update_data(self):
151151
try:
152152
async with timeout(10):
153153
start_timestamp = int((datetime.datetime.now()+datetime.timedelta(days=self.starttime)).timestamp())
154-
url = str.format("https://api.caiyunapp.com/{}/{}/{},{}/weather.json?dailysteps={}&hourlysteps={}&alert={}&unit={}&timestamp={}", self.api_version, self.api_key, self.longitude, self.latitude, self.dailysteps, self.hourlysteps, self.alert, self.is_metric, start_timestamp)
154+
url = str.format("https://api.caiyunapp.com/{}/{}/{},{}/weather.json?dailysteps={}&hourlysteps={}&alert={}&unit={}&timestamp={}", self.api_version, self.api_key, self.longitude, self.latitude, self.dailysteps, self.hourlysteps, str(self.alert).lower(), self.is_metric, start_timestamp)
155155
# json_text = requests.get(url).content
156156
resdata = await self.hass.async_add_executor_job(self.get_data, url)
157157
except (

0 commit comments

Comments
 (0)