|
|
@ -37,12 +37,22 @@ func (b *bridge) Devices() []models.Device { |
|
|
|
|
|
|
|
hue, sat, value := colorful.LinearRgb(red, green, blue).Hsv() |
|
|
|
|
|
|
|
shapeType, shapeTypeOK := shapeTypeMap[panel.ShapeType] |
|
|
|
if !shapeTypeOK { |
|
|
|
shapeType = "NanoLeaf" |
|
|
|
} |
|
|
|
|
|
|
|
shapeIcon, shapeIconOK := shapeIconMap[panel.ShapeType] |
|
|
|
if !shapeIconOK { |
|
|
|
shapeIcon = "lightbulb" |
|
|
|
} |
|
|
|
|
|
|
|
results = append(results, models.Device{ |
|
|
|
ID: -1, |
|
|
|
BridgeID: b.externalID, |
|
|
|
InternalID: strconv.Itoa(int(panel.ID)), |
|
|
|
Icon: "hexagon", |
|
|
|
Name: fmt.Sprintf("Hexagon %d", i), |
|
|
|
Icon: shapeIcon, |
|
|
|
Name: fmt.Sprintf("%s %d", shapeType, i), |
|
|
|
Capabilities: []models.DeviceCapability{ |
|
|
|
models.DCPower, |
|
|
|
models.DCColorHS, |
|
|
@ -83,7 +93,7 @@ func (b *bridge) Refresh(ctx context.Context) error { |
|
|
|
b.mu.Lock() |
|
|
|
PanelLoop: |
|
|
|
for _, panelInfo := range overview.PanelLayout.Data.PositionData { |
|
|
|
if panelInfo.PanelID == 0 { |
|
|
|
if shapeTypeMap[panelInfo.ShapeType] == "Shapes Controller" { |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|