Converting "W" to "kWh" with Integration platform - ERROR object has no attribute '__unit_template'

HA 2021.9.2 with a Zigbee (ZHA) based power switch (working fine), which provides this sensor:

sensor.kitchen_coffee_pot_power_meter
State: 93.7
state_class: measurement
unit_of_measurement: W
friendly_name: Kitchen Coffee Pot Power Meter
device_class: power

Trying to use the integration platform to make a sensor to convert to kWh:

sensor:
  - platform: integration
    source: sensor.kitchen_coffee_pot_power_meter
    name: kitchen_coffee_pot_power_energy
    unit_prefix: k
    round: 3

Seems simple enough based on the documentation page, but can’t figure out what I did wrong to keep getting this message each time the source sensor changes state:

2021-09-05 06:00:31 ERROR (MainThread) [homeassistant.helpers.event] Error while processing state change for sensor.kitchen_coffee_pot_power_meter
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 272, in _async_state_change_dispatcher
    hass.async_run_hass_job(job, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 433, in async_run_hass_job
    hassjob.target(*args)
  File "/usr/src/homeassistant/homeassistant/components/integration/sensor.py", line 151, in calc_integration
    self._unit_of_measurement = self._unit_template.format(
AttributeError: 'IntegrationSensor' object has no attribute '_unit_template'

I’ve spent some time looking through the code for that integration and I don’t see how that could happen. @thomasloven did submit a PR that could cause that code to be evaluated sooner than it would have before, and that made it into 2021.9. But as far as I can tell, you’ll either have a unit_of_measurement or not, and if not, you should have a _unit_template that assembles the UoM from the prefix/suffix and unit_of_measurement from the source sensor. I recommend filing an issue on Github.

Thank you for the prompt response and sanity check. I was thinking the same, but figured I ask before rushing to GitHub.

Opened: https://github.com/home-assistant/core/issues/55802