The Helm of Brilliance is described in the Dungeon Master's Guide on page 173, and lists the following as a benefit:
As long as the helm has at least one fire opal, you can use an action and speak a command word to cause one weapon you are holding to burst into flames. The flames emit bright light in a 10-foot radius and dim light for an additional 10 feet. The flames are harmless to you and the weapon. When you hit with an attack using the blazing weapon, the target takes an extra 1d6 fire damage. The flames last until you use a bonus action to speak the command word again or until you drop or stow the weapon.
My question is as follows:
Does this benefit also apply to spells cast via a magical staff, such as when casting Fireball via a Staff of Power, or would it only apply to melee attacks with the staff?