Migrate attribution attribute for Zestimate (#58854)
This commit is contained in:
parent
9aaa92f366
commit
a02055441a
1 changed files with 3 additions and 4 deletions
|
@ -7,14 +7,12 @@ import voluptuous as vol
|
||||||
import xmltodict
|
import xmltodict
|
||||||
|
|
||||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME
|
from homeassistant.const import CONF_API_KEY, CONF_NAME
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
_RESOURCE = "http://www.zillow.com/webservice/GetZestimate.htm"
|
_RESOURCE = "http://www.zillow.com/webservice/GetZestimate.htm"
|
||||||
|
|
||||||
ATTRIBUTION = "Data provided by Zillow.com"
|
|
||||||
|
|
||||||
CONF_ZPID = "zpid"
|
CONF_ZPID = "zpid"
|
||||||
|
|
||||||
DEFAULT_NAME = "Zestimate"
|
DEFAULT_NAME = "Zestimate"
|
||||||
|
@ -58,6 +56,8 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
class ZestimateDataSensor(SensorEntity):
|
class ZestimateDataSensor(SensorEntity):
|
||||||
"""Implementation of a Zestimate sensor."""
|
"""Implementation of a Zestimate sensor."""
|
||||||
|
|
||||||
|
_attr_attribution = "Data provided by Zillow.com"
|
||||||
|
|
||||||
def __init__(self, name, params):
|
def __init__(self, name, params):
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
@ -91,7 +91,6 @@ class ZestimateDataSensor(SensorEntity):
|
||||||
if self.data is not None:
|
if self.data is not None:
|
||||||
attributes = self.data
|
attributes = self.data
|
||||||
attributes["address"] = self.address
|
attributes["address"] = self.address
|
||||||
attributes[ATTR_ATTRIBUTION] = ATTRIBUTION
|
|
||||||
return attributes
|
return attributes
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue