Telegram bot to control MQTT lights. Written in Go.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # ----------------------------------------------------------------------------
  2. # "THE BEER-WARE LICENSE" (Revision 42):
  3. # <xythobuz@xythobuz.de> wrote this file. As long as you retain this notice
  4. # you can do whatever you want with this stuff. If we meet some day, and you
  5. # think this stuff is worth it, you can buy me a beer in return. Thomas Buck
  6. # ----------------------------------------------------------------------------
  7. HOST = iot
  8. # ----------------------------------------------------------------------------
  9. # https://tech.davis-hansson.com/p/make/
  10. SHELL := bash
  11. .ONESHELL:
  12. .SHELLFLAGS := -eu -o pipefail -c
  13. .DELETE_ON_ERROR:
  14. MAKEFLAGS += --warn-undefined-variables
  15. MAKEFLAGS += --no-builtin-rules
  16. # check for recent make
  17. ifeq ($(origin .RECIPEPREFIX), undefined)
  18. $(error This Make does not support .RECIPEPREFIX. Please use GNU Make 4.0 or later)
  19. endif
  20. .RECIPEPREFIX = >
  21. # ----------------------------------------------------------------------------
  22. all: lights-telegram
  23. lights-telegram: lights-telegram.go
  24. > CGO_ENABLED=0 go build
  25. clean:
  26. > rm -rf lights-telegram
  27. upload: lights-telegram
  28. > ssh $(HOST) sudo systemctl stop lights-telegram
  29. > scp lights-telegram $(HOST):~/bin/lights-telegram/lights-telegram
  30. > sleep 1
  31. > ssh $(HOST) sudo systemctl start lights-telegram
  32. .PHONY: upload
  33. download:
  34. > scp $(HOST):~/bin/lights-telegram/config.yaml config.yaml
  35. .PHONY: download