Documentation ¶
Index ¶
- Constants
- func NewError(text string) error
- func SaveBlindHistory(db HistoryDb, driver dblind.Blind) error
- func SaveHistory(db HistoryDb, dbName, tbName string, obj interface{}) error
- func SaveHvacHistory(db HistoryDb, driver dhvac.Hvac) error
- func SaveLedHistory(db HistoryDb, driver dl.Led) error
- type BlindHistory
- type HistoryDb
- type HvacHistory
- type LedHistory
- type SwitchHistory
Constants ¶
View Source
const ( HistoryDB = "history" LedsTable = "leds" BlindsTable = "blinds" SwitchsTable = "switchs" HvacsTable = "hvacs" TdTable = "tds" )
Variables ¶
This section is empty.
Functions ¶
func SaveHistory ¶
Types ¶
type BlindHistory ¶
type BlindHistory struct { Mac string `json:"mac"` Energy float64 `json:"energy"` Power int `json:"power"` Date string `json:"date"` Group int `json:"group"` }
func GetBlindsHistory ¶
func GetBlindsHistory(db HistoryDb) []BlindHistory
func ToBlindHistory ¶
func ToBlindHistory(val interface{}) (*BlindHistory, error)
ToBlindHistory convert map interface to blind object
type HistoryDb ¶
type HistoryDb = database.DatabaseInterface
func ConnectDatabase ¶
ConnectDatabase plug datbase
type HvacHistory ¶
type HvacHistory struct { Mac string `json:"mac"` Power int `json:"power"` Date string `json:"date"` Group int `json:"group"` }
func GetHvacsHistory ¶
func GetHvacsHistory(db HistoryDb) []HvacHistory
func ToHvacHistory ¶
func ToHvacHistory(val interface{}) (*HvacHistory, error)
ToHvacHistory convert map interface to Hvac object
type LedHistory ¶
type LedHistory struct { Mac string `json:"mac"` Energy float64 `json:"energy"` Power int `json:"power"` Date string `json:"date"` Group int `json:"group"` }
func GetLedsHistory ¶
func GetLedsHistory(db HistoryDb) []LedHistory
func ToLedHistory ¶
func ToLedHistory(val interface{}) (*LedHistory, error)
ToLedHistory convert map interface to Led object
Click to show internal directories.
Click to hide internal directories.