Thermodynamics of deterministic finite automata operating locally and periodically