Dyson has branded an EU ruling as "deplorable" after the vacuum cleaner manufacturer lost a legal battle to change energy labelling laws.

Sir James Dyson, the British technology firm's founder, argued that vacuum cleaners were only tested when they were empty of dust which could mislead customers about their environmental impact.

The company - best known for its bagless vacuum cleaner - said current testing did not "simulate real life" and allowed some manufacturers to "state an artificially high level of performance".

But in a ruling, the European Court of Justice (ECJ) said it "dismisses Dyson's action in its entirety" because the company had failed to show there were more reliable and accurate tests.

The court also ruled out Dyson's claim that the current regulations "discriminate" in favour of bagged vacuum cleaners.

Ukip said they hoped the court's decision was not affected by Sir James's previous comments stating his desire for Britain to leave the EU.

Following the ruling, a Dyson spokeswoman said: "It is deplorable that the European Court of Justice endorses tests that don't attempt to represent in-home use, and we believe this is causing consumers to be misled.

"By this judgment, the ECJ has given its support to unrepresentative tests devised by the commission with a small group of European manufacturers which in our view disregards the interests of consumers in Europe.

"The judgment is all the more surprising in view of the revelations about car testing in the VW scandal where the tests do not reflect real life usage.

"We don't believe the ECJ is acting in the interests of consumers and will continue to fight for testing and labelling, which is."

In separate case, Dyson launched legal action last month against rivals Bosch and Siemens alleging that they were misleading consumers in behaviour "akin to the Volkswagen scandal".

It claimed that independent testing had shown that machines made by Bosch and Siemens could draw more than 1600W of power when used in the home while containing dust despite having a rating of 750W gained in dust-free testing. This would mean a rating as high as AAAA in test conditions could drop to an E or F in the home.

BSH Home Appliances, the parent company of Bosch and Siemens, announced it was taking legal steps against Dyson over the "unfounded and untrue" statements.

Following the EU ruling, Ukip MEP Margot Parker, the party's small business spokeswoman, said: "It is sad to see the European Court of Justice strike down a fair and reasonable complaint with such ease.

"Evidently the form of testing used does not allow for an equal evaluation of different types of vacuums. Unfortunately for Sir James Dyson, he has found himself on the end of yet more anti-competitive, bureaucratic and ill-conceived European regulation."

Ms Parker added that she hoped Sir James's "previously stated desire for Britain to leave the European Union" had no impact on the ruling.