fcdfebefd9d452952d16669c1257292865d7405b,homeassistant/components/sensor/wunderground.py,WUndergroundSensor,device_state_attributes,#WUndergroundSensor#,175
Before Change
for data in self.rest.alerts:
for alert in ALERTS_ATTRS:
if data[alert]:
if multiple_alerts:
dkey = alert.capitalize() + "_" + data["type"]
else:
dkey = alert.capitalize()
attrs[dkey] = data[alert]
return attrs
@property
After Change
def device_state_attributes(self):
Return the state attributes.
attrs = self._cfg_expand("device_state_attributes", {})
for (attr, callback) in attrs.items():
try:
attrs[attr] = callback(self.rest)
except TypeError:
attrs[attr] = callback
attrs[ATTR_ATTRIBUTION] = CONF_ATTRIBUTION
attrs[ATTR_FRIENDLY_NAME] = self._cfg_expand("friendly_name")
return attrs
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: home-assistant/home-assistant
Commit Name: fcdfebefd9d452952d16669c1257292865d7405b
Time: 2017-05-07
Author: pezinek@gmail.com
File Name: homeassistant/components/sensor/wunderground.py
Class Name: WUndergroundSensor
Method Name: device_state_attributes
Project Name: home-assistant/home-assistant
Commit Name: 7a70496b116569c0581927ed30a5c884dc379c42
Time: 2017-05-06
Author: pezinek@gmail.com
File Name: homeassistant/components/sensor/wunderground.py
Class Name: WUndergroundSensor
Method Name: device_state_attributes
Project Name: matplotlib/matplotlib
Commit Name: 5cf1fa0fac2f4d0dfdd6aed3eb9f0a636d852d78
Time: 2020-10-02
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/widgets.py
Class Name: _SelectorWidget
Method Name: update_background