fixes, changes, no more periodic sync. since theres enough activity at this point...

This commit is contained in:
legop3
2026-04-30 13:18:19 -04:00
parent 962d2ae61e
commit b2a2296d98
13 changed files with 133 additions and 84 deletions
@@ -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',