mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-18 02:20:47 -04:00
this is a big slop that might backfire lol... new config system and UI!
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
// Neato Configuration
|
||||
// Purpose: Defines the Neato device mapping nested beneath the shared Home Assistant connection.
|
||||
// Scope: Exports a nested configuration fragment without initializing either service.
|
||||
const { strictObject, string, boolean } = require('../../configuration/schemaHelpers');
|
||||
|
||||
module.exports = {
|
||||
key: 'neato',
|
||||
feature: true,
|
||||
defaultValue: { enabled: false, device: '' },
|
||||
schema: strictObject({
|
||||
enabled: boolean(),
|
||||
device: string({ description: 'ESPHome device name.', maxLength: 255 }),
|
||||
}, { title: 'Neato', required: ['enabled', 'device'] }),
|
||||
};
|
||||
@@ -4,8 +4,7 @@
|
||||
const EventEmitter = require('events');
|
||||
const io = require('../../globals/io');
|
||||
const logger = require('../../globals/logger').child('neatoService');
|
||||
const { loadConfig } = require('../../helpers/configLoader');
|
||||
const { isFeatureEnabled } = require('../../helpers/features');
|
||||
const { loadConfig } = require('../../configuration');
|
||||
const { isVerified } = require('../verificationService');
|
||||
const { getMode, MODES } = require('../modeManager');
|
||||
const { isAdmin, isLockdownAdmin } = require('../roleService');
|
||||
@@ -22,7 +21,7 @@ const events = new EventEmitter();
|
||||
const config = loadConfig();
|
||||
const haConfig = config.homeAssistant || {};
|
||||
const neatoConfig = haConfig.neato || {};
|
||||
const featureEnabled = isFeatureEnabled('neato');
|
||||
const featureEnabled = Boolean(neatoConfig.enabled);
|
||||
|
||||
function normalizeDeviceName(value) {
|
||||
const raw = String(value || '').trim().toLowerCase();
|
||||
@@ -170,7 +169,7 @@ function buildState() {
|
||||
const requiredIds = requiredEntityIds();
|
||||
const entitiesAvailable = requiredIds.length > 0 && requiredIds.every((id) => isEntityAvailable(id));
|
||||
const connected = Boolean(haConnected && entitiesAvailable);
|
||||
const enabled = Boolean(featureEnabled && homeAssistantEnabled && configured);
|
||||
const enabled = featureEnabled;
|
||||
|
||||
const controls = {
|
||||
start: {
|
||||
|
||||
Reference in New Issue
Block a user