Skip to content

Commit

Permalink
core: fix wonky settings
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Mar 6, 2023
1 parent d01c0fa commit b500473
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions plugins/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.1.96",
"version": "0.1.99",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
3 changes: 1 addition & 2 deletions plugins/core/src/builtins/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ export class Scheduler {
throw new Error('sunrise/sunset clock not supported');
}



const ret: ScryptedDevice = {
async setName() { },
async setType() { },
async setRoom() { },
async setMixins() { },
async probe() { return true },
listen(event: EventListenerOptions, callback, source?: ScryptedDeviceBase) {
function reschedule(): Date {
Expand Down
3 changes: 3 additions & 0 deletions plugins/core/ui/src/components/builtin/system-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export function createSystemSettingsDevice(systemManager: SystemManager): Scrypt
},
async probe() {
return true;
},
async setMixins() {

},
listen(event, callback) {
let listeners = systemSettings.map(d => d.listen(event, callback));
Expand Down
5 changes: 3 additions & 2 deletions plugins/core/ui/src/interfaces/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ export default {
get() {
if (this.rawSettingsGroupName)
return this.rawSettingsGroupName;
return Object.keys(this.settingsGroups)?.[0] || 'extensions';
return Object.values(this.settingsGroups)?.[0] || 'extensions';
},
set(value) {
this.rawSettingsGroupName = value;
this.rawSettingsSubgroupName = undefined;
},
},
settingsSubgroupName: {
Expand All @@ -110,7 +111,7 @@ export default {
return;
if (this.settingsSubgroups.findIndex(sg => sg === this.rawSettingsSubgroupName) !== -1)
return this.rawSettingsSubgroupName;
return Object.keys(this.settingsSubgroups)?.[0];
return Object.values(this.settingsSubgroups)?.[0];
},
set(value) {
this.rawSettingsSubgroupName = value;
Expand Down

0 comments on commit b500473

Please sign in to comment.