Why is this needed?
_to_proxy_event() has 7 sequential if/return statements (suppressed with # noqa PLR0911). A simple dict mapping ProxyEventType to event class replaces all of them.
Steps:
- Create
PROXY_EVENT_MAP: dict[ProxyEventType, type[BaseProxyEvent]] at module level
- Replace the if-chain with a dict lookup
- Remove the noqa
Which area does this relate to?
Event Handler - REST API
Suggestion
No response
Acknowledgment
Why is this needed?
_to_proxy_event()has 7 sequential if/return statements (suppressed with# noqa PLR0911). A simple dict mappingProxyEventTypeto event class replaces all of them.Steps:
PROXY_EVENT_MAP: dict[ProxyEventType, type[BaseProxyEvent]]at module levelWhich area does this relate to?
Event Handler - REST API
Suggestion
No response
Acknowledgment