Switching linear models can be used to represent the behavior of time-varying and nonlinear systems, while generally providing a satisfactory trade-off between accuracy and complexity. Although several control design techniques are available for such models, the effect of modeling errors on the closed-loop performance has not been formally evaluated yet. In this talk, an alternative data-driven synthesis scheme is then introduced to design optimal switching controllers directly from data, without needing a model of the plant. In particular, the theory will be developed for piecewise-affine controllers, which have proven to be effective in many real-world engineering applications. The performance of the proposed approach as compared to state-of-the-art switching controls and to other data-driven approaches is illustrated on some benchmark simulation case studies.