fcdfebefd9d452952d16669c1257292865d7405b,homeassistant/components/sensor/wunderground.py,WUndergroundSensor,device_state_attributes,#WUndergroundSensor#,175

Before Change


            return attrs

        multiple_alerts = len(self.rest.alerts) > 1
        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
    def entity_picture(self):

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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: wandb/client
Commit Name: 949013a076a317ce3eb45e6c6ab0eb0bcc3941f7
Time: 2020-08-27
Author: annirudh@wandb.com
File Name: wandb/filesync/step_upload.py
Class Name: StepUpload
Method Name: _maybe_commit_artifact


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