mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Improve tests for AccuWeather integration (#38621)
* Add more tests * Add tests for sensor platform * Add more tests * More tests * Simplify parsing of attributes * Change Quality scale to platinum * Patch the library in the manual update entity test * Add unsupported condition icon test * Do not patch _async_get_data * Apply suggestions from code review * Update config_flow.py * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Update tests/components/accuweather/test_weather.py * Apply suggestions from code review * Add return_value Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
@@ -154,11 +154,7 @@ class AccuWeatherSensor(Entity):
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
if self.forecast_day is not None:
|
||||
if self.kind == "WindGustDay":
|
||||
self._attrs["direction"] = self.coordinator.data[ATTR_FORECAST][
|
||||
self.forecast_day
|
||||
][self.kind]["Direction"]["English"]
|
||||
elif self.kind == "WindGustNight":
|
||||
if self.kind in ["WindGustDay", "WindGustNight"]:
|
||||
self._attrs["direction"] = self.coordinator.data[ATTR_FORECAST][
|
||||
self.forecast_day
|
||||
][self.kind]["Direction"]["English"]
|
||||
|
||||
Reference in New Issue
Block a user