mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Avoid mutating entity descriptions in screenlogic (#106022)
This commit is contained in:
@@ -272,7 +272,9 @@ async def async_setup_entry(
|
|||||||
cleanup_excluded_entity(coordinator, DOMAIN, chem_sensor_data_path)
|
cleanup_excluded_entity(coordinator, DOMAIN, chem_sensor_data_path)
|
||||||
continue
|
continue
|
||||||
if gateway.get_data(*chem_sensor_data_path):
|
if gateway.get_data(*chem_sensor_data_path):
|
||||||
chem_sensor_description.entity_category = EntityCategory.DIAGNOSTIC
|
chem_sensor_description = dataclasses.replace(
|
||||||
|
chem_sensor_description, entity_category=EntityCategory.DIAGNOSTIC
|
||||||
|
)
|
||||||
entities.append(ScreenLogicPushSensor(coordinator, chem_sensor_description))
|
entities.append(ScreenLogicPushSensor(coordinator, chem_sensor_description))
|
||||||
|
|
||||||
scg_sensor_description: ScreenLogicSensorDescription
|
scg_sensor_description: ScreenLogicSensorDescription
|
||||||
@@ -285,7 +287,9 @@ async def async_setup_entry(
|
|||||||
cleanup_excluded_entity(coordinator, DOMAIN, scg_sensor_data_path)
|
cleanup_excluded_entity(coordinator, DOMAIN, scg_sensor_data_path)
|
||||||
continue
|
continue
|
||||||
if gateway.get_data(*scg_sensor_data_path):
|
if gateway.get_data(*scg_sensor_data_path):
|
||||||
scg_sensor_description.entity_category = EntityCategory.DIAGNOSTIC
|
scg_sensor_description = dataclasses.replace(
|
||||||
|
scg_sensor_description, entity_category=EntityCategory.DIAGNOSTIC
|
||||||
|
)
|
||||||
entities.append(ScreenLogicSensor(coordinator, scg_sensor_description))
|
entities.append(ScreenLogicSensor(coordinator, scg_sensor_description))
|
||||||
|
|
||||||
async_add_entities(entities)
|
async_add_entities(entities)
|
||||||
|
Reference in New Issue
Block a user