Skip to content

Add string formats (capitalize, title, upper, and lower) #367

@MiguelTVMS

Description

@MiguelTVMS

On the formatters add support for string formatters like capitalize, title, upper, and lower this goes on par with the Jinja template filters.

Examples on climate.office_radiator_valve

{{ state_attr('climate.office_radiator_valve', 'hvac_action') }} = idle
{{ state_attr('climate.office_radiator_valve', 'hvac_action') | capitalize }} = Idle

Other Examples

{{ 'title test' | title }} = Title Test
{{ 'uppercase' | upper }} = UPPERCASE
{{ 'LowerCase' | lower }} = lowercase 

Giving us these formatters avoid situations lie this
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions