Follow up from frenck's review on hacs/default#8674 (approved and merged, not a blocker).
set_log_level and set_mqtt_log_level are registered with async_register_admin_service, so they are admin only.
HonDebugSwitch (custom_components/addhon/switch.py:911) writes the same options, CONF_ENABLE_DEBUG and CONF_ENABLE_MQTT_DEBUG. The options update listener re-applies the log levels live, no reload. switch.turn_on has no admin gate in Home Assistant, so a non admin user can still enable integration wide debug logging from the entity.
Impact is bounded, credentials are redacted in debug_utils.py. Still, the two routes to the same capability disagree on who may use it.
To decide for a future release:
- restrict the switches
- remove them and keep only the Options flow and the admin services
- accept the divergence and document it
Follow up from frenck's review on hacs/default#8674 (approved and merged, not a blocker).
set_log_levelandset_mqtt_log_levelare registered withasync_register_admin_service, so they are admin only.HonDebugSwitch(custom_components/addhon/switch.py:911) writes the same options,CONF_ENABLE_DEBUGandCONF_ENABLE_MQTT_DEBUG. The options update listener re-applies the log levels live, no reload.switch.turn_onhas no admin gate in Home Assistant, so a non admin user can still enable integration wide debug logging from the entity.Impact is bounded, credentials are redacted in
debug_utils.py. Still, the two routes to the same capability disagree on who may use it.To decide for a future release: