mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Avoid mutating entity descriptions in efergy (#105626)
This commit is contained in:
parent
dff7725c1f
commit
abac68f158
@ -1,6 +1,7 @@
|
|||||||
"""Support for Efergy sensors."""
|
"""Support for Efergy sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import dataclasses
|
||||||
from re import sub
|
from re import sub
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
@ -121,7 +122,10 @@ async def async_setup_entry(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
description.entity_registry_enabled_default = len(api.sids) > 1
|
description = dataclasses.replace(
|
||||||
|
description,
|
||||||
|
entity_registry_enabled_default=len(api.sids) > 1,
|
||||||
|
)
|
||||||
for sid in api.sids:
|
for sid in api.sids:
|
||||||
sensors.append(
|
sensors.append(
|
||||||
EfergySensor(
|
EfergySensor(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user