@@ -43,7 +43,6 @@ func TestLoadTopicConfiguration(t *testing.T) {
43
43
Available : "ON" ,
44
44
Unavailable : "OFF" ,
45
45
},
46
- Interval : interval (13 * time .Second ),
47
46
},
48
47
},
49
48
},
@@ -60,7 +59,6 @@ func TestLoadTopicConfiguration(t *testing.T) {
60
59
Available : "Online" ,
61
60
Unavailable : "Offline" ,
62
61
},
63
- Interval : interval (30 * time .Second ),
64
62
},
65
63
},
66
64
},
@@ -74,11 +72,6 @@ func TestLoadTopicConfiguration(t *testing.T) {
74
72
content : `{ "availability": { "topic": "" } }` ,
75
73
expectedError : "invalid config: invalid availability topic: must not be empty" ,
76
74
},
77
- {
78
- name : "Availability invalid interval" ,
79
- content : `{ "availability": { "topic": "test", "interval": "t" } }` ,
80
- expectedError : "could not read topic configuration file: invalid interval: time: invalid duration t" ,
81
- },
82
75
{
83
76
name : "Sensor" ,
84
77
content : `{
@@ -95,15 +88,17 @@ func TestLoadTopicConfiguration(t *testing.T) {
95
88
}]
96
89
}` , expectedResult : TopicConfigurations {
97
90
Sensor : []Sensor {{
98
- Name : "My sweat sensor" ,
99
- ResultTopic : fmt .Sprintf ("tele/%s/status" , deviceId ),
100
- Interval : * interval (13 * time .Second ),
101
- Unit : "kWh" ,
102
- Icon : "hassio-icon" ,
103
- Command : Command {
104
- Name : "/usr/bin/bash" ,
105
- Arguments : []string {"echo" },
91
+ GeneralSensor : GeneralSensor {
92
+ ResultTopic : fmt .Sprintf ("tele/%s/status" , deviceId ),
93
+ Interval : * interval (13 * time .Second ),
94
+ Command : Command {
95
+ Name : "/usr/bin/bash" ,
96
+ Arguments : []string {"echo" },
97
+ },
106
98
},
99
+ Name : "My sweat sensor" ,
100
+ Unit : "kWh" ,
101
+ Icon : "hassio-icon" ,
107
102
}},
108
103
},
109
104
},
0 commit comments