def on_remove_device_selected(self, index):
device_id = self.env.tmp_device_ids[index]
active_device_id = self.load_settings().get(EI_DEVICE_ID)
if device_id == active_device_id:
sublime.message_dialog(STR_MODEL_CANT_REMOVE_ACTIVE_DEVICE)
return
response, code = HTTP.put(self.env.project_manager.get_build_api_key(),
PL_BUILD_API_URL_V4 + "devices/" + device_id,
'{"model_id": ""}')
if not HTTP.is_response_code_valid(code):
sublime.message_dialog(STR_MODEL_REMOVE_DEVICE_FAILED)
return
sublime.message_dialog(STR_MODEL_DEVICE_REMOVED)
self.env.tmp_model = None
self.env.tmp_device_ids = None
评论列表
文章目录