File tree Expand file tree Collapse file tree
custom_components/petlibro/pets Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -214,7 +214,10 @@ def portions_enabled(self) -> bool:
214214 @property
215215 def enable_for_manual_feed (self ) -> bool :
216216 """Return True if entity should be enabled for manual feed setting."""
217- if self .desc .petlibro_unit != API .FEED_UNIT :
217+ if (
218+ self .desc .petlibro_unit != API .FEED_UNIT
219+ or "feedingGoal" not in self .desc .key
220+ ):
218221 return True
219222
220223 domain = self .platform_data .domain
@@ -232,6 +235,13 @@ async def async_added_to_hass(self) -> None:
232235 self .async_on_remove (self .pet .on (EVENT_UPDATE , self .async_write_ha_state ))
233236
234237 def _handle_coordinator_update (self ) -> None :
238+ if (
239+ "feedingGoal" in self .desc .key
240+ and self .enabled != self .enable_for_manual_feed
241+ ):
242+ self .hub .unit_entities .schedule_manual_feed_sync ()
243+ _LOGGER .warning ("Feed unit mismatch, reloading integration." )
244+
235245 if self .enabled :
236246 super ()._handle_coordinator_update ()
237247
You can’t perform that action at this time.
0 commit comments