addca54118fb7f73812d6b51a8d6dfb5d0b9d524,homeassistant/components/sensor/waze_travel_time.py,WazeTravelTime,device_state_attributes,#WazeTravelTime#,99

Before Change


        Return the state attributes of the last update.
        return {
            ATTR_ATTRIBUTION: CONF_ATTRIBUTION,
            ATTR_DISTANCE: round(self._state["distance"]),
            ATTR_ROUTE: self._state["route"],
        }

After Change


    @property
    def device_state_attributes(self):
        Return the state attributes of the last update.
        if self._state is None:
            return None

        res = {ATTR_ATTRIBUTION: CONF_ATTRIBUTION}
        if "duration" in self._state:
            res[ATTR_DURATION] = self._state["duration"]
        if "distance" in self._state:
            res[ATTR_DISTANCE] = self._state["distance"]
        if "route" in self._state:
            res[ATTR_ROUTE] = self._state["route"]
        return res

    def _get_location_from_entity(self, entity_id):
        Get the location from the entity_id.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: addca54118fb7f73812d6b51a8d6dfb5d0b9d524
Time: 2018-06-16
Author: 35082313+Petro31@users.noreply.github.com
File Name: homeassistant/components/sensor/waze_travel_time.py
Class Name: WazeTravelTime
Method Name: device_state_attributes


Project Name: home-assistant/home-assistant
Commit Name: a4214afddbc10730c4fcbd33815a1b533b3ca359
Time: 2017-12-10
Author: molobrakos@users.noreply.github.com
File Name: homeassistant/components/sensor/volvooncall.py
Class Name: VolvoSensor
Method Name: state


Project Name: scipy/scipy
Commit Name: 47c72a26b493e1b598f293d1747f6b9b87fba0b2
Time: 2019-12-10
Author: pav@iki.fi
File Name: scipy/sparse/linalg/eigen/arpack/arpack.py
Class Name: _UnsymmetricArpackParams
Method Name: extract