Track entity sources (#37258)

Co-authored-by: David Mulcahey <david.mulcahey@me.com>
This commit is contained in:
Paulus Schoutsen 2020-08-19 14:57:38 +02:00 committed by GitHub
parent 24a16ff8fe
commit 3dc79aa60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 379 additions and 154 deletions

View file

@ -54,6 +54,10 @@ class Unauthorized(HomeAssistantError):
"""Unauthorized error."""
super().__init__(self.__class__.__name__)
self.context = context
if user_id is None and context is not None:
user_id = context.user_id
self.user_id = user_id
self.entity_id = entity_id
self.config_entry_id = config_entry_id