lirc.go - a library to send and receive via lircd

Overview

LIRC

Go client for Linux Infrared Remote Control (LIRC) package

Usage

package main

import (
  "github.com/chbmuc/lirc"
  "log"
  "time"
)

func keyPower(event lirc.Event) {
  log.Println("Power Key Pressed")
}

func keyTV(event lirc.Event) {
  log.Println("TV Key Pressed")
}

func keyAll(event lirc.Event) {
  log.Println(event)
}

func main() {
  // Initialize with path to lirc socket
  ir, err := lirc.Init("/var/run/lirc/lircd")
  if err != nil {
    panic(err)
  }

  // Receive Commands

  // attach key press handlers
  ir.Handle("", "KEY_POWER", keyPower)
  ir.Handle("", "KEY_TV", keyTV)
  ir.Handle("", "", keyAll)

  // run the receive service
  go ir.Run()

  // Send Commands
  reply := ir.Command(`LIST DenonTuner ""`)
  log.Println(reply.DataLength, reply.Data)

  err = ir.Send("DenonTuner PROG-SCAN")
  if err != nil {
    log.Println(err)
  }
  err = ir.SendLong("DenonTuner VOL-DOWN", time.Duration(time.Second * 3))
  if err != nil {
    log.Println(err)
  }
}
You might also like...
Gobot - Golang framework for robotics, drones, and the Internet of Things (IoT)
Gobot - Golang framework for robotics, drones, and the Internet of Things (IoT)

