EEBus: expose SHIP installation QR code (#30840)
This commit is contained in:
parent
0d9bb385f1
commit
ebe4a3d6a3
6 changed files with 57 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue