-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.go
43 lines (34 loc) · 761 Bytes
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"fmt"
)
func run() {
if menuError != nil {
menuError.Hide()
}
if config.Update.AllowItems {
items, errParseItems := ParseItems()
if errParseItems != nil {
fmt.Printf("Error: %+v\n", errParseItems)
if menuError != nil {
menuError.SetTitle(fmt.Sprintf("error: %s", errParseItems.Error()))
menuError.Show()
}
}
if items != nil {
sendItemsToHomeAssistant(&items)
}
}
if config.Update.AllowDevices {
devices, errParseItems := ParseDevices()
if errParseItems != nil {
fmt.Printf("Error: %+v\n", errParseItems)
if menuError != nil {
menuError.SetTitle(fmt.Sprintf("error: %s", errParseItems.Error()))
menuError.Show()
}
return
}
sendDevicesToHomeAssistant(&devices)
}
}