Given the UX specifications above, build a temperature card based off of the reference images above.
Asked in the Android take-home stage. The card has three temperature phases, Bedtime, Night, and Dawn, four states, Off, Idle, Cooling, and Warming, and a selected phase. Tapping OFF turns temperature on. Tapping the temperature value turns it off. Adjustments are disabled when Off, and values range from -10 to +10, where 0 is neutral. The chevron has no click behavior.
Implement temperature_card(initial_temperatures, initial_state, actions). Temperatures are a three-item list ordered Bedtime, Night, Dawn. Actions are dictionaries such as {"type": "select", "phase": 2}, {"type": "increment"}, {"type": "decrement"}, {"type": "tap_off"}, {"type": "tap_value"}, {"type": "set_state", "state": "Cooling"}, or {"type": "tap_chevron"}. Return the final state as {"temperatures": [...], "selected": index, "state": state}.
def temperature_card(initial_temperatures, initial_state, actions):