Using rolling token on observer (#3286)

This commit is contained in:
Pascal Vizeli 2021-11-04 10:18:44 +01:00 committed by GitHub
parent a0c8b77737
commit efa5205800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,9 +121,8 @@ class PluginObserver(PluginBase):
async def start(self) -> None: async def start(self) -> None:
"""Run observer.""" """Run observer."""
# Create new API token # Create new API token
if not self.supervisor_token: self._data[ATTR_ACCESS_TOKEN] = secrets.token_hex(56)
self._data[ATTR_ACCESS_TOKEN] = secrets.token_hex(56) self.save_data()
self.save_data()
# Start Instance # Start Instance
_LOGGER.info("Starting observer plugin") _LOGGER.info("Starting observer plugin")