lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
131 stars 13 forks source link

[question] differentiate playing video or audio? #36

Closed RaymondMouthaan closed 4 years ago

RaymondMouthaan commented 4 years ago

Hi @lukasroegner,

Is it possible to tell the difference between playing a video or audio? Let say when I play audio like Apple Music on Apple TV that a different switch turns on, then when a video on Netflix gets played?

I saw underlying appletv tool shows lots of extra info in the logging like, what provider is played (Netflix, Prime, Apple Music etc), even process is shown.

Greetz, Ray

lukasroegner commented 4 years ago

Hi @RaymondMouthaan,

There are so many possibilities given the data that the Apple TV provides, which I cannot cover due to my limited free time. Feel free to fork the plugin, I'm glad to accept pull requests.

Best regards Lukas

RaymondMouthaan commented 4 years ago

I'll need to find out how to setup a development environment first preferable in a docker container, then I might add some new functionality to the plugin via a PR.

If you have some instructions to do so, that would help :-)

Cheers, Ray

lukasroegner commented 4 years ago

I'm not developing in a Docker container, but I can tell you my setup:

  1. After you've cloned the repo, do an npm install.
  2. Create a config.json file in the Repo root with a sample configuration (the file is excluded via .gitignore)
  3. npm run debug to compile the TypeScript and start the isolated Homebridge instance (uses the config.json in the Repo root)

Sample config:

{
    "bridge": {
        "name": "Test",
        "username": "CC:32:3D:E3:CE:50",
        "port": 52840,
        "pin": "031-46-180"
    },
    "platforms": [
        {
            "platform": "AppleTvPlatform",
            "devices": [
                {
                    "name": "test",
                    "credentials": "XXX",
                    "isOnOffSwitchEnabled": true,
                    "isPlayPauseSwitchEnabled": true
                }
            ]
        }
    ]
}