@property
def device_class(self) -> (str | None):
    'Return the class of this device, from component DEVICE_CLASSES.'
    if hasattr(self, '_attr_device_class'):
        return self._attr_device_class
    if hasattr(self, 'entity_description'):
        return self.entity_description.device_class
    return None
Return the class of this device, from component DEVICE_CLASSES.
@property
def device_class(self) -> (str | None):
    
    if hasattr(self, '_attr_device_class'):
        return self._attr_device_class
    if hasattr(self, 'entity_description'):
        return self.entity_description.device_class
    return None