Changing radio buttons baised on a value

I would like to have 4 radio buttons to be selected or not depending on a value that the device sends the agent.
Such as 1,2,4, or 8.

how can I add / remove the "checked " to the radio. or some other way to do it.

Button Inputs

Input 1

Input 2

Input 3

Input 4


Got it working now.