Version 0.2.0
continuous-integration/drone/push Build is passing

* Hide nanoleaf:IP devices in UI
* Color clicking behavior is more clear
* small icons for mega-groups
* common tags/roles for groups
* fix default names in UI state
* hexagon corner
* secondary lamp icon
* fix selection bugs in device form
* select all/none hotkey
* quick assign modal
This commit is contained in:
2023-10-21 14:02:49 +02:00
parent f00575fd7f
commit 5fee980f79
39 changed files with 873 additions and 47 deletions
+16 -1
View File
@@ -24,7 +24,6 @@ func (d *Data) WithPatch(patches ...Patch) Data {
if patch.Device != nil {
pd := d.ensureDevice(patch.Device.ID)
gentools.ApplyUpdate(&pd.Name, patch.Device.Name)
gentools.ApplyUpdatePtr(&pd.HWState, patch.Device.HWState)
gentools.ApplyUpdatePtr(&pd.HWMetadata, patch.Device.HWMetadata)
gentools.ApplyUpdatePtr(&pd.DesiredState, patch.Device.DesiredState)
@@ -66,6 +65,22 @@ func (d *Data) WithPatch(patches ...Patch) Data {
pd.Icon = patch.Device.HWMetadata.Icon
}
}
if patch.Device.HWState != nil {
hasName := false
for _, alias := range pd.Aliases {
if strings.HasPrefix(alias, "lucifer:name:") {
hasName = true
break
}
}
if !hasName {
pd.Aliases = append(pd.Aliases, "lucifer:name:"+patch.Device.HWState.InternalName)
}
if pd.Name == "" {
pd.Name = patch.Device.HWState.InternalName
}
}
if patch.Device.ClearAssignment {
pd.Assignment = nil
}
-3
View File
@@ -24,8 +24,6 @@ func (e Patch) VerboseKey() string {
func (e Patch) EventDescription() string {
if e.Device != nil {
switch {
case e.Device.Name != nil:
return fmt.Sprintf("uistate.Patch(device=%s, name=%s)", e.Device.ID, *e.Device.Name)
case e.Device.DesiredState != nil:
return fmt.Sprintf("uistate.Patch(device=%s, desiredState=%s)", e.Device.ID, e.Device.DesiredState.String())
case e.Device.HWState != nil:
@@ -56,7 +54,6 @@ func (e Patch) EventDescription() string {
type DevicePatch struct {
ID string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
HWMetadata *events.HardwareMetadata `json:"hwMetadata,omitempty"`
HWState *events.HardwareState `json:"hwState,omitempty"`
DesiredState *device.State `json:"desiredState,omitempty"`