mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 04:33:27 +02:00
Correctly allow mqtt topics to be none so ESPHome does not sub/pub to them (#5213)
This commit is contained in:
@@ -1047,6 +1047,8 @@ def ipv4(value):
|
||||
|
||||
def _valid_topic(value):
|
||||
"""Validate that this is a valid topic name/filter."""
|
||||
if value is None: # Used to disable publishing and subscribing
|
||||
return ""
|
||||
if isinstance(value, dict):
|
||||
raise Invalid("Can't use dictionary with topic")
|
||||
value = string(value)
|
||||
|
||||
Reference in New Issue
Block a user