🗑 Custom Home Assistant sensor for scheduling garbage collection (or other regularly re-occurring events - weekly on given days, semi-weekly or monthly)
MIT License
383
stars
90
forks
source link
Garbage collection schedule ignores first & last month #442
[X] I'm running the newest version of Garbage Collection, or the next pre-release.
[X] I have enabled debug logging for my installation.
Describe the bug
When recently changing my weekly garbage collection frequency from March-October to February-November I noticed that the date range is ignored and garbage collection is scheduled in December and January too.
I tried with a new entity and the behavior is the same.
Configuration:
Result in calendar:
Configuration
Downloading diagnostics for this new entity doesn't work. Getting 500 error from HA.
Here's diagnostics of the updated entity (same config, same behavior):
No logs related to this newly created entity.
This instead (probably unrelated to the scheduling issue):
Logger: aiohttp.server
Source: custom_components/garbage_collection/diagnostics.py:21
Integration: Garbage Collection (documentation, issues)
First occurred: 9:58:26 AM (3 occurrences)
Last logged: 10:03:17 AM
Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 81, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/diagnostics/__init__.py", line 211, in get
data = await info[d_type.value](hass, config_entry)
File "/config/custom_components/garbage_collection/diagnostics.py", line 18, in async_get_config_entry_diagnostics
entity_data = [
File "/config/custom_components/garbage_collection/diagnostics.py", line 21, in <listcomp>
if entities[entity].unique_id == entry.data["unique_id"]
KeyError: 'unique_id'
Before you submit a new bug report, please check that
Describe the bug
When recently changing my weekly garbage collection frequency from March-October to February-November I noticed that the date range is ignored and garbage collection is scheduled in December and January too.
I tried with a new entity and the behavior is the same.
Configuration:![image](https://user-images.githubusercontent.com/9624293/206404689-c1e57f87-9d5a-45ef-a135-4158727afbcc.png)
Result in calendar:![image](https://user-images.githubusercontent.com/9624293/206404972-4b80c052-a2a4-4aa2-bbb0-82e4747a9f56.png)
Configuration
Downloading diagnostics for this new entity doesn't work. Getting
500
error from HA.Here's diagnostics of the updated entity (same config, same behavior):
Debug logs
No logs related to this newly created entity. This instead (probably unrelated to the scheduling issue):