You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i don't really know if it's a bug or a mistake that i made, but like message write to report a bug, i do it...
Error message :
Exception in <file.export_frigate_timelapse.export_frigate_timelapse> line 93: response = requests.request("POST", url, headers=headers, data=payload) ^ RuntimeError: Caught blocking call to putrequest with args (<urllib3.connection.HTTPConnection object at 0x7fde71768230>, 'POST', '/api/export/cam_cuisine/start/1743921486/end/1743944886') inside the event loop by custom integration 'pyscript' at custom_components/pyscript/eval.py, line 1983: return func(*args, **kwargs). (offender: /usr/local/lib/python3.13/site-packages/urllib3/connection.py, line 219: return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)), please create a bug report at https://github.com/custom-components/pyscript/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#putrequest
script :
import http.client
import json
import string
import datetime
from random import randrange
#definition des valeur par defaut pour la fonction si pas transmises
_now = int(str(datetime.datetime.now().timestamp()).split('.')[0])
_start = _now - (6*60*60) #6 heure en seconde
@service
def export_frigate_timelapse (camera_name='cam_cuisine', start_time = _start , end_time = _now ):
# Fct de log
def write_log(_str):
target = 'input_text.logbook_tszone_default'
inputState = '[ PYSCRIPT ] [ DEBUG ] : FrigateTimelapse: ('+str(randrange(10)) +'): '+ str(_str)
state.set(target, inputState)
write_log('start_time:'+str(start_time))
write_log('end_time:'+str(end_time))
conn = http.client.HTTPSConnection("frigate.XXXXXX.ovh")
payload = json.dumps({
"playback": "timelapse_25x",
"source": "recordings",
"name": "string",
"image_path": "string"
})
#write_log('payload:'+str(payload))
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
#write_log('headers:'+str(headers))
conn.request("POST", ("/api/export/:"+camera_name+"/start/:"+str(start_time)+"/end/:"+str(end_time)), payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
The text was updated successfully, but these errors were encountered:
Hello,
i don't really know if it's a bug or a mistake that i made, but like message write to report a bug, i do it...
Error message :
script :
The text was updated successfully, but these errors were encountered: