Can I get HA version from within a Custom Component?

A recent change to a constant name has broken many custom components. UNIT_PERCENTAGE was changed to PERCENTAGE in 0.115. This is easy enough to fix but the fix will break the custom component for HA versions below 0.115. Is there a way for a custom component to get the current HA version so it can act appropriately in each case?

Thanks

To answer your question:
from homeassistant.const import __version__ as ha_version

However, in your custom_components you should rather than importing this from homeassistant.*.const, you should just create your own const.py and add what you need, that way you will not need to worry about constants changing in core.

Thanks. I took your advice and defined it in const.py within the custom component.