mirror of
https://github.com/home-assistant/core.git
synced 2025-07-12 15:57:06 +00:00
Address missed review comments for Dark Sky weather (#11520)
See #11435
This commit is contained in:
parent
bccd880395
commit
c53fc94e84
@ -2,7 +2,7 @@
|
|||||||
Patform for retrieving meteorological data from Dark Sky.
|
Patform for retrieving meteorological data from Dark Sky.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation
|
For more details about this platform, please refer to the documentation
|
||||||
https://home-assistant.io/components/
|
https://home-assistant.io/components/weather.darksky/
|
||||||
"""
|
"""
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
@ -133,13 +133,12 @@ class DarkSkyWeather(WeatherEntity):
|
|||||||
return self._ds_daily.summary
|
return self._ds_daily.summary
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the state attributes."""
|
"""Return the state attributes."""
|
||||||
attrs = super().state_attributes
|
attrs = {
|
||||||
attrs.update({
|
|
||||||
ATTR_DAILY_FORECAST_SUMMARY: self.daily_forecast_summary,
|
ATTR_DAILY_FORECAST_SUMMARY: self.daily_forecast_summary,
|
||||||
ATTR_HOURLY_FORECAST_SUMMARY: self.hourly_forecast_summary
|
ATTR_HOURLY_FORECAST_SUMMARY: self.hourly_forecast_summary
|
||||||
})
|
}
|
||||||
return attrs
|
return attrs
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
|
@ -49,3 +49,6 @@ class TestDarkSky(unittest.TestCase):
|
|||||||
|
|
||||||
state = self.hass.states.get('weather.test')
|
state = self.hass.states.get('weather.test')
|
||||||
self.assertEqual(state.state, 'Clear')
|
self.assertEqual(state.state, 'Clear')
|
||||||
|
self.assertEqual(state.attributes['daily_forecast_summary'],
|
||||||
|
'No precipitation throughout the week, with '
|
||||||
|
'temperatures falling to 66°F on Thursday.')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user