Skip to content

Commit

Permalink
Multi funtargets per pet
Browse files Browse the repository at this point in the history
Allow for multiple funtargets per pet
  • Loading branch information
Apple-VR authored May 17, 2024
1 parent c39946a commit 7cddc99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions script/pishockasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,12 @@ async def loop():
if boolsend == 'True':
sleeptime=funduration+1.1
print(f"sending {typesend} at {funintensity} for {funduration} seconds")
datajson = str({"Username":USERNAME,"Name":NAME,"Code":funtarget,"Intensity":funintensity,"Duration":funduration,"Apikey":APIKEY,"Op":funtype})
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
sendrequest=requests.post('https://do.pishock.com/api/apioperate', data=datajson, headers=headers)

funtargets = funtarget.split(",")
for target in funtargets:
datajson = str({"Username":USERNAME,"Name":NAME,"Code":target,"Intensity":funintensity,"Duration":funduration,"Apikey":APIKEY,"Op":funtype})
headers = {'Content-type': 'application/json', 'Accept': 'text/plain'}
sendrequest=requests.post('https://do.pishock.com/api/apioperate', data=datajson, headers=headers)

print(f"waiting {sleeptime} before next command")
#print(sendrequest)
Expand Down

0 comments on commit 7cddc99

Please sign in to comment.