Thermomechanics of piezoelectrics defective by dislocations