mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fixing OpenWeatherMap Sensor. Current weather is 'unknown' if forecast: false. It was reported as #8640. (#11417)
This commit is contained in:
parent
feb70b47df
commit
0a67195529
@ -136,7 +136,7 @@ class OpenWeatherMapSensor(Entity):
|
|||||||
data = self.owa_client.data
|
data = self.owa_client.data
|
||||||
fc_data = self.owa_client.fc_data
|
fc_data = self.owa_client.fc_data
|
||||||
|
|
||||||
if data is None or fc_data is None:
|
if data is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.type == 'weather':
|
if self.type == 'weather':
|
||||||
@ -174,6 +174,8 @@ class OpenWeatherMapSensor(Entity):
|
|||||||
self._state = 'not snowing'
|
self._state = 'not snowing'
|
||||||
self._unit_of_measurement = ''
|
self._unit_of_measurement = ''
|
||||||
elif self.type == 'forecast':
|
elif self.type == 'forecast':
|
||||||
|
if fc_data is None:
|
||||||
|
return
|
||||||
self._state = fc_data.get_weathers()[0].get_status()
|
self._state = fc_data.get_weathers()[0].get_status()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user