parameters: ()
docstring: Add sensor.
docstring_summary: Add sensor.
docstring_tokens: Add sensor .
function: def add_sensor():
      """Add sensor."""
      hacs = get_hacs()
  
      try:
          if hacs.configuration.config_type == "yaml":
              hacs.hass.async_create_task(
                  discovery.async_load_platform(
                      hacs.hass, "sensor", DOMAIN, {}, hacs.configuration.config
                  )
              )
          else:
              hacs.hass.async_add_job(
                  hacs.hass.config_entries.async_forward_entry_setup(
                      hacs.configuration.config_entry, "sensor"
                  )
              )
      except ValueError:
          pass
function_tokens: def add_sensor ( ) : hacs = get_hacs ( ) try : if hacs . configuration . config_type == "yaml" : hacs . hass . async_create_task ( discovery . async_load_platform ( hacs . hass , "sensor" , DOMAIN , { } , hacs . configuration . config ) ) else : hacs . hass . async_add_job ( hacs . hass . config_entries . async_forward_entry_setup ( hacs . configuration . config_entry , "sensor" ) ) except ValueError : pass