`Bus:Handling` flooding in integration

I have been using an integration that I had written here: GitHub - sshaikh/homeassistant-lupt: A custom integration for Home Assistant that offers London Unified Prayer Times

It’s been working well for the past four years, and I’ve not had to maintain it much.

For other reasons, I needed to run debug on core:

action: logger.set_level
data: {homeassistant.core: debug}

On doing so I received a flood of Bus:Handling messages in the logs, which ultimately takes down HA and the host:

2025-05-15 00:00:33.867 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_reported[L]: entity_id=lupt.lupt, old_last_reported=2025-05-15T00:00:33.867777+01:00, new_state=<state lupt.lupt=Ishā; last_updated=2025-05-13T23:15:02.279573+00:00, min_date=2025-01-01, max_date=2025-12-31, num_dates=365, next_fajr=2025-05-15T02:21:00+00:00, next_sunrise=2025-05-15T04:06:00+00:00, next_zuhr=2025-05-15T12:02:00+00:00, next_asr=2025-05-15T16:10:00+00:00, next_maghrib=2025-05-15T19:49:00+00:00, next_ishā=2025-05-15T20:59:00+00:00, islamic_date=16 Dhū Al-Qa'dah 1446, islamic_year=1446, islamic_month=Dhū Al-Qa'dah, islamic_day=16, friendly_name=London Unified Prayer Times @ 2025-05-14T21:58:00.000794+01:00>>
2025-05-15 00:00:33.867 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event state_reported[L]: entity_id=lupt.lupt, old_last_reported=2025-05-15T00:00:33.867866+01:00, new_state=<state lupt.lupt=Ishā; last_updated=2025-05-13T23:15:02.279573+00:00, min_date=2025-01-01, max_date=2025-12-31, num_dates=365, next_fajr=2025-05-15T02:21:00+00:00, next_sunrise=2025-05-15T04:06:00+00:00, next_zuhr=2025-05-15T12:02:00+00:00, next_asr=2025-05-15T16:10:00+00:00, next_maghrib=2025-05-15T19:49:00+00:00, next_ishā=2025-05-15T20:59:00+00:00, islamic_date=16 Dhū Al-Qa'dah 1446, islamic_year=1446, islamic_month=Dhū Al-Qa'dah, islamic_day=16, friendly_name=London Unified Prayer Times @ 2025-05-14T21:58:00.000794+01:00>>

The only difference in the messages being the old_last_reported value. My questions then:

  1. Given that HA runs fine with debug off, is this okay?
  2. If not, can someone kindly explain what the integration is doing that’s so criminal? I thought it was pretty straight forward.

So, a few things here.

  1. It is probable (likely) that the cause of HA locking up when running debug is due to the volume of debug messages overloading HAs ability to keep up writing these to the log.
  2. Looking at the 2 log lines you provided asks the question as to why your integration is doing entity updates in such rapid succession. If you have lots of these lines in rapid succession, then this is where you need to investigate. Having a quick look at your code says it should update once a day? So, something is causing continual updates, which is obviously bad.
  1. Yes I agree. I’m surprised (impressed?) that this isn’t still causing issues with debug off (although I do remember something about HA automatically throttling updates?)
  2. It should update once a day but I also provide the facility to set offsets to known upcoming events, modelled off of sun which lets you set triggers like “thirty minutes before sunset”. Perhaps something has changed in the last four years which required an update to this approach, since apart from that facility the integration is pretty vanilla.