This commit is contained in:
Koen Kanters 2020-09-27 22:14:29 +02:00
parent 546d6193a3
commit 4bb3ddcff2
3 changed files with 6 additions and 5 deletions

View File

@ -68,7 +68,7 @@ class Controller {
this.extensions.push(new ExtensionBridge(...args, this.enableDisableExtension));
}
if (settings.get().experimental.frontend) {
if (settings.get().frontend) {
this.extensions.push(new ExtensionFrontend(...args));
}

View File

@ -25,9 +25,9 @@ class Frontend extends Extension {
this.onWebSocketConnection = this.onWebSocketConnection.bind(this);
this.server = http.createServer(this.onRequest);
this.server.on('upgrade', this.onUpgrade);
this.developmentServer = settings.get().experimental.frontend.development_server;
this.developmentServer = settings.get().frontend.development_server;
this.development = !!this.developmentServer;
this.port = settings.get().experimental.frontend.port || 8080;
this.port = settings.get().frontend.port || 8080;
this.retainedMessages = new Map();
if (this.development) {

View File

@ -84,7 +84,8 @@ describe('Frontend', () => {
data.writeDefaultConfiguration();
data.writeDefaultState();
settings._reRead();
settings.set(['experimental'], {new_api: true, frontend: {port: 8081}});
settings.set(['experimental'], {new_api: true});
settings.set(['frontend'], {port: 8081});
settings.set(['homeassistant'], true);
});
@ -177,7 +178,7 @@ describe('Frontend', () => {
});
it('Development server', async () => {
settings.set(['experimental', 'frontend'], {development_server: 'localhost:3001'});
settings.set(['frontend'], {development_server: 'localhost:3001'});
controller = new Controller();
await controller.start();
expect(mockHTTPProxy.variables.initParameter).toStrictEqual({ws: true});