parameters: (value)
return_statement: return value
docstring: Coerce this configuration option to a lambda.
docstring_summary: Coerce this configuration option to a lambda.
docstring_tokens: Coerce this configuration option to a lambda .
function: def lambda_(value):
      """Coerce this configuration option to a lambda."""
      if not isinstance(value, Lambda):
          value = make_data_base(Lambda(string_strict(value)), value)
      entity_id_parts = re.split(LAMBDA_ENTITY_ID_PROG, value.value)
      if len(entity_id_parts) != 1:
          entity_ids = " ".join(
              f"'{entity_id_parts[i]}'" for i in range(1, len(entity_id_parts), 2)
          )
          raise Invalid(
              f"Lambda contains reference to entity-id-style ID {entity_ids}. The id() wrapper only works for ESPHome-internal types. For importing states from Home Assistant use the 'homeassistant' sensor platforms."
          )
      return value
function_tokens: def lambda_ ( value ) : if not isinstance ( value , Lambda ) : value = make_data_base ( Lambda ( string_strict ( value ) ) , value ) entity_id_parts = re . split ( LAMBDA_ENTITY_ID_PROG , value . value ) if len ( entity_id_parts ) != 1 : entity_ids = " " . join ( f"'{entity_id_parts[i]}'" for i in range ( 1 , len ( entity_id_parts ) , 2 ) ) raise Invalid ( f"Lambda contains reference to entity-id-style ID {entity_ids}. The id() wrapper only works for ESPHome-internal types. For importing states from Home Assistant use the 'homeassistant' sensor platforms." ) return value