Skip to content

Commit 33005d7

Browse files
committed
refactor: remove non-functional entity_registry_enabled_default_fn callbacks
The base PL_PetEntity.entity_registry_enabled_default property uses an 'or super()' fallback that defaults to True, meaning these callbacks could never actually disable entities. Remove them rather than ship dead code.
1 parent e37d060 commit 33005d7

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

custom_components/petlibro/pets/entity.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -563,10 +563,6 @@ async def _async_update_avatar(self, url: str | None) -> None:
563563
name="Today's Fountain Drinking Count",
564564
icon="mdi:water-plus",
565565
state_class=SensorStateClass.TOTAL_INCREASING,
566-
entity_registry_enabled_default_fn=lambda pet, _: any(
567-
d.get("productName") == "Dockstream Smart RFID Fountain"
568-
for d in pet.boundDevices
569-
),
570566
),
571567
PL_PetSensorEntityDescription(
572568
key="today_fountain_drinking_amount",
@@ -577,10 +573,6 @@ async def _async_update_avatar(self, url: str | None) -> None:
577573
device_class=SensorDeviceClass.VOLUME,
578574
native_unit_of_measurement=UnitOfVolume.MILLILITERS,
579575
petlibro_unit=API.WATER_UNIT,
580-
entity_registry_enabled_default_fn=lambda pet, _: any(
581-
d.get("productName") == "Dockstream Smart RFID Fountain"
582-
for d in pet.boundDevices
583-
),
584576
),
585577
PL_PetSensorEntityDescription(
586578
key="today_fountain_drinking_time",
@@ -590,10 +582,6 @@ async def _async_update_avatar(self, url: str | None) -> None:
590582
state_class=SensorStateClass.TOTAL_INCREASING,
591583
device_class=SensorDeviceClass.DURATION,
592584
native_unit_of_measurement=UnitOfTime.SECONDS,
593-
entity_registry_enabled_default_fn=lambda pet, _: any(
594-
d.get("productName") == "Dockstream Smart RFID Fountain"
595-
for d in pet.boundDevices
596-
),
597585
),
598586
),
599587
PL_PetImageEntity: (

0 commit comments

Comments
 (0)