Custom Template Sensor with Attributes

I want to create a custom sensor that is updated from outside HA. This is my sensor right now:

- platform: template
  sensors:
    my_custom_sensor_state:
      friendly_name: My Custom Sensor
      value_template: "standby"

I want it to have a device_class of enum and a list of options on the sensor as attributes. Can’t find much on doing this in yaml. Any ideas on how to do this or if it can be done at all?
Thanks

template:
- sensor:
  - name: My Custom Sensor
    device_class: enum
    state: standby
    attributes:
      options: >
        {{ ['x', 'y', 'z', 'standby'] }}

Thank you! That worked perfectly! Now, is there a way to create a custom device that holds these new custom sensors? If this should be a new thread, just let me know.

Nope, you can’t manually create devices. The entity will exist in your system, just not attached to a device. You’ll have to use normal triggers, conditions, or actions instead of device triggers, conditions, and actions.

Gotcha. Thanks for the quick response.