def valid_subscribe_topic(value, invalid_chars='\x00'):
 if (isinstance(value, str) and all(((c not in value) for c in invalid_chars))):
  return vol.Length(min=1, max=65535)(value)
 raise vol.Invalid('Invalid MQTT topic name')

def valid_subscribe_topic ( value , invalid_chars = '\x00' ) : if ( isinstance ( value , str ) and all ( ( ( c not in value ) for c in invalid_chars ) ) ) : return vol . Length ( min = 1 , max = 65535 ) ( value ) raise vol . Invalid ( 'Invalid MQTT topic name' )
validate that we can subscribe using this mqtt topic .