diff --git a/homeassistant/components/locative/device_tracker.py b/homeassistant/components/locative/device_tracker.py index 133f59d235a..47a498331eb 100644 --- a/homeassistant/components/locative/device_tracker.py +++ b/homeassistant/components/locative/device_tracker.py @@ -35,25 +35,11 @@ class LocativeEntity(TrackerEntity): def __init__(self, device, location, location_name): """Set up Locative entity.""" self._name = device - self._location = location - self._location_name = location_name + self._attr_latitude = location[0] + self._attr_longitude = location[1] + self._attr_location_name = location_name self._unsub_dispatcher = None - @property - def latitude(self): - """Return latitude value of the device.""" - return self._location[0] - - @property - def longitude(self): - """Return longitude value of the device.""" - return self._location[1] - - @property - def location_name(self): - """Return a location name for the current location of the device.""" - return self._location_name - @property def name(self): """Return the name of the device.""" @@ -74,6 +60,7 @@ class LocativeEntity(TrackerEntity): """Update device data.""" if device != self._name: return - self._location_name = location_name - self._location = location + self._attr_location_name = location_name + self._attr_latitude = location[0] + self._attr_longitude = location[1] self.async_write_ha_state()