async def async_get_master_token(self) -> str: """Get master API token""" def _get_master_token() -> Optional[str]: return self._client.get_master_token() master_token = await self.hass.async_add_executor_job(_get_master_token ) if master_token is None or is_aas_et(master_token) is False: raise InvalidMasterToken return master_token
async def async_get_master_token(self): """Get master API token""" def _get_master_token(): return self._client.get_master_token() master_token = await self.hass.async_add_executor_job(_get_master_token ) if is_aas_et(master_token) is False: raise InvalidMasterToken return master_token
def assertIsAasEt(self, variable: str) -> None: """Assert the given variable is a of string type and follows AAS token format""" self.assertTrue( token_utils.is_aas_et(variable), msg=f"Given variable {variable} doesn't follow the AAS_ET format", )
def assertIsAASET(self, variable): self.assertTrue( type(variable) == str and token_utils.is_aas_et(variable), msg=f"Given variable {variable} doesn't follow the AAS_ET format", )