EEBus: expose SHIP installation QR code (#30840)

This commit is contained in:
andig 2026-06-16 12:21:37 +02:00 • committed by GitHub
parent 0d9bb385f1
commit ebe4a3d6a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 57 additions and 0 deletions

View file

@ -89,11 +89,26 @@ var Instance *EEBus
func GetStatus() any {
return struct {
Ski string `json:"ski"`
QR string `json:"qr,omitempty"`
}{
Ski: Ski(),
QR: qrCode(),
}
}
// qrCode returns the SHIP installation QR code text per EEBus SHIP installation
// requirements, or empty if unavailable
func qrCode() string {
if Instance == nil {
return ""
}
qr, err := Instance.service.QRCodeText()
if err != nil {
return ""
}
return qr
}
func NewServer(other Config) (*EEBus, error) {
cc := Config{
Port: 4712,