Skip to content

Commit

Permalink
Merge pull request #5 from kazrakcom/mk3lib
Browse files Browse the repository at this point in the history
Fix issues with the mk3 by pointing to the forked, fixed version in kazrakcom/go-blink1.
  • Loading branch information
kazrakcom committed Dec 29, 2021
2 parents 65e18ff + b480574 commit a90ea31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 26 deletions.
34 changes: 9 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ LED to change colors based on your next meeting. The colors it will use are:
To use calblink, you need the following:

1. A blink(1) from [ThingM](http://blink1.thingm.com/) - calblink supports
mk1, mk2, and mk3 blink(1). Note that setting up a mk3 is a bit more complicated
due to a bug in the go-blink1 library.
mk1, mk2, and mk3 blink(1).
1. A place to connect the blink(1) where you can see it.
2. The latest version of [Go](https://golang.org/).
3. The calblink code, found in this directory.
4. libusb. The [go-blink1](https://github.com/hink/go-blink1) page has details.
4. libusb-compat. The [go-blink1](https://github.com/kazrakcom/go-blink1) page has
details.
5. A directory to run this in.
6. A few go packages, which we'll install later in the Setup section.
7. A Google Calendar account.
Expand All @@ -37,28 +37,17 @@ To use calblink, you need the following:

1. Install Go, and plug your blink(1) in somewhere that you can see it.
2. Bring up a command-line window, and create the directory you want to run
this in. Set the GOPATH environment variable to point to this directory.
this in.
3. Put calblink.go into the directory you just created.
4. Install libusb, if needed. If you needed to, and used Homebrew as instructed
4. Install libusb-compat, if needed. If you needed to, and used Homebrew as instructed
above, set INCLUDE\_PATH and LIBRARY\_PATH to point to the 'include' and
'lib' directories under the Homebrew directory.
5. Install the Google APIs for Go:

```
go get -u google.golang.org/api/calendar/v3
go get -u golang.org/x/oauth2/...
```

6. Install the blink(1) library for Go:

'lib' directories under the Homebrew directory.
5. Create your module file:
```
go get github.com/hink/go-blink1
go mod init calblink
go mod tidy
```

6. Note: If you are using a mk3 blink(1), you need to integrate [this pull
request](https://github.com/hink/go-blink1/pull/8) to fix an issue in the go-blink1
library.

7. Get an OAuth 2 ID as described in step 1 of the [Google Calendar
Quickstart](https://developers.google.com/google-apps/calendar/quickstart/go).
Put the client\_secret.json file in your GOPATH directory.
Expand Down Expand Up @@ -140,14 +129,9 @@ An example file:

## Known Issues

* I have not done any special handling for Daylight Saving Time. There may
be edge cases with sleeping around the DST change.
* If there are more than 10 events that are skipped (all-day events, excluded
events, and events with the wrong responseState) before the event that
should be shown, the event will not be processed.
* If the computer goes to sleep while calblink is sleeping, calblink will oversleep.
The best current workaround is to kill and restart calblink upon waking from sleep.
* There are issues with the mk3 Blink(1) unless the patch mentioned above is in place.

## Troubleshooting

Expand Down
2 changes: 1 addition & 1 deletion calblink.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"syscall"
"time"

blink1 "github.com/hink/go-blink1"
blink1 "github.com/kazrakcom/go-blink1"

"golang.org/x/net/context"
"golang.org/x/oauth2"
Expand Down

0 comments on commit a90ea31

Please sign in to comment.