mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix unnecessary calls to update entity display_precision (#118159)
This commit is contained in:
parent
80371d3a73
commit
dff8c06166
@ -787,10 +787,10 @@ class SensorEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
|
|||||||
display_precision = max(0, display_precision + ratio_log)
|
display_precision = max(0, display_precision + ratio_log)
|
||||||
|
|
||||||
sensor_options: Mapping[str, Any] = self.registry_entry.options.get(DOMAIN, {})
|
sensor_options: Mapping[str, Any] = self.registry_entry.options.get(DOMAIN, {})
|
||||||
if (
|
if "suggested_display_precision" not in sensor_options:
|
||||||
"suggested_display_precision" in sensor_options
|
if display_precision is None:
|
||||||
and sensor_options["suggested_display_precision"] == display_precision
|
return
|
||||||
):
|
elif sensor_options["suggested_display_precision"] == display_precision:
|
||||||
return
|
return
|
||||||
|
|
||||||
registry = er.async_get(self.hass)
|
registry = er.async_get(self.hass)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user