cec

package
v0.0.0-...-d335ae2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PowerOffTV

func PowerOffTV() error

PowerOffTV sends a "standby" command to the TV (logical address 0).

func PowerOnTV

func PowerOnTV() error

PowerOnTV attempts to turn the TV on by sending "on 0" over CEC.

func StartCECListener

func StartCECListener(remoteEvents chan<- RemoteCommand)

StartCECListener spawns cec-client in a goroutine, parses its output, and sends recognized remote commands into remoteEvents.

func SwitchToHDMI

func SwitchToHDMI(input int) error

SwitchToHDMI sends an "Active Source" command based on your hdmiInput (1, 2, etc.). See the cec-client spec for physical address codes. For example, "2.0.0.0" = 20:00 in hex.

Types

type RemoteCommand

type RemoteCommand int

RemoteCommand is a simple enum for recognized CEC button presses.

const (
	RemoteUnknown RemoteCommand = iota
	RemoteLeft
	RemoteRight
	RemoteSelect
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL