mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 17:40:46 -04:00
fixes, changes, no more periodic sync. since theres enough activity at this point...
This commit is contained in:
@@ -13,6 +13,21 @@ const {
|
||||
} = require('./constants');
|
||||
|
||||
async function turnOffRoomControls() {
|
||||
const lightPolicy = homeAssistantService.getLightPolicyState?.() || null;
|
||||
const lockState = lightPolicy?.lockState || null;
|
||||
if (lockState === 'on') {
|
||||
logger.info('Idle room-controls off skipped because room controls are locked on', {
|
||||
lockState,
|
||||
source: 'idleService:turnOffRoomControls',
|
||||
});
|
||||
return {
|
||||
action: 'roomControlsOff',
|
||||
skipped: true,
|
||||
reason: 'lightsLockedOn',
|
||||
lockState,
|
||||
};
|
||||
}
|
||||
|
||||
const before = homeAssistantService.getState?.().entities || [];
|
||||
const summary = await homeAssistantService.setAllControllableEntitiesState('off', {
|
||||
source: 'idleService:turnOffRoomControls',
|
||||
|
||||
Reference in New Issue
Block a user