Fix locative device update (#24744)

* Add a test for two devices

* Fix locative updating all devices

* Add a guard clause that checks if correct device is passed.
This commit is contained in:
Martin Hjelmare authored and Paulus Schoutsen committed 2019-06-24 20:00:28 -07:00
1 parent 6e14e8ed91
commit d4fc22add4
2 files changed
+39

No files matched your search

@@ -85,6 +85,8 @@ class LocativeEntity(DeviceTrackerEntity):
@callback
def _async_receive_data(self, device, location, location_name):
"""Update device data."""
if device != self._name:
return
self._location_name = location_name
self._location = location
self.async_write_ha_state()