Guard OwnTracks writing state before hass available (#36680)

This commit is contained in:
Paulus Schoutsen 2020-06-12 09:27:51 -07:00 committed by GitHub
parent e8b16f0dfd
commit 3c57475c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -154,4 +154,5 @@ class OwnTracksEntity(TrackerEntity, RestoreEntity):
def update_data(self, data):
"""Mark the device as seen."""
self._data = data
self.async_write_ha_state()
if self.hass:
self.async_write_ha_state()