more
This commit is contained in:
5
Makefile
5
Makefile
@@ -1,6 +1,6 @@
|
|||||||
.PHONY: build run run-bash
|
.PHONY: build run run-bash
|
||||||
|
|
||||||
IMAGE_NAME := go-telldus-matter
|
IMAGE_NAME := matst80/go-telldus
|
||||||
|
|
||||||
build:
|
build:
|
||||||
docker build -t $(IMAGE_NAME) .
|
docker build -t $(IMAGE_NAME) .
|
||||||
@@ -10,3 +10,6 @@ run:
|
|||||||
|
|
||||||
run-bash:
|
run-bash:
|
||||||
docker run --rm -it --privileged -p 8081:8080 -v /dev/bus/usb:/dev/bus/usb -v $(PWD)/tellstick.conf:/etc/tellstick.conf -v $(PWD)/db:/go/src/app/db --entrypoint /bin/bash $(IMAGE_NAME)
|
docker run --rm -it --privileged -p 8081:8080 -v /dev/bus/usb:/dev/bus/usb -v $(PWD)/tellstick.conf:/etc/tellstick.conf -v $(PWD)/db:/go/src/app/db --entrypoint /bin/bash $(IMAGE_NAME)
|
||||||
|
|
||||||
|
push: build
|
||||||
|
docker push $(IMAGE_NAME)
|
||||||
BIN
db/telldus.db
BIN
db/telldus.db
Binary file not shown.
11
main.go
11
main.go
@@ -1,17 +1,18 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/pkg/datastore"
|
|
||||||
"app/pkg/devices"
|
|
||||||
"app/pkg/mqtt"
|
|
||||||
"app/pkg/telldus"
|
|
||||||
daemon "app/pkg/telldus-daemon"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/datastore"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/devices"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/mqtt"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
|
daemon "git.k7n.net/mats/go-telldus/pkg/telldus-daemon"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
package devices
|
package devices
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/pkg/datastore"
|
|
||||||
"app/pkg/mqtt"
|
|
||||||
"app/pkg/telldus"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/datastore"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/mqtt"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EventManager handles telldus events and callbacks
|
// EventManager handles telldus events and callbacks
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package devices
|
package devices
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/pkg/datastore"
|
|
||||||
"app/pkg/telldus"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/datastore"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Syncer handles synchronization of devices and sensors to the database
|
// Syncer handles synchronization of devices and sensors to the database
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package mqtt
|
package mqtt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/pkg/datastore"
|
|
||||||
"app/pkg/telldus"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/datastore"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DeviceDiscovery represents Home Assistant device discovery payload
|
// DeviceDiscovery represents Home Assistant device discovery payload
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package mqtt
|
package mqtt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"app/pkg/datastore"
|
|
||||||
"app/pkg/telldus"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/datastore"
|
||||||
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
|
|
||||||
mqtt "github.com/eclipse/paho.mqtt.golang"
|
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"app/pkg/telldus"
|
"git.k7n.net/mats/go-telldus/pkg/telldus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Manager handles the telldusd daemon lifecycle
|
// Manager handles the telldusd daemon lifecycle
|
||||||
|
|||||||
Reference in New Issue
Block a user