mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Avoid dict comp in statistic_during_period if there is no conversion (#93699)
This commit is contained in:
parent
53fe74e055
commit
493d78f070
@ -1478,7 +1478,9 @@ def statistic_during_period(
|
|||||||
state_unit = state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
state_unit = state.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
convert = _get_statistic_to_display_unit_converter(unit, state_unit, units)
|
convert = _get_statistic_to_display_unit_converter(unit, state_unit, units)
|
||||||
|
|
||||||
return {key: convert(value) if convert else value for key, value in result.items()}
|
if not convert:
|
||||||
|
return result
|
||||||
|
return {key: convert(value) for key, value in result.items()}
|
||||||
|
|
||||||
|
|
||||||
_type_column_mapping = {
|
_type_column_mapping = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user