diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 85ee1e28309..0b48c78aa0d 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -938,17 +938,15 @@ class AllStates: def __call__( self, entity_id: str, - rounded: bool | object = _SENTINEL, + rounded: bool = True, with_unit: bool = False, ) -> str: """Return the states.""" state = _get_state(self._hass, entity_id) if state is None: return STATE_UNKNOWN - if rounded is _SENTINEL: - rounded = with_unit if rounded or with_unit: - return state.format_state(rounded, with_unit) # type: ignore[arg-type] + return state.format_state(rounded, with_unit) return state.state def __repr__(self) -> str: diff --git a/tests/helpers/test_template.py b/tests/helpers/test_template.py index 82b6434cf3f..0e6bc852e31 100644 --- a/tests/helpers/test_template.py +++ b/tests/helpers/test_template.py @@ -5183,7 +5183,7 @@ def test_state_with_unit_and_rounding( assert tpl.async_render() == "23.02 beers" assert tpl2.async_render() == "23.015 beers" - assert tpl3.async_render() == 23.015 + assert tpl3.async_render() == 23.02 assert tpl4.async_render() == 23.015 assert tpl5.async_render() == "23.02 beers" assert tpl6.async_render() == "23.015 beers"