diff --git a/apps/machine/src/stores/atm.ts b/apps/machine/src/stores/atm.ts index f6b1793..98d420b 100644 --- a/apps/machine/src/stores/atm.ts +++ b/apps/machine/src/stores/atm.ts @@ -665,6 +665,18 @@ export const useAtmStore = defineStore('atm', () => { }, }) + // Watch state transitions to enable/disable validator hardware + watch(nestedState, (newState, oldState) => { + if (newState === 'insertingBills' && oldState !== 'insertingBills') { + console.log('[ATM] Enabling bill validator') + hal.enableValidator() + } + if (oldState === 'insertingBills' && newState !== 'insertingBills') { + console.log('[ATM] Disabling bill validator') + hal.disableValidator() + } + }) + console.log('[ATM] Fully initialized with HAL + Lightning') } catch (error) { console.error('[ATM] HAL initialization failed:', error)