From 4c69dc28cd73c8173c03021b98db25f945b11536 Mon Sep 17 00:00:00 2001 From: Adriaan van Rossum <1079135+adriaanvanrossum@users.noreply.github.com> Date: Sat, 19 Mar 2022 15:52:48 +0100 Subject: [PATCH 1/2] Add go.mod and go.sum --- go.mod | 13 +++++++++++++ go.sum | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 go.mod create mode 100644 go.sum diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..7353f64 --- /dev/null +++ b/go.mod @@ -0,0 +1,13 @@ +module bessarabov/mac2mqtt + +go 1.17 + +require ( + github.com/eclipse/paho.mqtt.golang v1.3.5 + gopkg.in/yaml.v2 v2.4.0 +) + +require ( + github.com/gorilla/websocket v1.4.2 // indirect + golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..d6786af --- /dev/null +++ b/go.sum @@ -0,0 +1,14 @@ +github.com/eclipse/paho.mqtt.golang v1.3.5 h1:sWtmgNxYM9P2sP+xEItMozsR3w0cqZFlqnNN1bdl41Y= +github.com/eclipse/paho.mqtt.golang v1.3.5/go.mod h1:eTzb4gxwwyWpqBUHGQZ4ABAV7+Jgm1PklsYT/eo8Hcc= +github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U= +golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= From 0f885e8760ab546f7ae5dadf4032c40d970ba90b Mon Sep 17 00:00:00 2001 From: Adriaan van Rossum <1079135+adriaanvanrossum@users.noreply.github.com> Date: Sat, 19 Mar 2022 15:56:39 +0100 Subject: [PATCH 2/2] Add build steps --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9706a3d..c36d3e5 100644 --- a/README.md +++ b/README.md @@ -221,3 +221,14 @@ Sending some other value but `shutdown` will do nothing. ### PREFIX + `/command/displaysleep` You can send string `displaysleep` to this topic. It will turn off display. Sending some other value will do nothing. + +## Building + +To build this program yourself, follow these steps: + +1. Clone this repo +2. Make sure you have installed go, for example with `brew install go` +3. Install its dependencies with `go install` +4. Build with `go build mac2mqtt.go` + +It outputs a file `mac2mqtt`. Make the binary executable (`chmod +x mac2mqtt`) and run `./mac2mqtt`.