Reading Device Labels

Is there a way to read labels from devices using YAML, or is that only possible with entities? I’ve assigned labels to my devices and now want to filter them by that label, but I can only find the command for reading labels from entities.

You can use device entities:

{{device_entities("f759b96405c118a1a2e1ff06e457a32b")[0] }}

to get one entity associated with the device and use whatever template you had to get the label.
Or according to Templating - Home Assistant the labels() should work with device ID also.
I have never used labels so I can’t test it.