sinricpro / python-sdk

python3 sdk for sinric pro.
https://sinric.pro
23 stars 9 forks source link

Python example using websocket #58

Open AndrejaN opened 10 months ago

AndrejaN commented 10 months ago

Hi, could you share an example of TV.py conection using websocket with Sinric Pro? In the Sinric version there was python TV example using websocket. Thanks. Similar to this - https://github.com/kakopappa/sinric/blob/master/python_examples/examples_using_websocket/tv_example.py but with the new Sinric Pro

kakopappa commented 10 months ago

There's one in example folder: https://github.com/sinricpro/python-sdk/blob/master/examples/tv.py

AndrejaN commented 10 months ago

Aha. I will try.

kakopappa commented 10 months ago

Not compatible. Pro version is different from the old version. request/response format is different and there are verification checks (HMAC) for every message.

On Sun, 29 Oct 2023 at 6:52 PM Andreja @.***> wrote:

Ok. But i want to use this class SinricProSocket(Signature) from the _sinricpro_websocket.py file. The https://github.com/kakopappa/sinric/blob/master/python_examples/examples_using_websocket/tv_example.py is different from this one https://github.com/kakopappa/sinric/blob/master/python_examples/examples/tv_example.py .

— Reply to this email directly, view it on GitHub https://github.com/sinricpro/python-sdk/issues/58#issuecomment-1784081528, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZAZZUGWULINUT762G5JCLYBYYNTAVCNFSM6AAAAAA6UYPZNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGA4DCNJSHA . You are receiving this because you commented.Message ID: @.***>

AndrejaN commented 10 months ago

I understand. So i will wait for the tutorial on this https://help.sinric.pro/pages/devices/tv

kakopappa commented 10 months ago

Will put together a tutorial in the coming days.

  1. Install sinricpro python library
  2. Create a device in the portal.
  3. Replace the device id, appkey and appsecret in https://github.com/sinricpro/python-sdk/blob/master/examples/tv.py

image