Template for binary sensor - unit of measurement failing

Had this working from a previous install but not sure why it isn’t working now. Taking the battery state of the wyzesense and making battery sensors. Fails configuration check for unit_of_measurement. Any ideas would be appreciated:

  - platform: template
        friendly_name: "Office Window Battery Level"
        entity_id: binary_sensor.wyzesense_xxxxxxxx
        unit_of_measurement: '%'
        value_template: >-
            {{ state_attr('binary_sensor.wyzesense_xxxxxxxxx', 'battery_level') }}
        device_class: battery
        icon_template: mdi:battery

Throws back the following when I check configuration:
Invalid config for [binary_sensor.template]: [unit_of_measurement] is an invalid option for [binary_sensor.template]. Check: binary_sensor.template->sensors->battery_office_window->unit_of_measurement. (See ?, line ?).

Based on what I read here about battery sensors:

Are you creating a binary sensor or a sensor ? A binary sensor only has 2 states, on or off. So no unit_of_measurement.

Well now I feel foolish. I sat and looked at this for hours trying to figure out. Double checked and boom it wasn’t in the sensor part of my configuration. Thank you!!!