Detect a connected USB-C charger cable that is not charging
In about this Mac, overview -> System Report -> Power, last block displays connected and charging info. Cannot comment on programmatically retrieving.