Lovelace Custom Fan Card Example

This works well but the only problem is the last fan speed stays selected when you turn the fan off . Seems like the card does not reset the state when the fan is off. You have to choose another fan speed to start it again.

A similar problem was fixed in the old interface --> Fan Control. Has anyone got this working in lovelace?