-
Notifications
You must be signed in to change notification settings - Fork 9
/
timesheets.go
53 lines (46 loc) · 1.4 KB
/
timesheets.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
44
45
46
47
48
49
50
51
52
53
package vitotrol
import (
"fmt"
)
// A TimesheetID allows to reference a specific timesheet. See
// *Timesheet consts.
type TimesheetID uint16
// All available/recognized TimesheetID values.
const (
HotWaterLoopTimesheet TimesheetID = 7193 // Programmation bouclage ECS
HotWaterTimesheet TimesheetID = 7192 // Programmation ECS
HeatingTimesheet TimesheetID = 7191 // Programmation chauffage
)
// A TimesheetRef describe a time program reference.
type TimesheetRef struct {
Name string
Doc string
}
// String returns a string describing a time program reference.
func (t *TimesheetRef) String() string {
return fmt.Sprintf("%s: %s", t.Name, t.Doc)
}
// TimesheetsRef lists the reference for each timesheet ID.
var TimesheetsRef = map[TimesheetID]*TimesheetRef{
HotWaterLoopTimesheet: {
Name: "HotWaterLoopTimesheet",
Doc: "Time program for domestic hot water recirculation pump",
},
HotWaterTimesheet: {
Name: "HotWaterTimesheet",
Doc: "Time program for domestic hot water heating",
},
HeatingTimesheet: {
Name: "HeatingTimesheet",
Doc: "Time program for central heating",
},
}
// TimesheetsNames2IDs maps the timesheet names to their TimesheetID
// counterpart.
var TimesheetsNames2IDs = func() map[string]TimesheetID {
ret := make(map[string]TimesheetID, len(TimesheetsRef))
for timesheetID, pTimesheetRef := range TimesheetsRef {
ret[pTimesheetRef.Name] = timesheetID
}
return ret
}()