mirror of
https://github.com/esphome/esphome.git
synced 2025-09-06 05:12:21 +01: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