@@ -19,13 +19,12 @@ type State struct {
19
19
}
20
20
21
21
type Sensor struct {
22
- Type string `json:"type"`
23
- Entity string `json:"entity_id"`
24
- Name string `json:"friendly_name"`
25
- Value string `json:"state,omitempty"`
26
- Unit string `json:"unit_of_measurement,omitempty"`
27
- Class string `json:"device_class,omitempty"`
28
- LastChanged time.Time `json:"last_changed"`
22
+ Type string `json:"type"`
23
+ Entity string `json:"entity_id"`
24
+ Name string `json:"friendly_name"`
25
+ Value string `json:"state,omitempty"`
26
+ Unit string `json:"unit_of_measurement,omitempty"`
27
+ Class string `json:"device_class,omitempty"`
29
28
}
30
29
31
30
///////////////////////////////////////////////////////////////////////////////
@@ -60,13 +59,12 @@ func (c *Client) Sensors() ([]Sensor, error) {
60
59
continue
61
60
}
62
61
sensors = append (sensors , Sensor {
63
- Type : "sensor" ,
64
- Entity : state .Entity ,
65
- Name : state .Name (),
66
- Value : state .State ,
67
- Unit : state .UnitOfMeasurement (),
68
- Class : state .DeviceClass (),
69
- LastChanged : state .LastChanged ,
62
+ Type : "sensor" ,
63
+ Entity : state .Entity ,
64
+ Name : state .Name (),
65
+ Value : state .State ,
66
+ Unit : state .UnitOfMeasurement (),
67
+ Class : state .DeviceClass (),
70
68
})
71
69
}
72
70
@@ -90,12 +88,11 @@ func (c *Client) Actuators() ([]Sensor, error) {
90
88
continue
91
89
}
92
90
sensors = append (sensors , Sensor {
93
- Type : "actuator" ,
94
- Entity : state .Entity ,
95
- Name : state .Name (),
96
- Value : state .State ,
97
- Class : state .DeviceClass (),
98
- LastChanged : state .LastChanged ,
91
+ Type : "actuator" ,
92
+ Entity : state .Entity ,
93
+ Name : state .Name (),
94
+ Value : state .State ,
95
+ Class : state .DeviceClass (),
99
96
})
100
97
}
101
98
@@ -119,11 +116,10 @@ func (c *Client) Lights() ([]Sensor, error) {
119
116
continue
120
117
}
121
118
lights = append (lights , Sensor {
122
- Type : "light" ,
123
- Entity : state .Entity ,
124
- Name : state .Name (),
125
- Value : state .State ,
126
- LastChanged : state .LastChanged ,
119
+ Type : "light" ,
120
+ Entity : state .Entity ,
121
+ Name : state .Name (),
122
+ Value : state .State ,
127
123
})
128
124
}
129
125
0 commit comments