In this note, we propose a unified framework for the study of hybrid systems, where the tasks of the systems are encoded as signal temporal logic (STL) specifications. First, we establish the mathematical expression of a class of hybrid systems consisting of continuous and logical parts. Then, we introduce the concept of locally finite time interval dwell (LFTID), which matches the conditions to satisfy such the STL specifications. After that, combining the semi-tensor product (STP) and Lyapunov-like methods, we obtain the sufficient conditions to satisfy the given STL specifications. This approach can be used to study temporal tasks and properties of hybrid systems, such as practical stability, finite-time stability, etc. Furthermore, we consider a special class of hybrid systems with control. Based on the theoretical analysis, a controller design algorithm that enables the system to fulfill the most tasks is provided. Finally, the effectiveness of the method is illustrated by an example.