def GetOSVersion():
  cmd = ['sw_vers', '-productVersion']
  out, err, rc = RunProcess(cmd)  # pylint: disable=unpacking-non-sequence
  if rc != 0:
    raise GmacpyutilException('Unable to retrieve OS version - Error: %s.', err)
  os_version = out.strip()
  match = re.match(r'([0-9]+\.)', os_version)
  if not match:
    raise GmacpyutilException('Unexpected OS version returned.')
  return os_version
Setup the template sensors.
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/gmacpyutil.py/GetOSVersion--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sensor/template.py/setup_platform