ktnrg45 / pyremoteplay

Python API for using PlayStation Remote Play
https://pyremoteplay.readthedocs.io/
GNU General Public License v3.0
29 stars 11 forks source link

AttributeError: 'NoneType' object has no attribute 'send_feedback' #10

Closed L422Y closed 2 years ago

L422Y commented 2 years ago

When attempting to call device.controller.button("CIRCLE", "TAP") I am getting:

AttributeError: 'NoneType' object has no attribute 'send_feedback'

I've tried with and without device.controller.start(), there's no error when I call the stick method, I also tried lower case "circle" and "tap", this occurs on Ubuntu and macOS, not sure if I am initializing correctly or not, the examples don't give a lot of guidance yet on how to do things properly.

ip_address = 'X.X.X.X' # ip address of Remote Play device
device = start(ip_address)
time.sleep(1) # prevent race condition
#device.controller.start()
print(device.controller.buttons())
while True:
    print('.')
    device.controller.stick("left", point=(-0.5, -0.5))
    device.controller.button("CIRCLE", "TAP")
    # print(device.controller)
    time.sleep(3)
ktnrg45 commented 2 years ago

You are seeing a race condition. Essentially you would have to sleep for longer after starting. As of 0.7.1, there are new waiters for this. You can review the updated examples or documentation for additional info.