cmer / lg-tv-control-macos

Automatically wake/sleep and change the input of your LG TV when used as a monitor on macOS
123 stars 12 forks source link

Support for controlling TV audio via volume/mute keys #17

Closed alimbada closed 10 months ago

alimbada commented 12 months ago

Hello,

I've added support to use keyboard volume and mute keys to control the TVs audio.

Features:

Loads the following additional Hammerspoon extensions:

zakkhoyt commented 11 months ago

I tested this branch and it works well. This is great. Nice work!

Like probably many of you I've been using Proxy Audio Device (a mac app) to handle volume for the LGTV. It works but is pretty clunky and requires constant tinkering. With this PR I can uninstall Proxy.


I have worked out a handful of optimizations which I can post as a follow up PR.

alimbada commented 11 months ago

@zakkhoyt, thanks. This is my first time using Hammerspoon and Lua so any improvements are welcome. :)

zakkhoyt commented 10 months ago

@cmer Have you had a chance to look over this PR?

cmer commented 10 months ago

I actually never even noticed it was there waiting. I'll take a look.

cmer commented 10 months ago

What are the improvements you'll like to share?

cmer commented 10 months ago

@zakkhoyt What are the improvements you'd like to share?

cmer commented 10 months ago

@alimbada could you change the variable name like so, for consistency? Then I'm ready to merge. Thanks for your awesome contribution!

local control_audio = true -- Control TV volume and mute button events from keyboard
zakkhoyt commented 10 months ago

@cmer I'll put up a PR after this one is merged. It contains some efficiency changes (fewer API calls to the TV and some state caching for faster reaction)

IIRC I have a bug to work out first.

alimbada commented 10 months ago

@alimbada could you change the variable name like so, for consistency? Then I'm ready to merge. Thanks for your awesome contribution!

local control_audio = true -- Control TV volume and mute button events from keyboard

Done now. :)

cmer commented 10 months ago

Thank you!