Gobot (https://gobot.io/) is a framework using the Go programming language (https://golang.org/) for robotics, physical computing, and the Internet of Things.

A robust and easy to use MQTT rule engine
A robust and easy to use MQTT rule engine

⚙ MQTT COMMANDER A robust and easy to use MQTT rule engine Configure your MQTT Rules via easy to use YML Files Supports JSON encoded MQTT Messages Sup

A opinionated multi-tenant hyperscale Internet of Things platform to connect IoT devices fast and securely with minimal TCO

infinimesh IoT Platform infinimesh is a opinionated multi-tenant hyperscale Internet of Things platform to connect IoT devices fast and securely with

Exploring and comparing different IOT messaging protocols / transports.

IOT Messaging Protocols Blynk https://blynk.io/ A fully integrated suite of IoT software Device provisioning Sensor data visualization Remote control

Read metrics from a Message Queue in Json format and expose them in a Prometheus compatible format

mq2prom Read metrics from a Message Queue in Json format and expose them in a Prometheus compatible format. Currently only works for MQTT compatible M

IoT platform with things/user management and visualization, in Go with Docker using microservices

BARIOT IoT platform to Manage Users and their Things and visualize their data. Microservices services architecture build with Go and docker (compose).

Node is where client will send data to, create block send to miner, create block send to parent and receive tick from validator and do validate

Node Receive Tick from validator Validate POH of tick send result to validator Receive confirm block from validator Send Checked block to validator Ho

Using Mailchain, blockchain users can now send and receive rich-media HTML messages with attachments via a blockchain address.

Mailchain Introduction Mailchain enables blockchain-based email-like messaging with plain or rich text and attachment capabilities. Using blockchain p

An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and send these alerts to developers in the form of SMS and emails.

Alert-System An Alert notification service is an application which can receive alerts from certain alerting systems like System_X and System_Y and sen

Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.
Use pingser to create client and server based on ICMP Protocol to send and receive custom message content.

pingser Use pingser to create client and server based on ICMP Protocol to send and receive custom message content. examples source code: ./examples Us

Send and receive files securely through Tor.
Send and receive files securely through Tor.

onionbox A basic implementation of OnionShare in Go. Mostly built as a fun project, onionbox is still a WIP so usage is not guaranteed secure, yet. Ke

Webserver I built to serve Infura endpoints. Deployable via k8s and AWS EKS. Load testable via k6 tooling, and montiorable via prometheus and grafana

Infura Web Server Welcome to my verion of the take home project. I've created a webserver written in go to serve Infura api data over 3 possible data

Mantil-template-form-to-dynamodb - Receive form data and write it to a DynamoDB table
Mantil-template-form-to-dynamodb - Receive form data and write it to a DynamoDB table

This template is an example of serverless integration between Google Forms and DynamoDB

Receive phone calls from anybody on the Web. Or host a telephony server yourself.
Receive phone calls from anybody on the Web. Or host a telephony server yourself.

WebCall WebRTC Telephony Server Browser based telephony over E2E-encrypted P2P-links with very high audio quality. WebCall is lightweight and easy to

Rest API to receive solana tokens in testnet just like a faucet

solana-example Rest API to receive solana tokens in testnet just like a faucet Running go run main.go Test Request airdrop curl --header "Content-Type

News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it
News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Send email and SMS broadcasts to your contacts. SMS are sent via your Android phone connected to your PC.

Polysender Send email and SMS broadcasts to your contacts. Polysender is a desktop application, so it does not require a complicated server setup. Ema

ntfy is a super simple pub-sub notification service. It allows you to send desktop notifications via scripts.

ntfy ntfy (pronounce: notify) is a super simple pub-sub notification service. It allows you to send desktop and (soon) phone notifications via scripts

Helps you to send ssh commands to target machine in your local network from outside via gRPC
Helps you to send ssh commands to target machine in your local network from outside via gRPC

rpc-ssh In case, you don't want to make your ssh port accessible from outside local network. This repository helps you to send ssh commands to target

Owner
null
Raspberry pi project that controls jack-o-lantern via servo motor and PIR motion sensors

pumpkin-pi ?? Raspberry pi project that controls jack-o-lantern via servo motor and PIR motion sensors to simulate it "watching" you. Inspired by Ryde

Caleb Lemoine 17 Sep 13, 2022
Vallox RS-485 MQTT gateway to integrate Vallox RS485 ventilation device to Home Assistant via MQTT.

Vallox RS-485 MQTT gateway to integrate Vallox RS485 ventilation device to Home Assistant via MQTT. Implements Home Assistant MQTT discovery but can also be used without Home Assistant.

Pekka Vainio 1 Dec 26, 2021
Courier Golang client library provides an opinionated wrapper over paho MQTT library to add features on top of it

Courier Golang Client Library Introduction Courier Golang client library provides an opinionated wrapper over paho MQTT library to add features on top

Gojek 31 Nov 19, 2022
An extensive Philips Hue client library for Go with an emphasis on simplicity

Huego An extensive Philips Hue client library for Go with an emphasis on simplicity. It is designed to be clean, unbloated and extensible. With Huego

Amir Mofasser 228 Dec 28, 2022
Go-ebyte-lora - EBYTE Lora modules interface library for Linux, Raspberry PI

go-ebyte-lora EBYTE Lora modules interface library for Linux, Raspberry PI Super alpha version WARNING: It was tested on Raspberry Pi 4, Serial Read,

Mario Andrija Balug 2 May 11, 2022
A realtime teenage driver behaviour monitoring system integrating OBII sensor, smart watch, smartphone, and Raspberry Pi, which examines over time novice teenage driving performance and risk

DriverMonitor A realtime teenage driver behaviour monitoring system integrating OBII sensor, smart watch, smartphone, and Raspberry Pi, which examines

Shaohu 0 Nov 27, 2021
Golang framework for robotics, drones, and the Internet of Things (IoT)

Gobot (https://gobot.io/) is a framework using the Go programming language (https://golang.org/) for robotics, physical computing, and the Internet of

The Hybrid Group 8k Dec 29, 2022
Industrial IoT Messaging and Device Management Platform

Mainflux Mainflux is modern, scalable, secure, open-source, and patent-free IoT cloud platform written in Go. It accepts user and thing (sensor, actua

Mainflux 2k Dec 31, 2022
Secure and Interoperable Internet of Things

plgd Cloud Internet of Things (IoT) technologies have evolved rapidly in recent years and continue to change how we interact with our surroundings. Fo

plgd 162 Dec 26, 2022
Securely access remote devices and servers

Deviceplane is an open source device management tool for embedded systems and edge computing. It solves various infrastructure problems related to rem

Deviceplane 207 Dec 15, 2022