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 2019-06-25 05:00:28 +02:00 committed by Paulus Schoutsen
parent 6e14e8ed91
commit d4fc22add4
2 changed files with 39 additions and 0 deletions

View file

@ -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()