fix: sync and fetch temperatures

changes:
- add sync command to synchronize device sensor information with remote
  servers
- fix fetch functions to get temperatures
This commit is contained in:
2018-11-29 16:06:39 +01:00
parent 99ff511117
commit f8e829d3d2
13 changed files with 291 additions and 122 deletions

View File

@ -10,13 +10,13 @@ import (
)
type Config struct {
DeviceID string `json:"device_id"`
DeviceName string `json:"device_name"`
DeviceLocation string `json:"device_location"`
TemperatureLogfile string `json:"temperature_logfile"`
HumidityLogfile string `json:"humiditiy_logfile"`
Remotes []*Remote `json:"remotes"`
Sensors []*Sensor `json:"sensors"`
DeviceID string `json:"device_id"`
DeviceName string `json:"device_name"`
DeviceLocation string `json:"device_location"`
TemperatureLogfile string `json:"temperature_logfile"`
HumidityLogfile string `json:"humiditiy_logfile"`
Remotes []*Remote `json:"remotes"`
Sensors []*stypes.Sensor `json:"sensors"`
}
func (c *Config) ToJSON() (string, error) {
@ -56,8 +56,3 @@ type Remote struct {
Registered bool `json:"remote_registered"`
Enabled bool `json:"remote_enabled"`
}
type Sensor struct {
RemoteSensor *stypes.Sensor `json:"sensor"`
Enabled bool `json:"sensor_enabled"`
}