parameters: (
          hass,
          service_name,
          entity_id,
          variable_data=None,
  )
return_statement: return
docstring: Call a HA service.
docstring_summary: Call a HA service.
docstring_tokens: Call a HA service .
function: async def _async_call_service(
          hass,
          service_name,
          entity_id,
          variable_data=None,
  ):
      """Call a HA service."""
      service_data = {
          CONF_SERVICE: service_name,
          CONF_SERVICE_ENTITY_ID: entity_id,
      }
  
      if variable_data:
          service_data[CONF_SERVICE_DATA] = variable_data
  
      try:
          await async_call_from_config(
              hass, service_data, blocking=False, validate_config=True,
          )
      except HomeAssistantError as ex:
          _LOGGER.error("SamsungTV Smart - error %s", ex)
  
      return
function_tokens: async def _async_call_service ( hass , service_name , entity_id , variable_data = None , ) : service_data = { CONF_SERVICE : service_name , CONF_SERVICE_ENTITY_ID : entity_id , } if variable_data : service_data [ CONF_SERVICE_DATA ] = variable_data try : await async_call_from_config ( hass , service_data , blocking = False , validate_config = True , ) except HomeAssistantError as ex : _LOGGER . error ( "SamsungTV Smart - error %s" , ex ) return