wip
This commit is contained in:
@@ -27,7 +27,8 @@ import (
|
||||
var (
|
||||
port string
|
||||
scheduler gocron.Scheduler
|
||||
ticktick *ticktickutil.TicktickUtilImpl
|
||||
ticktick ticktickutil.TicktickUtil
|
||||
ha *homeassistant.HomeAssistant
|
||||
)
|
||||
|
||||
// serveCmd represents the serve command
|
||||
@@ -55,7 +56,7 @@ func initComponent() {
|
||||
// init location recorder
|
||||
locationRecorder.Init()
|
||||
// init homeassistant
|
||||
homeassistant.Init(ticktick)
|
||||
ha = homeassistant.NewHomeAssistant(ticktick)
|
||||
}
|
||||
|
||||
func serve(cmd *cobra.Command, args []string) {
|
||||
@@ -108,7 +109,7 @@ func serve(cmd *cobra.Command, args []string) {
|
||||
|
||||
router.HandleFunc("/poo/latest", pooRecorder.HandleNotifyLatestPoo).Methods("GET")
|
||||
router.HandleFunc("/poo/record", pooRecorder.HandleRecordPoo).Methods("POST")
|
||||
router.HandleFunc("/homeassistant/publish", homeassistant.HandleHaMessage).Methods("POST")
|
||||
router.HandleFunc("/homeassistant/publish", ha.HandleHaMessage).Methods("POST")
|
||||
|
||||
router.HandleFunc("/location/record", locationRecorder.HandleRecordLocation).Methods("POST")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user