what is a device? did you mean PC, a collections of devices and chips:? a PC Is not a DEVICE it is a system.(or machine)
why in the world not buy a new battery first? if charging fails.
mine sometimes go bad even 1 year old, when I abuse it. and
I fully expect that, if you read the battery makers pages, youd learn how that happens' (cycling the snarf out of it)
if i remove the word DEVICE and add LAPTOP OR PC
THE ANSWER IS THIS.
IF the Pc does not run with the battery (main big) out !
the power pack is bad. the PC will run forever on AC power, a fact, !!! I do so all the time,
or even the wrong AC pack used, (mixed up with other pc:)
get a new pack, get one matching your systems, needs (watts)
the laptops can come with 5 processor options and 4 graphic chip options, the worse mix is 100watts, HP will tell you that match.
but only if YOU tell your full service tag data....
that magic, nnnnnnnABA# number tells the HP pro what is inside this laptop and what power park is right
or just buy the 19v, 100watt pack.
here is real HP, fixya is NOT.
they can match you up as can the hp PARTS SURFER,
https://h30434.www3.hp.com/