You'd need the USB port, hub it's plugged into, all the way to the controller, to be aware of passing this information around, though you could probably use any sort of reporting on total voltage/amperage downstream for detecting it if it reported that information.
(Unfortunately, AFAIK, most USB hubs don't report power draw for devices that are "just" drawing power and don't use the data pins, so you don't get that.)
(Unfortunately, AFAIK, most USB hubs don't report power draw for devices that are "just" drawing power and don't use the data pins, so you don't get that.)