54 lines
1.6 KiB
Go
54 lines
1.6 KiB
Go
package datastore
|
|
|
|
import "time"
|
|
|
|
// Device represents a Telldus device
|
|
type Device struct {
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
UniqueID string `json:"unique_id"`
|
|
}
|
|
|
|
// Sensor represents a Telldus sensor
|
|
type Sensor struct {
|
|
SensorID int `json:"sensor_id"`
|
|
Protocol string `json:"protocol"`
|
|
Model string `json:"model"`
|
|
ID int `json:"id"`
|
|
Name string `json:"name"`
|
|
TemperatureUniqueID string `json:"temperature_unique_id"`
|
|
HumidityUniqueID string `json:"humidity_unique_id"`
|
|
LastTemperature string `json:"last_temperature,omitempty"`
|
|
LastHumidity string `json:"last_humidity,omitempty"`
|
|
LastTimestamp int64 `json:"last_timestamp,omitempty"`
|
|
Hidden bool `json:"hidden"`
|
|
}
|
|
|
|
// PotentialDevice represents a detected but not yet configured device
|
|
type PotentialDevice struct {
|
|
ID int `json:"id"`
|
|
Class string `json:"class"`
|
|
Protocol string `json:"protocol"`
|
|
Model string `json:"model"`
|
|
DeviceID string `json:"device_id"`
|
|
LastData string `json:"last_data"`
|
|
LastSeen int64 `json:"last_seen"`
|
|
}
|
|
|
|
// RawEvent represents a raw device event
|
|
type RawEvent struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
ControllerID int `json:"controller_id"`
|
|
Data string `json:"data"`
|
|
}
|
|
|
|
// SensorEvent represents a sensor data event
|
|
type SensorEvent struct {
|
|
Timestamp time.Time `json:"timestamp"`
|
|
Protocol string `json:"protocol"`
|
|
Model string `json:"model"`
|
|
ID int `json:"id"`
|
|
DataType int `json:"data_type"`
|
|
Value string `json:"value"`
|
|
}
|