In a victim impact statement read out by Judge Mackintosh, she said the incident had impacted her and her 5-year-old son badly.
The drug dealing charges related to police stopping Wang after seeing him leave the address of a known drug dealer with a large bag on February 22 last year.
When they opened the bag, they found 38 grams of cannabis inside separate bags.
Wang was also arrested in relation to Operation Flock which targeted methamphetamine supply across Hawke's Bay, for supplying nine grams.
Judge Mackintosh acknowledged Wang's drug use had contributed to the offending and commended him for being "drug free" since being released from custody.
"You are considered to be a person of potential," she said.
"You are trying and that's also really good."
She also acknowledged cultural factors which led to him being bullied at kohanga reo for his Chinese heritage; his remorse, and guilty pleas.
A further four months were deducted for time already spent in custody and while on electronically-monitored bail.
Wang was sentenced to eight months' home detention to be followed by six months of post-release conditions.
In relation to discharging a firearm, he was convicted and discharged.