alexmohr / sonyapilib

Contains a python api to control sony devices.
MIT License
20 stars 11 forks source link

Update device.py #61

Open gohlas opened 3 years ago

gohlas commented 3 years ago

Added HDMI change support for some models. Work is not 100% but as I mentioned before, it works.

alexmohr commented 3 years ago

The methods are essentially the same. They only differ by one char in the the url. Merging them would be better. I guess the 6 or 7 refer to the input id. We might be able to find them via a soap request. The timeout should be a default parameter, so it can be changed if necessary.

alexmohr commented 3 years ago

The service id you are using is referenced in dmr.xml and more information can be retrieved via AVTransportSCPD.xml or AVTransportBdpSCPD.xml depending on the API version. Please let me know if you are not going to implement this the "right way" your PR is already a great contribution but does not meet the standards of this project (yet).

gohlas commented 3 years ago

Sorry @alexmohr, That is a bit out of my knowledge as I am not a programmer I don't have really much spare time to learn and work on this right now. That would be nice if you could take over or I can try in the future :)

alexmohr commented 3 years ago

@gohlas Could you install the android app packet capture, start a trace and open the TV and side view app. After that scroll down to the list of inputs and stop the trace. At least with a v4 device I was able to find out how the sources are enumerated this way.

Thanks in advance

gohlas commented 3 years ago

@alexmohr
I just had a look on it, but couldn't see anything special that I already saw with wireshark.

Do you have some tips what should I look for?

alexmohr commented 3 years ago

No not really with a v4 device the query of sources was pretty obvious because the response is a JSON containing all sources. If you don't mind it would help me of you could trace the whole registration process and one source switch and attach the trace here. Reading the trace might gives me an idea how this works. If you still have the wireshark traces I'd actually prefer them. Whatever is easier for you.

gohlas commented 3 years ago

I still have the wireshark log. But I would rather PM you the files. How can I send you?

alexmohr commented 3 years ago

Send it via mail to sonyapilib@mohr.io

EnriqueWood commented 1 year ago

Would this help to be able to select sources in homeassistant?

alexmohr commented 1 year ago

Would this help to be able to select sources in homeassistant?

Only for a few devices and only for hmdi 1 and 2. Proper support probably won't be added ever

EnriqueWood commented 1 year ago

I was trying to sniff the Video Sideview app using packet capture to see what is going on in the network but when I turn on the capture it won't list the inputs available. Can you please give me some guidance on how to get them listed? I would like to help to get this available in homeassistant

https://user-images.githubusercontent.com/22996504/200133719-61a86341-6976-4b96-be62-db590a48118e.mp4

alexmohr commented 1 year ago

Depending on the device they might also be hard coded.There does not seems to be a generic way to select sources for different devices, thus it's out of scope for this project as I can't provide support for all devices.