Files
vikingowl a334dd57a0 feat: integrate bettervent.me device database and add BTU/kW unit switcher
Add bettervent.me provider with lazy-cached device list (~6,700 Eurovent-certified
heat pumps), search API endpoint, device search UI with auto-populate, BTU/kW unit
switcher for European users, and extended AC fields (SEER, SCOP, COP, TOL, Tbiv,
refrigerant). Closes #2.
2026-02-11 00:31:39 +01:00

69 lines
1.9 KiB
Go

package bettervent
// Device holds normalized device data from the bettervent.me API.
type Device struct {
ID int `json:"id"`
TradeName string `json:"tradeName"`
ModelName string `json:"modelName"`
CoolingKW float64 `json:"coolingKw"`
HeatingKW float64 `json:"heatingKw"`
EER float64 `json:"eer"`
COP float64 `json:"cop"`
SEER float64 `json:"seer"`
SEERClass string `json:"seerClass"`
SCOP float64 `json:"scop"`
SCOPClass string `json:"scopClass"`
TOL float64 `json:"tol"`
Tbiv float64 `json:"tbiv"`
Mounting string `json:"mounting"`
Refrigerant string `json:"refrigerant"`
Range string `json:"range"`
}
// SearchResponse holds the result of a device search.
type SearchResponse struct {
Devices []Device `json:"devices"`
Total int `json:"total"`
}
// apiDevice maps the raw JSON fields from the bettervent.me API.
type apiDevice struct {
ID int `json:"ID"`
TradeName string `json:"TradeName"`
ModelName string `json:"ModelName"`
Range string `json:"Range"`
Pc float64 `json:"Pc"`
Ph float64 `json:"Ph"`
EER float64 `json:"EER"`
COP float64 `json:"COP"`
SEER float64 `json:"SEER"`
SEERClass string `json:"SEERClass"`
SCOP float64 `json:"SCOP"`
SCOPClass string `json:"SCOPClass"`
TOL float64 `json:"TOL"`
Tbiv float64 `json:"Tbiv"`
Mounting string `json:"Mounting"`
Refrigerant string `json:"Refrigerant"`
}
func (a apiDevice) toDevice() Device {
return Device{
ID: a.ID,
TradeName: a.TradeName,
ModelName: a.ModelName,
CoolingKW: a.Pc,
HeatingKW: a.Ph,
EER: a.EER,
COP: a.COP,
SEER: a.SEER,
SEERClass: a.SEERClass,
SCOP: a.SCOP,
SCOPClass: a.SCOPClass,
TOL: a.TOL,
Tbiv: a.Tbiv,
Mounting: a.Mounting,
Refrigerant: a.Refrigerant,
Range: a.Range,
}
}