Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

be more strict on songpal filtering #240

Merged
merged 3 commits into from Mar 2, 2019
Merged

be more strict on songpal filtering #240

merged 3 commits into from Mar 2, 2019

Conversation

rytilahti
Copy link
Contributor

@rytilahti rytilahti commented Feb 28, 2019

Check for the existence of videoScreen service, which should be solely available on televisions.

Fixes https://community.home-assistant.io/t/platform-songpal-not-ready-yet-log-entry-linked-to-braviatv/93586 and potentially other similar misdetection issues.

@balloob
Copy link
Collaborator

balloob commented Feb 28, 2019

Instead of filtering things out, we should only include things that match our spec. If SongPal cannot be identified, we shouldn't just include ALL devices that implement this API and filter them out.

@rytilahti
Copy link
Contributor Author

You are right, I made the filtering saner by checking for an existence of an interface exposed by bravias but not by the sound devices, i.e. filtering out devices which expose an interface the backend library does not support.

The problem in whitelisting songpal devices is that both types of devices implement the very same set of basic interfaces (guide for API inspection, audio for audio controls, avContent for playback/content controls and system for changing the settings of the device).

@balloob
Copy link
Collaborator

balloob commented Mar 2, 2019

Isn't there nothing in the XML that uniquely identifies it ? Like manufacturer etc?

@rytilahti
Copy link
Contributor Author

So these are all Sony devices, the "songpal" API is really their generic, extensible API which they are using in different product series (from cameras to televisions to home audio). The Bravias simply expose more interfaces than the audio-only devices, and that's what this change uses to filter them out.

On potential identifiers in the XML, to my experience the friendlyName contains sometimes the name of the product series (at least some bravias do), but no, there is no definite identification of the device type in the XML. It is possible to query the device type over the API, but that'd require initializing the platform and then do the check on homeassistant's end.

@balloob balloob merged commit 74cd2ec into home-assistant-libs:master Mar 2, 2019
@balloob
Copy link
Collaborator

balloob commented Mar 2, 2019

Alrighty.

@rytilahti rytilahti deleted the songpal_check_friendlyname branch March 2, 2019 13:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants