This repository has been archived by the owner on Nov 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(LIGHT): show color picker based on feature check (#488)
This is a behavior change since now even if the user doesn't define sliders and light supports color change then picker will still show up on long press.
- Loading branch information
Showing
8 changed files
with
94 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
env: | ||
browser: true | ||
es2017: true | ||
es2020: true | ||
node: true | ||
parserOptions: | ||
sourceType: module | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import angular from 'angular'; | ||
import { TILE_DEFAULTS, TYPES } from '../globals/constants'; | ||
|
||
export function mergeConfigDefaults (pages) { | ||
for (const page of pages) { | ||
for (const group of page.groups) { | ||
mergeTileListDefaults(group.items); | ||
} | ||
} | ||
return pages; | ||
} | ||
|
||
function mergeTileListDefaults (tiles) { | ||
if (!Array.isArray(tiles)) { | ||
return; | ||
} | ||
for (const [index, tile] of tiles.entries()) { | ||
tiles[index] = mergeTileDefaults(tile); | ||
switch (tile.type) { | ||
case TYPES.CAMERA: | ||
case TYPES.CAMERA_STREAM: | ||
case TYPES.CAMERA_THUMBNAIL: | ||
tile.fullscreen = mergeTileDefaults(tile.fullscreen); | ||
break; | ||
case TYPES.DOOR_ENTRY: | ||
if (tile.layout?.camera) { | ||
tile.layout.camera = mergeTileDefaults(tile.layout.camera); | ||
} | ||
mergeTileListDefaults(tile.layout?.tiles); | ||
break; | ||
case TYPES.POPUP: | ||
mergeTileListDefaults(tile.popup?.items); | ||
break; | ||
} | ||
} | ||
return tiles; | ||
} | ||
|
||
function mergeTileDefaults (tile) { | ||
if (tile && tile.type in TILE_DEFAULTS) { | ||
return angular.merge({}, TILE_DEFAULTS[tile.type], tile); | ||
} | ||
return tile; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters