An LED lighting tube including a heat-dissipating tubular envelope having an LED assembly directly affixed to an inner surface of the heat-dissipating tubular envelope and a safety switch included on at least one end cap on an end of the heat-dissipating tubular envelope. A method of preventing shocks to an individual inserting or removing an LED lighting tube from an electrical socket by an individual inserting or removing the LED lighting tube including a safety switch on an end cap from an electrical socket, providing power to the LED lighting tube only when the safety switch is activated, and preventing shocks to the individual.