Skip to content

Commit

Permalink
Merge pull request #9 from Apple-VR/patch-1
Browse files Browse the repository at this point in the history
Multiple Codes per pet
  • Loading branch information
noideaman authored May 17, 2024
2 parents c39946a + 7cddc99 commit d35f12c
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 d35f12c

Please sign in to comment.