switch isplugged check to use charging_state

charger_pilot_current does not reliably return on the first call
it is often null, so switch the the more reliable charging_state  value
for the check