Skip to content

Commit f349310

Browse files
author
Tim Schneider
committed
Fixed bugs in RobotWebSession
1 parent ef603ac commit f349310

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

franky/robot_web_session.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import ssl
55
import time
6+
import urllib.parse
67
from http.client import HTTPSConnection, HTTPResponse
78
from typing import TYPE_CHECKING, Dict, Optional, Any, Literal
89
from urllib.error import HTTPError
@@ -91,12 +92,14 @@ def release_control(self):
9192

9293
def enable_fci(self):
9394
self.send_control_api_request(
94-
"/desk/api/system/fci", headers={"content-type": "application/x-www-form-urlencoded"})
95+
"/desk/api/system/fci", headers={"content-type": "application/x-www-form-urlencoded"},
96+
body=f"token={urllib.parse.quote(self.__control_token)}")
9597

9698
def has_control(self):
9799
if self.__control_token_id is not None:
98100
status = self.get_system_status()
99-
return status["controlToken"]["activeToken"]["id"] == self.__control_token_id
101+
active_token = status["controlToken"]["activeToken"]
102+
return active_token is not None and active_token["id"] == self.__control_token_id
100103
return False
101104

102105
def start_task(self, task: str):

0 commit comments

Comments
 (0)