MCPcopy Index your code
hub / github.com/brentahughes/hdmi-cec-rest

github.com/brentahughes/hdmi-cec-rest @0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.1 ↗ · + Follow
22 symbols 42 edges 4 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

HDMI CEC Rest API

Rest api to interact with the consumer electronics control of a hdmi device. Great for turning a raspberry pi into a tv remote.

API Reference

/device

Get list of all active devices

GET

  • Request
curl http://localhost:5000/device
  • Response
{
  "TV": {
    "PowerStatus": "standby",
    "PhysicalAddress": "0.0.0.0",
    "ActiveSource": false,
    "OSDName": "TV",
    "Vendor": "Samsung",
    "LogicalAddress": 0
  },
  "Playback": {
    "PowerStatus": "on",
    "PhysicalAddress": "1.0.0.0",
    "ActiveSource": false,
    "OSDName": "Roku 3",
    "Vendor": "",
    "LogicalAddress": 4
  },
  "Recording": {
    "PowerStatus": "on",
    "PhysicalAddress": "2.0.0.0",
    "ActiveSource": false,
    "OSDName": "cec.go",
    "Vendor": "Pulse Eight",
    "LogicalAddress": 1
  }
}

/device/[logical_address]

Get details for single device by its physical address

GET

  • Request
curl http://localhost:5000/device/0
  • Response
{
  "PowerStatus": "standby",
  "PhysicalAddress": "0.0.0.0",
  "ActiveSource": false,
  "OSDName": "TV",
  "Vendor": "Samsung",
  "LogicalAddress": 0
}

/device/[logical_address]/power

Get or set the power status for a device

GET

  • Request
curl http://localhost:5000/device/0/power
  • Response
{
    "status": "success",
    "message": "standby"
}

POST

  • Request
# state can be "on" or "off"
curl -X POST -d '{"state": "on"}' http://localhost:5000/device/0/power

/device/[logical_address]/volume

Set the volume for a amplifier device

This will only work if the device is type Amplifier

POST

  • Request
# state can be "up", "down", or "mute"
curl -X POST -d '{"state": "up"}' http://localhost:5000/device/0/volume

Installation

This assumes golang has been installed and $GOPATH set

  • Install Dependencies
  • Ubuntu/Debian
apt-get install libcec-dev cec-utils make
  • Get Go Dependencies
go get
  • Compile Binary
go build

Core symbols most depended-on inside this repo

SendOjectResponse
called by 3
webservice/response.go
outputResponse
called by 3
webservice/response.go
getRequestBody
called by 2
webservice/routes.go
GetActiveDeviceList
called by 1
hdmiControl/hdmiControl.go
SendRootResponse
called by 1
webservice/response.go
SendResponse
called by 1
webservice/response.go
SendError
called by 1
webservice/response.go
main
called by 0
main.go

Shape

Function 19
Struct 3

Languages

Go100%

Modules by API surface

webservice/routes.go7 symbols
webservice/response.go7 symbols
hdmiControl/hdmiControl.go7 symbols
main.go1 symbols

For agents

$ claude mcp add hdmi-cec-rest \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact